mNo edit summary |
No edit summary |
||
(10 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:libMobileGestalt.dylib}} | {{DISPLAYTITLE:libMobileGestalt.dylib}} | ||
'''libMobileGestalt''' is a library that can be used to get various system values such as the UDID, disk usage, device version and much more. It is comparable to [[liblockdown.dylib]]. | '''libMobileGestalt''' is a library that can be used to get various system values such as the UDID, disk usage, device version and much more. It is comparable to [[liblockdown.dylib]]. See also [[lockdownd]]. | ||
== | == MGCopyAnswer == | ||
<source lang=c> | <source lang=c> | ||
// Common form: MGCopyAnswer(CFStringRef string); | |||
CFStringRef value = MGCopyAnswer(kMGDeviceColor); | CFStringRef value = MGCopyAnswer(kMGDeviceColor); | ||
NSLog(@"Value: %@", value); | NSLog(@"Value: %@", value); | ||
Line 10: | Line 11: | ||
</source> | </source> | ||
== MGGetBoolAnswer (iOS 7+) == | |||
<source lang=c> | |||
// bool MGGetBoolAnswer(CFStringRef key); | |||
bool value = MGGetBoolAnswer(CFSTR("UIProceduralWallpaperCapability")); | |||
NSLog(@"Value: %d", value); | |||
</source> | |||
== Generate Obfuscated Key == | |||
<source lang=objc> | |||
char buffer[256] = { 0 }; | |||
snprintf(buffer, sizeof(buffer), "%s%s", "MGCopyAnswer", key); | |||
unsigned char md5Hash[CC_MD5_DIGEST_LENGTH] = { 0 }; | |||
CC_MD5(buffer, (CC_LONG)strlen(buffer), md5Hash); | |||
NSData *data = [NSData dataWithBytes:md5Hash length:CC_MD5_DIGEST_LENGTH]; | |||
NSString *obfuscatedKey = [[data base64EncodedStringWithOptions:0] substringToIndex:22]; | |||
</source> | |||
== References == | == References == | ||
* Header: https://github.com/ | * Header: https://github.com/theos/headers/blob/master/MobileGestalt/MobileGestalt.h | ||
* Example: https://github.com/ProcursusTeam/uikittools-ng/blob/main/mgask.m | |||
== External links == | |||
* [https://blog.timac.org/2017/0124-deobfuscating-libmobilegestalt-keys/ Deobfuscating libMobileGestalt keys] | |||
* [https://github.com/PoomSmart/MGKeys List of all decrypted keys] | |||
{{Navbox Frameworks}} | {{Navbox Frameworks}} | ||
[[Category:Dynamic Libraries]] | [[Category:Dynamic Libraries]] |
Latest revision as of 16:20, 25 April 2022
libMobileGestalt is a library that can be used to get various system values such as the UDID, disk usage, device version and much more. It is comparable to liblockdown.dylib. See also lockdownd.
MGCopyAnswer
// Common form: MGCopyAnswer(CFStringRef string);
CFStringRef value = MGCopyAnswer(kMGDeviceColor);
NSLog(@"Value: %@", value);
CFRelease(value);
MGGetBoolAnswer (iOS 7+)
// bool MGGetBoolAnswer(CFStringRef key);
bool value = MGGetBoolAnswer(CFSTR("UIProceduralWallpaperCapability"));
NSLog(@"Value: %d", value);
Generate Obfuscated Key
char buffer[256] = { 0 };
snprintf(buffer, sizeof(buffer), "%s%s", "MGCopyAnswer", key);
unsigned char md5Hash[CC_MD5_DIGEST_LENGTH] = { 0 };
CC_MD5(buffer, (CC_LONG)strlen(buffer), md5Hash);
NSData *data = [NSData dataWithBytes:md5Hash length:CC_MD5_DIGEST_LENGTH];
NSString *obfuscatedKey = [[data base64EncodedStringWithOptions:0] substringToIndex:22];
References
External links