






UIKit and AppDelegate . In .pch also remove too much, leaving only Foundation.h . We also remove the UIApplication from the main() UIApplication , just put return 0.DYLD_ROOT_PATH parameter, that is, the path to which the dyld “attaches” all the paths to the frameworks or libs in the file.
hackup.console to the terminal with the pre-typed cd . $ pwd /Users/silvansky/Library/Developer/Xcode/DerivedData/hackup-cbpgmjwwgsfnqlgjnrlcnbjcxnmu/Build/Products/Debug-iphonesimulator/hackup.console $ ./hackupdyld: Symbol not found: _OBJC_CLASS_$_NSString Referenced from: /Users/silvansky/Library/Developer/Xcode/DerivedData/hackup-cbpgmjwwgsfnqlgjnrlcnbjcxnmu/Build/Products/Debug-iphonesimulator/hackup.console/./hackup Expected in: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation in /Users/silvansky/Library/Developer/Xcode/DerivedData/hackup-cbpgmjwwgsfnqlgjnrlcnbjcxnmu/Build/Products/Debug-iphonesimulator/hackup.console/./hackup [1] 61835 trace trap ./hackup $ otool -L hackup hackup: /System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 992.0.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.0.0) /usr/lib/libSystem.dylib (compatibility version 1.0.0, current version 125.0.0) Foundation framework in the standard system folder. Of course, it differs from the framework we need for the simulator. $ DYLD_ROOT_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk" ./hackup stdout , replacing NSLog . I called my NSPrintf , here is its code: void NSPrintf(NSString *format, ...) { va_list args; va_start(args, format); NSString *message = [[[NSString alloc] initWithFormat:format arguments:args] autorelease]; va_end(args); std::cout << [message cStringUsingEncoding:NSUTF8StringEncoding]; } std::cout , in fact, therefore, do not forget to rename main.m to main.mm and connect iostream .- (id)applications the class ISSoftwareMap , included in the iTunesStore private framework. Well, let's set ourselves to call this method and print out whatever it returns to us!
NSBundle class. Let's write an auxiliary function that will try to load a private framework: BOOL loadPrivateFramework(NSString *framework) { NSString *path = [NSString stringWithFormat:@"/System/Library/PrivateFrameworks/%@.framework", framework]; NSBundle *b = [NSBundle bundleWithPath:path]; BOOL success = [[[b retain] autorelease] load]; if (!success) { NSPrintf(@"Failed to load private framework %@!\n", framework); } return success; } YES , then we can work with the loaded framework, or rather, the classes available in it become available to us. Now we need to get the ISSoftwareMap class, which can be done in this way: Class ISSoftwareMap = NSClassFromString(@"ISSoftwareMap"); + (id)currentMap or + (id)loadedMap to get an instance of the class. id isSoftwareMap = [ISSoftwareMap performSelector:@selector(currentMap)]; if (!isSoftwareMap) { isSoftwareMap = [ISSoftwareMap performSelector:@selector(loadedMap)]; } id *applications = [isSoftwareMap performSelector:@selector(applications)]; NSPrintf(@"applications:\n%@\n", applications); SDKSettings.plist in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/ and edit it. What did not work out? You are not the owner of the file? Well, yes, security policies and all that ... But we have sudo: $ sudo plutil -convert xml1 SDKSettings.plist $ sudo nano SDKSettings.plist $ sudo plutil -convert binary1 SDKSettings.plist CODE_SIGNING_REQUIRED in the XML CODE_SIGNING_REQUIRED and set its value to NO.
$ pwd /Users/silvansky/Library/Developer/Xcode/DerivedData/hackup-cbpgmjwwgsfnqlgjnrlcnbjcxnmu/Build/Products/Debug-iphoneos/hackup.console $ scp hackup root@192.168.2.2:/private/var/mobile/Documents/ root@192.168.2.2's password: hackup 100% 26KB 26.3KB/s 00:00 $ ssh mobile@192.168.2.2 mobile@192.168.2.2's password: iSilvansky:~ mobile$ ~/Documents/hackup ( "<ISSoftwareApplication: 0x18b4e0>: (ru.mail.agent, 335315530:11499676)", "<ISSoftwareApplication: 0x18d010>: (com.getdropbox.Dropbox, 327630330:11201748)", # ... some more ... "<ISSoftwareApplication: 0x1936f0>: (8HLDK844H7.net.litchie.idos, 377135644:2716751)" ) - (id)applications method returns us an NSArray containing objects of the type ISSoftwareApplication . The description of this class is also found in the private headers of the same framework. Well, the list of programs received, let's look at them more closely: NSArray *applications = [isSoftwareMap performSelector:@selector(applications)]; if (applications) { for (id app in applications) { NSPrintf(@" *** Info for application %@\n", app); LOG_SELECTOR(app, bundleIdentifier) LOG_SELECTOR(app, bundleShortVersionString) LOG_SELECTOR(app, bundleVersion) LOG_SELECTOR(app, accountDSID) LOG_SELECTOR(app, accountIdentifier) LOG_SELECTOR(app, softwareType) LOG_SELECTOR(app, versionIdentifier) LOG_SELECTOR(app, itemIdentifier) LOG_SELECTOR(app, containerPath) LOG_SELECTOR(app, storeFrontIdentifier) LOG_SELECTOR(app, description) } } LOG_SELECTOR defined as: #define LOG_SELECTOR(obj, sel)\ if ([obj respondsToSelector:@selector(sel)])\ {\ NSPrintf(@" "#sel": %@\n", [obj performSelector:@selector(sel)]);\ } iSilvansky:~ mobile$ ~/Documents/hackup *** Info for application <ISSoftwareApplication: 0x16d5d0>: (ru.mail.agent, 335315530:11499676) bundleIdentifier: ru.mail.agent bundleShortVersionString: 4.0 bundleVersion: 3815 accountDSID: 407343733 accountIdentifier: habrahabr.ru/users/silvansky/ softwareType: (null) versionIdentifier: 11499676 itemIdentifier: 335315530 containerPath: /private/var/mobile/Applications/374BF6DB-8773-4063-9D84-F5858DE7AEBE storeFrontIdentifier: 143441 description: <ISSoftwareApplication: 0x16d5d0>: (ru.mail.agent, 335315530:11499676) *** Info for application <ISSoftwareApplication: 0x16f100>: (com.getdropbox.Dropbox, 327630330:11201748) bundleIdentifier: com.getdropbox.Dropbox # ... many more ... iSilvansky:~ mobile$ ~/Documents/hackup ru.mail.agent com.getdropbox.Dropbox # ... more and more ... 8HLDK844H7.net.litchie.idos iSilvansky:~ mobile$ exit logout Connection to 192.168.2.2 closed. Source: https://habr.com/ru/post/163281/
All Articles