1.1 The GCDWebServer is a modern and lightweight GCD based HTTP 1.1 server designed to be embedded in iOS, macOS & tvOS apps. The library is implemented by Objective-C programming language. Network service is provided by adding handler to this library. There are default handlers serve as file servers which provide file listing, uploading/downing, and file editing (WebDAV) service in this library. Developer can also provide customized service by writing his own handler to execute command according to the client's request.
1.2 Misusage of this library will expose privacy or functionality to adversary. To find the misusage of this library, we perform a case-by-case study of the interface of this library, then carry out analysis on apps. To promote the performance of automatic analysis of this Objective-C library, we use a combination of signature query and a devised dataflow analysis methodology.
1.3 The 2 models for using this library are:
1) Standard service: The standard service is implemented by using default handler in this library, that is WebServer, WebUploader, or WebDAVServer, which provide file listing, file uploading/downloading, file management service. For such a service, users build request without arguments to get the service. (e.g., http://192.168.1.8 for listing files in Now app.)
2) Customized service. The customized service is implemented by adding/overwriting handler through addDefaultHandlerForMethod:requestClass:processBlock, addDefaultHandlerForMethod:requestClass:asyncProcessBlock, addHandlerForMethod:path:requestClass:processBlock:, addHandlerForMethod:pathRegex:requestClass:processBlock:,
and WebServer. For such a service, users are commonly required to build a request (it depends) with arguments to get the service. (e.g., http://192.168.1.13/manifest?type=master for requesting resource in Amazon Prime Video app.)
There are a few security problems incur remote attack when misusing this library.
2.1 Leaks privacy. If developer use this library to share file, the wrong configuration will expose privacy within the app. For example, in the initial release of Ionic Webview library, the library use LAN interface when integrating GCDWebServer library, which will expose the whole file system of a jailbroken device to adversary.
2.2 Lack of access control for the handlers. If developer add handler to provide customized functionality, the firmly access control should be enforced. For a customized service, manual analysis must be involved to check the authorize process or the functionalities behind the service.
2.3 Path Traversal attack. Unlike CocoaHTTPServer, which utilizing stringByStandardizingPath API to standardize the path and apply additional checks to prevent Path Traversal attack, there is no security consideration towards this attack in GCDWebServer. That is, adversary can access files outside the web root folder by using a “dot-dot-slash (../)” request when the GCDWebServer is served as a file server (e.g., static website, WebDAV service). For this attack, the web root should be set to Data folder by the developer as to access the privacy (cookies, sessions, etc.) within an app. If the web root folder is set to Bundle folder (use NSBundle as Ionic's Webview does), it's hard for the adversary to predict the randomly generated Data path to access privacies of an app. e.g., CloudLink, a HuaWei's app use host field in a HTTP header to verify a request, however, it's can be easily impersonated by an attacker, fortunately, the root web folder is set to Bundle folder, which mitigate the remote attack.
Update:
2019-1-5: GCDWebServer has fixed the Path Traversal vulnerability. However, most apps integrating this library have not upgrade their apps.
2018-12-20: GCDWebServer is deprecated by Ionic's Webview.
There are a few factors lead to a successful exploit toward apps using GCDWebServer.
3.1 App indicates to use LAN interface. Below code will defeat the attack toward network service.
webServer = [[GCDWebServer alloc] init]; NSDictionary *options = @{ GCDWebServerOption_Port: @(8080), GCDWebServerOption_BindToLocalhost: @(YES), GCDWebServerOption_ServerName: @"Ionic" }; [webServer startWithOptions:options error:nil];In the view of a static analyzer, it should model the activity of NSDictionary object, as to solve value in the stack which preserve pointer point to the key-value pair. Moreover, it should model the memory which preserves the key-value pair, GCDWebServerOption_BindToLocalhost and @(YES) in this case.
3.2 When serving as a file server, web root folder should be set to Data folder. Below code snippet will expose the private Data folder to client.
NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; _webUploader = [[GCDWebUploader alloc] initWithUploadDirectory:documentsPath]; [_webUploader start]; NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; _davServer = [[GCDWebDAVServer alloc] initWithUploadDirectory:documentsPath]; [_davServer start]; GCDWebServer* webServer = [[GCDWebServer alloc] init]; [webServer addGETHandlerForBasePath:@"/" directoryPath:NSHomeDirectory() indexFilename:nil cacheAge:3600 allowRangeRequests:YES]; [webServer runWithPort:8080];3.3 If developers use GCDWebServer to provide customized service, they can add handlers for GCDWebServer. Since the implementation of handlers varies as developer wishes, manual analysis must be involved to check the handlers.
[webServer addDefaultHandlerForMethod:@"GET" requestClass:[GCDWebServerRequest class] asyncProcessBlock:^(GCDWebServerRequest* request, GCDWebServerCompletionBlock completionBlock) { // Do some async operation like network access or file I/O (simulated here using dispatch_after()) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ GCDWebServerDataResponse* response = [GCDWebServerDataResponse responseWithHTML:@"<html><body><p>Hello World</p></body></html>"]; completionBlock(response); });}];3.4 To verify the resource (nonsense files or privacy) behind the GCDWebServer, manual analysis must be involved.
To make step 4.3-4.4 clearly, We take 3 code snippets for example.
Example 1:
webServer = [[GCDWebServer alloc] init]; [webServer addGETHandlerForBasePath:@"/" directoryPath:NSHomeDirectory() indexFilename:nil cacheAge:3600 allowRangeRequests:YES]; [webServer start];This code will turn app to be a file server by using GCDWebServer library. Since IR for the code is boring and not easy to read (Appendix 4), to make the process explicitly, we use the equivalent (except for the SSA property) IDA disassembly.
__text:00000001000256AC ; bool __cdecl -[AppDelegate application:didFinishLaunchingWithOptions:](AppDelegate *self, SEL, id, id)__text:00000001000256AC __AppDelegate_application_didFinishLaunchingWithOptions____text:00000001000256AC ; DATA XREF: __objc_const:0000000100043100↓o__text:00000001000256AC__text:00000001000256AC var_44 = -0x44__text:00000001000256AC var_40 = -0x40__text:00000001000256AC var_38 = -0x38__text:00000001000256AC var_30 = -0x30__text:00000001000256AC var_28 = -0x28__text:00000001000256AC var_20 = -0x20__text:00000001000256AC var_18 = -0x18__text:00000001000256AC var_10 = -0x10__text:00000001000256AC var_8 = -8__text:00000001000256AC var_s0 = 0__text:00000001000256AC__text:00000001000256AC SUB SP, SP, #0x60__text:00000001000256B0 STP X29, X30, [SP,#0x50+var_s0]__text:00000001000256B4 ADD X29, SP, #0x50__text:00000001000256B8 SUB X8, X29, #-var_18__text:00000001000256BC MOV X9, #0__text:00000001000256C0 STUR X0, [X29,#var_8]__text:00000001000256C4 STUR X1, [X29,#var_10]__text:00000001000256C8 STUR X9, [X29,#var_18]__text:00000001000256CC MOV X0, X8__text:00000001000256D0 MOV X1, X2__text:00000001000256D4 STR X3, [SP,#0x50+var_30]__text:00000001000256D8 BL _objc_storeStrong__text:00000001000256DC SUB X8, X29, #-var_20__text:00000001000256E0 MOV X9, #0__text:00000001000256E4 STUR X9, [X29,#var_20]__text:00000001000256E8 LDR X9, [SP,#0x50+var_30]__text:00000001000256EC MOV X0, X8__text:00000001000256F0 MOV X1, X9__text:00000001000256F4 BL _objc_storeStrong__text:00000001000256F8 ADRP X8, #selRef_alloc@PAGE__text:00000001000256FC ADD X8, X8, #selRef_alloc@PAGEOFF__text:0000000100025700 ADRP X9, #classRef_GCDWebServer@PAGE__text:0000000100025704 ADD X9, X9, #classRef_GCDWebServer@PAGEOFF__text:0000000100025708 MOV X0, #0__text:000000010002570C STR X0, [SP,#0x50+var_28]__text:0000000100025710 LDR X9, [X9] ; _OBJC_CLASS_$_GCDWebServer__text:0000000100025714 LDR X1, [X8] ; "alloc"__text:0000000100025718 MOV X0, X9 ; void *__text:000000010002571C BL _objc_msgSend__text:0000000100025720 ADRP X8, #selRef_init@PAGE__text:0000000100025724 ADD X8, X8, #selRef_init@PAGEOFF__text:0000000100025728 LDR X1, [X8] ; "init"__text:000000010002572C BL _objc_msgSend__text:0000000100025730 LDR X8, [SP,#0x50+var_28]__text:0000000100025734 STR X0, [SP,#0x50+var_28]__text:0000000100025738 MOV X0, X8__text:000000010002573C BL _objc_release__text:0000000100025740 LDR X8, [SP,#0x50+var_28]__text:0000000100025744 STR X8, [SP,#0x50+var_38]__text:0000000100025748 BL _NSHomeDirectory__text:000000010002574C MOV X29, X29__text:0000000100025750 BL _objc_retainAutoreleasedReturnValue__text:0000000100025754 ADRP X8, #stru_10003DBA8@PAGE ; "/"__text:0000000100025758 ADD X8, X8, #stru_10003DBA8@PAGEOFF ; "/"__text:000000010002575C MOV X9, #0__text:0000000100025760 MOV X5, #0xE10__text:0000000100025764 MOV W10, #1__text:0000000100025768 ADRP X1, #selRef_addGETHandlerForBasePath_directoryPath_indexFilename_cacheAge_allowRangeRequests_@PAGE__text:000000010002576C ADD X1, X1, #selRef_addGETHandlerForBasePath_directoryPath_indexFilename_cacheAge_allowRangeRequests_@PAGEOFF__text:0000000100025770 LDR X1, [X1] ; "addGETHandlerForBasePath:directoryPath:"...__text:0000000100025774 LDR X2, [SP,#0x50+var_38]__text:0000000100025778 STR X0, [SP,#0x50+var_40]__text:000000010002577C MOV X0, X2 ; void *__text:0000000100025780 MOV X2, X8__text:0000000100025784 LDR X3, [SP,#0x50+var_40]__text:0000000100025788 MOV X4, X9__text:000000010002578C AND W6, W10, #1__text:0000000100025790 BL _objc_msgSend__text:0000000100025794 LDR X0, [SP,#0x50+var_40]__text:0000000100025798 BL _objc_release__text:000000010002579C ADRP X8, #selRef_start@PAGE__text:00000001000257A0 ADD X8, X8, #selRef_start@PAGEOFF__text:00000001000257A4 LDR X9, [SP,#0x50+var_28]__text:00000001000257A8 LDR X1, [X8] ; "start"__text:00000001000257AC MOV X0, X9 ; void *__text:00000001000257B0 BL _objc_msgSend__text:00000001000257B4 MOV X8, #0__text:00000001000257B8 ADD X9, SP, #0x50+var_28__text:00000001000257BC STR W0, [SP,#0x50+var_44]__text:00000001000257C0 MOV X0, X9__text:00000001000257C4 MOV X1, X8__text:00000001000257C8 BL _objc_storeStrong__text:00000001000257CC MOV X8, #0__text:00000001000257D0 SUB X9, X29, #-var_20__text:00000001000257D4 MOV X0, X9__text:00000001000257D8 MOV X1, X8__text:00000001000257DC BL _objc_storeStrong__text:00000001000257E0 MOV X8, #0__text:00000001000257E4 SUB X9, X29, #-var_18__text:00000001000257E8 MOV X0, X9__text:00000001000257EC MOV X1, X8__text:00000001000257F0 BL _objc_storeStrong__text:00000001000257F4 MOV W10, #1__text:00000001000257F8 AND W0, W10, #1__text:00000001000257FC LDP X29, X30, [SP,#0x50+var_s0]__text:0000000100025800 ADD SP, SP, #0x60__text:0000000100025804 RET__text:0000000100025804 ; End of function -[AppDelegate application:didFinishLaunchingWithOptions:]00000001000257B0 and 0000000100025790 point to the same object of GCDWebServer. They are calling [GCDWebServer start] and [GCDWebServer addGETHandlerForBasePath:directoryPath:indexFilename:cacheAge:allowRangeRequests] separately. (To reach 0000000100025700, the def of X0, we need to summary the function alloc and init.)0000000100025790:_objc_msgSend, say X3, comes from 0000000100025748 (marked as `normal size text`), which is returned by calling _NSHomeDirectory method.For this model, the checking rule is depicted as:
Desc:Unsafe for serving as a file servero:=GCDWebServer{ m:=start m:=addGETHandlerForBasePath:directoryPath:indexFilename:cacheAge:allowRangeRequests: { a3!=[NSBundle ?] } }Example 2:
NSDictionary *options = @{ GCDWebServerOption_Port: @(8080), GCDWebServerOption_BindToLocalhost: @(YES), GCDWebServerOption_ServerName: @"Ionic" }; [webServer addGETHandlerForBasePath:@"/" directoryPath:NSHomeDirectory() indexFilename:nil cacheAge:3600 allowRangeRequests:YES]; [webServer startWithOptions:options error:nil];Checking Rule:
Desc:Safe for using localhost interfaceo:=GCDWebServer{ m:=startWithOptions:options: { a2:=[NSDictionary dictionaryWithObjects:forKeys:count:] { {a3[0][0] == "BindToLocalhost" and a3[0][1] == 1} or {a3[1][0] == "BindToLocalhost" and a3[1][1] == 1} or {a3[2][0] == "BindToLocalhost" and a3[2][1] == 1} or } }}Example 3:
webServer = [[GCDWebServer alloc] init]; [webServer addDefaultHandlerForMethod:@"GET" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse *(GCDWebServerRequest* request) { return @"Hello World"; }]; [webServer start];Checking Rule (A customized service, besides privacy, functionality may be provided. So, the web root folder is not checked.):
Desc:Check manuallyo:=GCDWebServer{ m:=start m:=addDefaultHandlerForMethod:requestClass:processBlock:}5.1 Out of 168,951 apps of our dataset, 2097 apps are spotted integrating GCDWebServer directly or indirectly, which is depicted in Appendix 1.
5.2 After filtering Ionic's Webview or AdColony library (Appendix 5), which are build on top of GCDWebServer , 729 apps are left (Appendix 2).
5.3 For the remaining 729 apps, we utilize our dataflow analyzer to translate the binary to intermediate representation (IR), 716 apps can be successfully parsed by our IR translate module.
5.4 After that, we apply intra-procedure dataflow analysis to solve variable in the IR.
5.5 Rules are applied to the dataflow analysis result to profile the dataset.
5.5.1 By using rules which model local host service and dead object reference, 199 apps which provide network service to local host or does not use the library (takes 24.72% of the dataset) are found in 716 apps. Among these apps, 46 apps wrapping (inherit) GCDWebServer, for we have preserved the hierarchies of classes, such variant can also be found by our analyzer.
5.5.2 We apply rules which model the pattern of GCDWebServer misusage to check the security of the 517 iOS apps. The analysis result is depicted in Appendix 3. To explain fields in the analysis result, we take Now app for example.
com.tencent.now; DefaultHandlerForMethod:0; DefaultHandlerForMethod_async:0; HandlerForMethod:0; HandlerForMethod_reg:0; startWithOptions:0; BindToLocalhost:0; isObfuscated:0; GCDWebServer:1; GCDWebDAVServer:0; GCDWebUploader:0;The analysis result reveals that the Now app: 1) use GCDWebServer as a file server, for it does not implemented it's own handler (DefaultHandlerForMethod, DefaultHandlerForMethod_async, HandlerForMethod, and HandlerForMethod_reg field). 2) does not set the BindToLocalhost argument as to use the LAN interface. 3) indeed use the GCDWebServer library (not a dead object as GCDWebServer field indicate). All these factors leads to a remote exploit towards the Now app.
5.6 We also category the usage of this library, the distribution is depicted as Table 4. After manually checking the reported potentially vulnerable apps, 83 apps really misuse the library. The left apps are still in manual checking pipeline for it's hard to trigger the service to verify the vulnerability. To solve such problem, we have tried to connect the code with UI to automatically reveal the network service behind user interaction, however, the undisclosed format of the .nib file, which stores the visual elements and relation between UI and code of an iOS app, impedes the static parsing task.
define void @"-[AppDelegate application:didFinishLaunchingWithOptions:]"(%regset* noalias nocapture) {entry_fn_1000256AC: %SP_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 3 %SP_init = load i64, i64* %SP_ptr, align 4 %FP_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 0 %FP_init = load i64, i64* %FP_ptr, align 4 %LR_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 1 %LR_init = load i64, i64* %LR_ptr, align 4 %X8_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 13 %X8_init = load i64, i64* %X8_ptr, align 4 %X9_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 14 %X9_init = load i64, i64* %X9_ptr, align 4 %X0_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 5 %X0_init = load i64, i64* %X0_ptr, align 4 %X1_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 6 %X1_init = load i64, i64* %X1_ptr, align 4 %W0_init = trunc i64 %X0_init to i32 %X2_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 7 %X2_init = load i64, i64* %X2_ptr, align 4 %X3_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 8 %X3_init = load i64, i64* %X3_ptr, align 4 %X5_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 10 %X5_init = load i64, i64* %X5_ptr, align 4 %X10_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 15 %X10_init = load i64, i64* %X10_ptr, align 4 %X4_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 9 %X4_init = load i64, i64* %X4_ptr, align 4 %X6_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 11 %X6_init = load i64, i64* %X6_ptr, align 4 %X7_ptr = getelementptr inbounds %regset, %regset* %0, i64 0, i32 12 %X7_init = load i64, i64* %X7_ptr, align 4 br label %bb_1000256ACexit_fn_1000256AC: ; preds = %bb_c1000257F0 store i64 %FP_7885, i64* %FP_ptr, align 4 store i64 %LR_4597, i64* %LR_ptr, align 4 store i64 %SP_7507, i64* %SP_ptr, align 4 store i64 1, i64* %X0_ptr, align 4 store i64 %X1_6860, i64* %X1_ptr, align 4 store i64 %X2_5028, i64* %X2_ptr, align 4 store i64 %X3_4328, i64* %X3_ptr, align 4 store i64 %X4_4028, i64* %X4_ptr, align 4 store i64 %X5_3902, i64* %X5_ptr, align 4 store i64 %X6_3847, i64* %X6_ptr, align 4 store i64 %X7_3821, i64* %X7_ptr, align 4 store i64 %X8_9549, i64* %X8_ptr, align 4 store i64 %X9_7475, i64* %X9_ptr, align 4 store i64 1, i64* %X10_ptr, align 4 ret voidbb_1000256AC: ; preds = %entry_fn_1000256AC %SP_7497 = add i64 %SP_init, -96 %1 = add i64 %SP_init, -16 %2 = inttoptr i64 %1 to i64* store i64 %FP_init, i64* %2, align 1 %3 = add i64 %SP_init, -8 %4 = inttoptr i64 %3 to i64* store i64 %LR_init, i64* %4, align 1 %FP_7879 = add i64 %SP_init, -16 %X8_9522 = add i64 %SP_init, -40 %5 = add i64 %SP_init, -24 %6 = inttoptr i64 %5 to i64* store i64 %X0_init, i64* %6, align 1 %7 = add i64 %SP_init, -32 %8 = inttoptr i64 %7 to i64* store i64 %X1_init, i64* %8, align 1 %9 = add i64 %SP_init, -40 %10 = inttoptr i64 %9 to i64* store i64 0, i64* %10, align 1 %W0_7588 = trunc i64 %X8_9522 to i32 %11 = add i64 %SP_init, -64 %12 = inttoptr i64 %11 to i64* store i64 %X3_init, i64* %12, align 1 br label %bb_1000256AC_callbb_1000256AC_call: ; preds = %bb_1000256AC store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_init, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X8_9522, i64* %X0_ptr, align 4 store i64 %X2_init, i64* %X1_ptr, align 4 store i64 %X2_init, i64* %X2_ptr, align 4 store i64 %X3_init, i64* %X3_ptr, align 4 store i64 %X4_init, i64* %X4_ptr, align 4 store i64 %X5_init, i64* %X5_ptr, align 4 store i64 %X6_init, i64* %X6_ptr, align 4 store i64 %X7_init, i64* %X7_ptr, align 4 store i64 %X8_9522, i64* %X8_ptr, align 4 store i64 0, i64* %X9_ptr, align 4 store i64 %X10_init, i64* %X10_ptr, align 4 call void @objc_storeStrong(%regset* %0) %LR_4598 = load i64, i64* %LR_ptr, align 4 %X0_8883 = load i64, i64* %X0_ptr, align 4 %W0_7601 = trunc i64 %X0_8883 to i32 %X1_6848 = load i64, i64* %X1_ptr, align 4 %X2_5016 = load i64, i64* %X2_ptr, align 4 %X3_4316 = load i64, i64* %X3_ptr, align 4 %X4_4016 = load i64, i64* %X4_ptr, align 4 %X5_3890 = load i64, i64* %X5_ptr, align 4 %X6_3835 = load i64, i64* %X6_ptr, align 4 %X7_3809 = load i64, i64* %X7_ptr, align 4 %X8_9537 = load i64, i64* %X8_ptr, align 4 %X9_7463 = load i64, i64* %X9_ptr, align 4 %X10_4423 = load i64, i64* %X10_ptr, align 4 br label %bb_c1000256D8bb_c1000256D8: ; preds = %bb_1000256AC_call %X8_9523 = add i64 %FP_7879, -32 %13 = add i64 %FP_7879, -32 %14 = inttoptr i64 %13 to i64* store i64 0, i64* %14, align 1 %15 = add i64 %SP_7497, 32 %16 = inttoptr i64 %15 to i64* %X9_7454 = load i64, i64* %16, align 1 %W0_7589 = trunc i64 %X8_9523 to i32 br label %bb_c1000256D8_callbb_c1000256D8_call: ; preds = %bb_c1000256D8 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4598, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X8_9523, i64* %X0_ptr, align 4 store i64 %X9_7454, i64* %X1_ptr, align 4 store i64 %X2_5016, i64* %X2_ptr, align 4 store i64 %X3_4316, i64* %X3_ptr, align 4 store i64 %X4_4016, i64* %X4_ptr, align 4 store i64 %X5_3890, i64* %X5_ptr, align 4 store i64 %X6_3835, i64* %X6_ptr, align 4 store i64 %X7_3809, i64* %X7_ptr, align 4 store i64 %X8_9523, i64* %X8_ptr, align 4 store i64 %X9_7454, i64* %X9_ptr, align 4 store i64 %X10_4423, i64* %X10_ptr, align 4 call void @objc_storeStrong(%regset* %0) %LR_4599 = load i64, i64* %LR_ptr, align 4 %X0_8884 = load i64, i64* %X0_ptr, align 4 %W0_7602 = trunc i64 %X0_8884 to i32 %X1_6849 = load i64, i64* %X1_ptr, align 4 %X2_5017 = load i64, i64* %X2_ptr, align 4 %X3_4317 = load i64, i64* %X3_ptr, align 4 %X4_4017 = load i64, i64* %X4_ptr, align 4 %X5_3891 = load i64, i64* %X5_ptr, align 4 %X6_3836 = load i64, i64* %X6_ptr, align 4 %X7_3810 = load i64, i64* %X7_ptr, align 4 %X8_9538 = load i64, i64* %X8_ptr, align 4 %X9_7464 = load i64, i64* %X9_ptr, align 4 %X10_4424 = load i64, i64* %X10_ptr, align 4 br label %bb_c1000256F4bb_c1000256F4: ; preds = %bb_c1000256D8_call %17 = add i64 %SP_7497, 40 %18 = inttoptr i64 %17 to i64* store i64 0, i64* %18, align 1 %X9_7457 = load i64, i64* inttoptr (i64 4295253320 to i64*), align 8 %X1_6839 = load i64, i64* inttoptr (i64 4295250736 to i64*), align 16 %W0_7591 = trunc i64 %X9_7457 to i32 br label %bb_c1000256F4_callbb_c1000256F4_call: ; preds = %bb_c1000256F4 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4599, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X9_7457, i64* %X0_ptr, align 4 store i64 %X1_6839, i64* %X1_ptr, align 4 store i64 %X2_5017, i64* %X2_ptr, align 4 store i64 %X3_4317, i64* %X3_ptr, align 4 store i64 %X4_4017, i64* %X4_ptr, align 4 store i64 %X5_3891, i64* %X5_ptr, align 4 store i64 %X6_3836, i64* %X6_ptr, align 4 store i64 %X7_3810, i64* %X7_ptr, align 4 store i64 4295250736, i64* %X8_ptr, align 4 store i64 %X9_7457, i64* %X9_ptr, align 4 store i64 %X10_4424, i64* %X10_ptr, align 4 call void @objc_msgSend(%regset* %0) %LR_4600 = load i64, i64* %LR_ptr, align 4 %X0_8885 = load i64, i64* %X0_ptr, align 4 %W0_7603 = trunc i64 %X0_8885 to i32 %X1_6850 = load i64, i64* %X1_ptr, align 4 %X2_5018 = load i64, i64* %X2_ptr, align 4 %X3_4318 = load i64, i64* %X3_ptr, align 4 %X4_4018 = load i64, i64* %X4_ptr, align 4 %X5_3892 = load i64, i64* %X5_ptr, align 4 %X6_3837 = load i64, i64* %X6_ptr, align 4 %X7_3811 = load i64, i64* %X7_ptr, align 4 %X8_9539 = load i64, i64* %X8_ptr, align 4 %X9_7465 = load i64, i64* %X9_ptr, align 4 %X10_4425 = load i64, i64* %X10_ptr, align 4 br label %bb_c10002571Cbb_c10002571C: ; preds = %bb_c1000256F4_call %X1_6840 = load i64, i64* inttoptr (i64 4295250160 to i64*), align 16 br label %bb_c10002571C_callbb_c10002571C_call: ; preds = %bb_c10002571C store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4600, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X0_8885, i64* %X0_ptr, align 4 store i64 %X1_6840, i64* %X1_ptr, align 4 store i64 %X2_5018, i64* %X2_ptr, align 4 store i64 %X3_4318, i64* %X3_ptr, align 4 store i64 %X4_4018, i64* %X4_ptr, align 4 store i64 %X5_3892, i64* %X5_ptr, align 4 store i64 %X6_3837, i64* %X6_ptr, align 4 store i64 %X7_3811, i64* %X7_ptr, align 4 store i64 4295250160, i64* %X8_ptr, align 4 store i64 %X9_7465, i64* %X9_ptr, align 4 store i64 %X10_4425, i64* %X10_ptr, align 4 call void @objc_msgSend(%regset* %0) %LR_4601 = load i64, i64* %LR_ptr, align 4 %X0_8886 = load i64, i64* %X0_ptr, align 4 %W0_7604 = trunc i64 %X0_8886 to i32 %X1_6851 = load i64, i64* %X1_ptr, align 4 %X2_5019 = load i64, i64* %X2_ptr, align 4 %X3_4319 = load i64, i64* %X3_ptr, align 4 %X4_4019 = load i64, i64* %X4_ptr, align 4 %X5_3893 = load i64, i64* %X5_ptr, align 4 %X6_3838 = load i64, i64* %X6_ptr, align 4 %X7_3812 = load i64, i64* %X7_ptr, align 4 %X8_9540 = load i64, i64* %X8_ptr, align 4 %X9_7466 = load i64, i64* %X9_ptr, align 4 %X10_4426 = load i64, i64* %X10_ptr, align 4 br label %bb_c10002572Cbb_c10002572C: ; preds = %bb_c10002571C_call %19 = add i64 %SP_7497, 40 %20 = inttoptr i64 %19 to i64* %X8_9528 = load i64, i64* %20, align 1 %21 = add i64 %SP_7497, 40 %22 = inttoptr i64 %21 to i64* store i64 %X0_8886, i64* %22, align 1 %W0_7592 = trunc i64 %X8_9528 to i32 br label %bb_c10002572C_callbb_c10002572C_call: ; preds = %bb_c10002572C store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4601, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X8_9528, i64* %X0_ptr, align 4 store i64 %X1_6851, i64* %X1_ptr, align 4 store i64 %X2_5019, i64* %X2_ptr, align 4 store i64 %X3_4319, i64* %X3_ptr, align 4 store i64 %X4_4019, i64* %X4_ptr, align 4 store i64 %X5_3893, i64* %X5_ptr, align 4 store i64 %X6_3838, i64* %X6_ptr, align 4 store i64 %X7_3812, i64* %X7_ptr, align 4 store i64 %X8_9528, i64* %X8_ptr, align 4 store i64 %X9_7466, i64* %X9_ptr, align 4 store i64 %X10_4426, i64* %X10_ptr, align 4 call void @objc_release(%regset* %0) %LR_4602 = load i64, i64* %LR_ptr, align 4 %X0_8887 = load i64, i64* %X0_ptr, align 4 %W0_7605 = trunc i64 %X0_8887 to i32 %X1_6852 = load i64, i64* %X1_ptr, align 4 %X2_5020 = load i64, i64* %X2_ptr, align 4 %X3_4320 = load i64, i64* %X3_ptr, align 4 %X4_4020 = load i64, i64* %X4_ptr, align 4 %X5_3894 = load i64, i64* %X5_ptr, align 4 %X6_3839 = load i64, i64* %X6_ptr, align 4 %X7_3813 = load i64, i64* %X7_ptr, align 4 %X8_9541 = load i64, i64* %X8_ptr, align 4 %X9_7467 = load i64, i64* %X9_ptr, align 4 %X10_4427 = load i64, i64* %X10_ptr, align 4 br label %bb_c10002573Cbb_c10002573C: ; preds = %bb_c10002572C_call %23 = add i64 %SP_7497, 40 %24 = inttoptr i64 %23 to i64* %X8_9529 = load i64, i64* %24, align 1 %25 = add i64 %SP_7497, 24 %26 = inttoptr i64 %25 to i64* store i64 %X8_9529, i64* %26, align 1 br label %bb_c10002573C_callbb_c10002573C_call: ; preds = %bb_c10002573C store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4602, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X0_8887, i64* %X0_ptr, align 4 store i64 %X1_6852, i64* %X1_ptr, align 4 store i64 %X2_5020, i64* %X2_ptr, align 4 store i64 %X3_4320, i64* %X3_ptr, align 4 store i64 %X4_4020, i64* %X4_ptr, align 4 store i64 %X5_3894, i64* %X5_ptr, align 4 store i64 %X6_3839, i64* %X6_ptr, align 4 store i64 %X7_3813, i64* %X7_ptr, align 4 store i64 %X8_9529, i64* %X8_ptr, align 4 store i64 %X9_7467, i64* %X9_ptr, align 4 store i64 %X10_4427, i64* %X10_ptr, align 4 call void @NSHomeDirectory(%regset* %0) %LR_4603 = load i64, i64* %LR_ptr, align 4 %X0_8888 = load i64, i64* %X0_ptr, align 4 %W0_7606 = trunc i64 %X0_8888 to i32 %X1_6853 = load i64, i64* %X1_ptr, align 4 %X2_5021 = load i64, i64* %X2_ptr, align 4 %X3_4321 = load i64, i64* %X3_ptr, align 4 %X4_4021 = load i64, i64* %X4_ptr, align 4 %X5_3895 = load i64, i64* %X5_ptr, align 4 %X6_3840 = load i64, i64* %X6_ptr, align 4 %X7_3814 = load i64, i64* %X7_ptr, align 4 %X8_9542 = load i64, i64* %X8_ptr, align 4 %X9_7468 = load i64, i64* %X9_ptr, align 4 %X10_4428 = load i64, i64* %X10_ptr, align 4 br label %bb_c100025748bb_c100025748: ; preds = %bb_c10002573C_call br label %bb_c100025748_callbb_c100025748_call: ; preds = %bb_c100025748 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4603, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X0_8888, i64* %X0_ptr, align 4 store i64 %X1_6853, i64* %X1_ptr, align 4 store i64 %X2_5021, i64* %X2_ptr, align 4 store i64 %X3_4321, i64* %X3_ptr, align 4 store i64 %X4_4021, i64* %X4_ptr, align 4 store i64 %X5_3895, i64* %X5_ptr, align 4 store i64 %X6_3840, i64* %X6_ptr, align 4 store i64 %X7_3814, i64* %X7_ptr, align 4 store i64 %X8_9542, i64* %X8_ptr, align 4 store i64 %X9_7468, i64* %X9_ptr, align 4 store i64 %X10_4428, i64* %X10_ptr, align 4 call void @objc_retainAutoreleasedReturnValue(%regset* %0) %LR_4604 = load i64, i64* %LR_ptr, align 4 %X0_8889 = load i64, i64* %X0_ptr, align 4 %W0_7607 = trunc i64 %X0_8889 to i32 %X1_6854 = load i64, i64* %X1_ptr, align 4 %X2_5022 = load i64, i64* %X2_ptr, align 4 %X3_4322 = load i64, i64* %X3_ptr, align 4 %X4_4022 = load i64, i64* %X4_ptr, align 4 %X5_3896 = load i64, i64* %X5_ptr, align 4 %X6_3841 = load i64, i64* %X6_ptr, align 4 %X7_3815 = load i64, i64* %X7_ptr, align 4 %X8_9543 = load i64, i64* %X8_ptr, align 4 %X9_7469 = load i64, i64* %X9_ptr, align 4 %X10_4429 = load i64, i64* %X10_ptr, align 4 br label %bb_c100025750bb_c100025750: ; preds = %bb_c100025748_call %X1_6843 = load i64, i64* inttoptr (i64 4295252040 to i64*), align 8 %27 = add i64 %SP_7497, 24 %28 = inttoptr i64 %27 to i64* %X2_5014 = load i64, i64* %28, align 1 %29 = add i64 %SP_7497, 16 %30 = inttoptr i64 %29 to i64* store i64 %X0_8889, i64* %30, align 1 %W0_7593 = trunc i64 %X2_5014 to i32 %31 = add i64 %SP_7497, 16 %32 = inttoptr i64 %31 to i64* %X3_4315 = load i64, i64* %32, align 1 br label %bb_c100025750_callbb_c100025750_call: ; preds = %bb_c100025750 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4604, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X2_5014, i64* %X0_ptr, align 4 store i64 %X1_6843, i64* %X1_ptr, align 4 store i64 4295220136, i64* %X2_ptr, align 4 store i64 %X3_4315, i64* %X3_ptr, align 4 store i64 0, i64* %X4_ptr, align 4 store i64 3600, i64* %X5_ptr, align 4 store i64 1, i64* %X6_ptr, align 4 store i64 %X7_3815, i64* %X7_ptr, align 4 store i64 4295220136, i64* %X8_ptr, align 4 store i64 0, i64* %X9_ptr, align 4 store i64 1, i64* %X10_ptr, align 4 call void @objc_msgSend(%regset* %0) %LR_4605 = load i64, i64* %LR_ptr, align 4 %X0_8890 = load i64, i64* %X0_ptr, align 4 %W0_7608 = trunc i64 %X0_8890 to i32 %X1_6855 = load i64, i64* %X1_ptr, align 4 %X2_5023 = load i64, i64* %X2_ptr, align 4 %X3_4323 = load i64, i64* %X3_ptr, align 4 %X4_4023 = load i64, i64* %X4_ptr, align 4 %X5_3897 = load i64, i64* %X5_ptr, align 4 %X6_3842 = load i64, i64* %X6_ptr, align 4 %X7_3816 = load i64, i64* %X7_ptr, align 4 %X8_9544 = load i64, i64* %X8_ptr, align 4 %X9_7470 = load i64, i64* %X9_ptr, align 4 %X10_4430 = load i64, i64* %X10_ptr, align 4 br label %bb_c100025790bb_c100025790: ; preds = %bb_c100025750_call %33 = add i64 %SP_7497, 16 %34 = inttoptr i64 %33 to i64* %X0_8876 = load i64, i64* %34, align 1 %W0_7594 = trunc i64 %X0_8876 to i32 br label %bb_c100025790_callbb_c100025790_call: ; preds = %bb_c100025790 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4605, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X0_8876, i64* %X0_ptr, align 4 store i64 %X1_6855, i64* %X1_ptr, align 4 store i64 %X2_5023, i64* %X2_ptr, align 4 store i64 %X3_4323, i64* %X3_ptr, align 4 store i64 %X4_4023, i64* %X4_ptr, align 4 store i64 %X5_3897, i64* %X5_ptr, align 4 store i64 %X6_3842, i64* %X6_ptr, align 4 store i64 %X7_3816, i64* %X7_ptr, align 4 store i64 %X8_9544, i64* %X8_ptr, align 4 store i64 %X9_7470, i64* %X9_ptr, align 4 store i64 %X10_4430, i64* %X10_ptr, align 4 call void @objc_release(%regset* %0) %LR_4606 = load i64, i64* %LR_ptr, align 4 %X0_8891 = load i64, i64* %X0_ptr, align 4 %W0_7609 = trunc i64 %X0_8891 to i32 %X1_6856 = load i64, i64* %X1_ptr, align 4 %X2_5024 = load i64, i64* %X2_ptr, align 4 %X3_4324 = load i64, i64* %X3_ptr, align 4 %X4_4024 = load i64, i64* %X4_ptr, align 4 %X5_3898 = load i64, i64* %X5_ptr, align 4 %X6_3843 = load i64, i64* %X6_ptr, align 4 %X7_3817 = load i64, i64* %X7_ptr, align 4 %X8_9545 = load i64, i64* %X8_ptr, align 4 %X9_7471 = load i64, i64* %X9_ptr, align 4 %X10_4431 = load i64, i64* %X10_ptr, align 4 br label %bb_c100025798bb_c100025798: ; preds = %bb_c100025790_call %35 = add i64 %SP_7497, 40 %36 = inttoptr i64 %35 to i64* %X9_7459 = load i64, i64* %36, align 1 %X1_6844 = load i64, i64* inttoptr (i64 4295252312 to i64*), align 8 %W0_7595 = trunc i64 %X9_7459 to i32 br label %bb_c100025798_callbb_c100025798_call: ; preds = %bb_c100025798 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4606, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X9_7459, i64* %X0_ptr, align 4 store i64 %X1_6844, i64* %X1_ptr, align 4 store i64 %X2_5024, i64* %X2_ptr, align 4 store i64 %X3_4324, i64* %X3_ptr, align 4 store i64 %X4_4024, i64* %X4_ptr, align 4 store i64 %X5_3898, i64* %X5_ptr, align 4 store i64 %X6_3843, i64* %X6_ptr, align 4 store i64 %X7_3817, i64* %X7_ptr, align 4 store i64 4295252312, i64* %X8_ptr, align 4 store i64 %X9_7459, i64* %X9_ptr, align 4 store i64 %X10_4431, i64* %X10_ptr, align 4 call void @objc_msgSend(%regset* %0) %LR_4607 = load i64, i64* %LR_ptr, align 4 %X0_8892 = load i64, i64* %X0_ptr, align 4 %W0_7610 = trunc i64 %X0_8892 to i32 %X1_6857 = load i64, i64* %X1_ptr, align 4 %X2_5025 = load i64, i64* %X2_ptr, align 4 %X3_4325 = load i64, i64* %X3_ptr, align 4 %X4_4025 = load i64, i64* %X4_ptr, align 4 %X5_3899 = load i64, i64* %X5_ptr, align 4 %X6_3844 = load i64, i64* %X6_ptr, align 4 %X7_3818 = load i64, i64* %X7_ptr, align 4 %X8_9546 = load i64, i64* %X8_ptr, align 4 %X9_7472 = load i64, i64* %X9_ptr, align 4 %X10_4432 = load i64, i64* %X10_ptr, align 4 br label %bb_c1000257B0bb_c1000257B0: ; preds = %bb_c100025798_call %X9_7460 = add i64 %SP_7497, 40 %37 = add i64 %SP_7497, 12 %38 = inttoptr i64 %37 to i32* store i32 %W0_7610, i32* %38, align 1 %W0_7597 = trunc i64 %X9_7460 to i32 br label %bb_c1000257B0_callbb_c1000257B0_call: ; preds = %bb_c1000257B0 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4607, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X9_7460, i64* %X0_ptr, align 4 store i64 0, i64* %X1_ptr, align 4 store i64 %X2_5025, i64* %X2_ptr, align 4 store i64 %X3_4325, i64* %X3_ptr, align 4 store i64 %X4_4025, i64* %X4_ptr, align 4 store i64 %X5_3899, i64* %X5_ptr, align 4 store i64 %X6_3844, i64* %X6_ptr, align 4 store i64 %X7_3818, i64* %X7_ptr, align 4 store i64 0, i64* %X8_ptr, align 4 store i64 %X9_7460, i64* %X9_ptr, align 4 store i64 %X10_4432, i64* %X10_ptr, align 4 call void @objc_storeStrong(%regset* %0) %LR_4608 = load i64, i64* %LR_ptr, align 4 %X0_8893 = load i64, i64* %X0_ptr, align 4 %W0_7611 = trunc i64 %X0_8893 to i32 %X1_6858 = load i64, i64* %X1_ptr, align 4 %X2_5026 = load i64, i64* %X2_ptr, align 4 %X3_4326 = load i64, i64* %X3_ptr, align 4 %X4_4026 = load i64, i64* %X4_ptr, align 4 %X5_3900 = load i64, i64* %X5_ptr, align 4 %X6_3845 = load i64, i64* %X6_ptr, align 4 %X7_3819 = load i64, i64* %X7_ptr, align 4 %X8_9547 = load i64, i64* %X8_ptr, align 4 %X9_7473 = load i64, i64* %X9_ptr, align 4 %X10_4433 = load i64, i64* %X10_ptr, align 4 br label %bb_c1000257C8bb_c1000257C8: ; preds = %bb_c1000257B0_call %X9_7461 = add i64 %FP_7879, -32 %W0_7598 = trunc i64 %X9_7461 to i32 br label %bb_c1000257C8_callbb_c1000257C8_call: ; preds = %bb_c1000257C8 store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4608, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X9_7461, i64* %X0_ptr, align 4 store i64 0, i64* %X1_ptr, align 4 store i64 %X2_5026, i64* %X2_ptr, align 4 store i64 %X3_4326, i64* %X3_ptr, align 4 store i64 %X4_4026, i64* %X4_ptr, align 4 store i64 %X5_3900, i64* %X5_ptr, align 4 store i64 %X6_3845, i64* %X6_ptr, align 4 store i64 %X7_3819, i64* %X7_ptr, align 4 store i64 0, i64* %X8_ptr, align 4 store i64 %X9_7461, i64* %X9_ptr, align 4 store i64 %X10_4433, i64* %X10_ptr, align 4 call void @objc_storeStrong(%regset* %0) %LR_4609 = load i64, i64* %LR_ptr, align 4 %X0_8894 = load i64, i64* %X0_ptr, align 4 %W0_7612 = trunc i64 %X0_8894 to i32 %X1_6859 = load i64, i64* %X1_ptr, align 4 %X2_5027 = load i64, i64* %X2_ptr, align 4 %X3_4327 = load i64, i64* %X3_ptr, align 4 %X4_4027 = load i64, i64* %X4_ptr, align 4 %X5_3901 = load i64, i64* %X5_ptr, align 4 %X6_3846 = load i64, i64* %X6_ptr, align 4 %X7_3820 = load i64, i64* %X7_ptr, align 4 %X8_9548 = load i64, i64* %X8_ptr, align 4 %X9_7474 = load i64, i64* %X9_ptr, align 4 %X10_4434 = load i64, i64* %X10_ptr, align 4 br label %bb_c1000257DCbb_c1000257DC: ; preds = %bb_c1000257C8_call %X9_7462 = add i64 %FP_7879, -24 %W0_7599 = trunc i64 %X9_7462 to i32 br label %bb_c1000257DC_callbb_c1000257DC_call: ; preds = %bb_c1000257DC store i64 %FP_7879, i64* %FP_ptr, align 4 store i64 %LR_4609, i64* %LR_ptr, align 4 store i64 %SP_7497, i64* %SP_ptr, align 4 store i64 %X9_7462, i64* %X0_ptr, align 4 store i64 0, i64* %X1_ptr, align 4 store i64 %X2_5027, i64* %X2_ptr, align 4 store i64 %X3_4327, i64* %X3_ptr, align 4 store i64 %X4_4027, i64* %X4_ptr, align 4 store i64 %X5_3901, i64* %X5_ptr, align 4 store i64 %X6_3846, i64* %X6_ptr, align 4 store i64 %X7_3820, i64* %X7_ptr, align 4 store i64 0, i64* %X8_ptr, align 4 store i64 %X9_7462, i64* %X9_ptr, align 4 store i64 %X10_4434, i64* %X10_ptr, align 4 call void @objc_storeStrong(%regset* %0) %LR_4610 = load i64, i64* %LR_ptr, align 4 %X0_8895 = load i64, i64* %X0_ptr, align 4 %W0_7613 = trunc i64 %X0_8895 to i32 %X1_6860 = load i64, i64* %X1_ptr, align 4 %X2_5028 = load i64, i64* %X2_ptr, align 4 %X3_4328 = load i64, i64* %X3_ptr, align 4 %X4_4028 = load i64, i64* %X4_ptr, align 4 %X5_3902 = load i64, i64* %X5_ptr, align 4 %X6_3847 = load i64, i64* %X6_ptr, align 4 %X7_3821 = load i64, i64* %X7_ptr, align 4 %X8_9549 = load i64, i64* %X8_ptr, align 4 %X9_7475 = load i64, i64* %X9_ptr, align 4 %X10_4435 = load i64, i64* %X10_ptr, align 4 br label %bb_c1000257F0bb_c1000257F0: ; preds = %bb_c1000257DC_call %39 = add i64 %SP_7497, 80 %40 = inttoptr i64 %39 to i64* %FP_7885 = load i64, i64* %40, align 1 %41 = add i64 %SP_7497, 88 %42 = inttoptr i64 %41 to i64* %LR_4597 = load i64, i64* %42, align 1 %SP_7507 = add i64 %SP_7497, 96 br label %exit_fn_1000256AC}declare void @NSHomeDirectory(%regset*)#coding:utf8from pymongo import MongoClientimport sysimport osimport reimport jsonconn = MongoClient('192.168.10.143', 27017)db = conn.ios_metedataipa_basic_tb = db.basic_info_0521ipa_symbol_tb = db.symbol_table_0521ipa_string_tb = db.strings_0521# pipe = [# {'$match': {'hash': hashsum}},# {'$group': {'_id': '$path', 'num': {'$sum': 1}}},# ]# res = list(db.sdk.aggregate(pipeline=pipe)) def overlapping_test(): print ipa_basic_tb.count() print len(ipa_basic_tb.distinct("BundleIdentifier")) returndef main(): overlapping_test() # find GCDWebServer: _OBJC_CLASS_$_GCDWebServer\n bundle_gcdwebserver_set = set() for i in ipa_string_tb.find({"Value": {"$regex":"GCDWebServer"}}): bundle_gcdwebserver_set.add(ipa_basic_tb.find_one({"Hash": i["Hash"]})["BundleIdentifier"]) print len(bundle_gcdwebserver_set) print bundle_gcdwebserver_set # find CDVWKWebViewEngine bundle_ionic_web_view_set = set() for i in ipa_string_tb.find({"Value": {"$regex":"CDVWKWebViewEngine"}}): bundle_ionic_web_view_set.add(ipa_basic_tb.find_one({"Hash": i["Hash"]})["BundleIdentifier"]) print len(bundle_ionic_web_view_set) print bundle_ionic_web_view_set# find ADCWebViewModule bundle_adc_web_view_set = set() for i in ipa_string_tb.find({"Value": {"$regex":"ADCWebViewModule"}}): bundle_adc_web_view_set.add(ipa_basic_tb.find_one({"Hash": i["Hash"]})["BundleIdentifier"]) print len(bundle_adc_web_view_set) print bundle_adc_web_view_set # result: GCDWebServer && !CDVWKWebViewEngine bundle_gcdwebserver_and_not_ionic_web_view_set = bundle_gcdwebserver_set - bundle_ionic_web_view_set - bundle_adc_web_view_set print len(bundle_gcdwebserver_set - bundle_ionic_web_view_set - bundle_adc_web_view_set) print bundle_gcdwebserver_and_not_ionic_web_view_set for b in bundle_gcdwebserver_and_not_ionic_web_view_set: t = ipa_basic_tb.find_one({"BundleIdentifier":b}) print t["Path"].encode("utf8") os.system("cp " + '"' + t["Path"].encode("utf8")[0:5] + t["Path"].encode("utf8")[9:] + '"' + " /data/ipa_clawer/exchange/ipa/" + b.encode("utf8") + ".ipa")# find: GCDWebServer && !CDVWKWebViewEngine && BindToLocalhost# bundle_gcdwebserver_and_not_ionic_web_view_set_not_bindtolocal = set()# for b in bundle_gcdwebserver_and_not_ionic_web_view_set:# if ipa_string_tb.find({"BundleIdentifier": b, "Value": {"$regex":"BindToLocalhost"}}).count() == 0:# bundle_gcdwebserver_and_not_ionic_web_view_set_not_bindtolocal.add(b)# # print len(bundle_gcdwebserver_and_not_ionic_web_view_set_not_bindtolocal)# print bundle_gcdwebserver_and_not_ionic_web_view_set_not_bindtolocal # print len(bundle_ionic_web_view_set - bundle_gcdwebserver_set)# print bundle_ionic_web_view_set - bundle_gcdwebserver_set returnif __name__ == '__main__': main()