Advertisement
Guest User

stuff

a guest
Jan 12th, 2014
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function meth_MTMessageBroker_onSocket_didReadData_withTag_linkedData_ {
  2.     esi = arg_C;
  3.     ebx = arg_0;
  4.     if (arg_10 == 0x5c) goto loc_16687;
  5.     goto loc_1656b;
  6.  
  7. loc_16687:
  8.     eax = [ebx delegate];
  9.     if (eax != 0x0) {
  10.             eax = [ebx delegate];
  11.             eax = [eax respondsToSelector:*objc_msg_messageBroker_didReceiveMirroringFrame_withHeader_];
  12.             if (eax != 0x0) {
  13.                     eax = [ebx delegate];
  14.                     eax = [eax messageBroker:ebx didReceiveMirroringFrame:esi withHeader:arg_14];
  15.             }
  16.     }
  17.  
  18. loc_172c8:
  19.     return eax;
  20.  
  21. loc_1656b:
  22.     if (eax != 0x28) goto loc_1670c;
  23.     goto loc_16574;
  24.  
  25. loc_1670c:
  26.     if (eax != 0x0) goto loc_168ac;
  27.     goto loc_16714;
  28.  
  29. loc_168ac:
  30.     eax = NSLog(@"Unknown tag in read of socket data %ld", eax);
  31.     goto loc_172c8;
  32.  
  33. loc_16714:
  34.     eax = [NSString alloc];
  35.     eax = [eax initWithData:esi encoding:0x4];
  36.     esi = eax;
  37.     [ebx setHeader:esi];
  38.     [esi release];
  39.     esi = *cls_Utils;
  40.     eax = [ebx header];
  41.     eax = [esi parseHeaders:eax];
  42.     [ebx setHeaders:eax];
  43.     eax = [ebx headers];
  44.     eax = [eax objectForKey:@"CONTENT-LENGTH"];
  45.     eax = [eax intValue];
  46.     esi = eax;
  47.     if (esi <= 0x0) goto loc_16b00;
  48.     goto loc_167fb;
  49.  
  50. loc_16b00:
  51.     eax = [ebx delegate];
  52.     if (eax == 0x0) goto loc_172b7;
  53.     goto loc_16b19;
  54.  
  55. loc_172b7:
  56.     eax = *objc_msg_readHeaderEnd;
  57.  
  58. loc_172bc:
  59.     eax = [ebx readHeaderEnd];
  60.     goto loc_172c8;
  61.  
  62. loc_16b19:
  63.     [ebx parseGlobalHeaders];
  64.  
  65. loc_172b2:
  66.     objc_msgSend();
  67.     goto loc_172b7;
  68.  
  69. loc_167fb:
  70.     eax = [ebx headers];
  71.     eax = [eax objectForKey:@"CONTENT-TYPE"];
  72.     eax = [ebx getAttachmentType:eax];
  73.     [ebx setExpectedAttachmentType:eax];
  74.     eax = [ebx header];
  75.     eax = [eax hasPrefix:@"ANNOUNCE"];
  76.     if (eax == 0x0) goto loc_16b43;
  77.     goto loc_16885;
  78.  
  79. loc_16b43:
  80.     eax = [ebx header];
  81.     eax = [eax hasPrefix:@"POST /fp-setup2"];
  82.     if (eax == 0x0) goto loc_16c67;
  83.     goto loc_16b76;
  84.  
  85. loc_16c67:
  86.     eax = [ebx header];
  87.     eax = [eax hasPrefix:@"POST /fp-setup"];
  88.     if (eax == 0x0) goto loc_16d9b;
  89.     goto loc_16c9a;
  90.  
  91. loc_16d9b:
  92.     eax = [ebx header];
  93.     eax = [eax hasPrefix:@"SET_PARAMETER"];
  94.     if (eax == 0x0) goto loc_16de3;
  95.     goto loc_16dca;
  96.  
  97. loc_16de3:
  98.     eax = [ebx header];
  99.     eax = [eax hasPrefix:@"GET_PARAMETER"];
  100.     if (eax == 0x0) goto loc_16e2b;
  101.     goto loc_16e12;
  102.  
  103. loc_16e2b:
  104.     eax = [ebx header];
  105.     eax = [eax hasPrefix:@"POST /play"];
  106.     if (eax == 0x0) goto loc_16e73;
  107.     goto loc_16e5a;
  108.  
  109. loc_16e73:
  110.     eax = [ebx header];
  111.     eax = [eax hasPrefix:@"PUT /photo"];
  112.     if (eax != 0x0) goto loc_16ed1;
  113.     goto loc_16ea2;
  114.  
  115. loc_16ed1:
  116.     [ebx setExpectedAttachmentType:0x0];
  117.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  118.     STK31 = ebx;
  119.     STK29 = 0x4;
  120.  
  121. loc_1725a:
  122.     objc_msgSend();
  123.     eax = [ebx socket];
  124.     [eax readDataToLength:esi withTimeout:0x0 tag:0xbff00000 linkedData:0x28];
  125.     goto loc_172b2;
  126.  
  127. loc_16ea2:
  128.     eax = [ebx header];
  129.     eax = [eax hasPrefix:@"POST /photo"];
  130.     if (eax == 0x0) goto loc_16f03;
  131.     goto loc_16ed1;
  132.  
  133. loc_16f03:
  134.     eax = [ebx header];
  135.     eax = [eax hasPrefix:@"PUT /slideshows/"];
  136.     if (eax != 0x0) goto loc_16f61;
  137.     goto loc_16f32;
  138.  
  139. loc_16f61:
  140.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  141.     STK31 = ebx;
  142.     STK29 = 0x2;
  143.     goto loc_1725a;
  144.  
  145. loc_16f32:
  146.     eax = [ebx header];
  147.     eax = [eax hasPrefix:@"POST /slideshows/"];
  148.     if (eax == 0x0) goto loc_16f7a;
  149.     goto loc_16f61;
  150.  
  151. loc_16f7a:
  152.     eax = [ebx header];
  153.     eax = [eax hasPrefix:@"HTTP/1.1 200 OK"];
  154.     if (eax == 0x0) goto loc_16fd8;
  155.     goto loc_16fa9;
  156.  
  157. loc_16fd8:
  158.     eax = [ebx header];
  159.     eax = [eax hasPrefix:@"POST /authorize"];
  160.     if (eax == 0x0) goto loc_17039;
  161.     goto loc_17007;
  162.  
  163. loc_17039:
  164.     eax = [ebx header];
  165.     eax = [eax hasPrefix:@"POST /stop"];
  166.     if (eax != 0x0) goto loc_17097;
  167.     goto loc_17068;
  168.  
  169. loc_17097:
  170.     [ebx setExpectedAttachmentType:0x1];
  171.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  172.     STK31 = ebx;
  173.     STK29 = 0x7;
  174.     goto loc_1725a;
  175.  
  176. loc_17068:
  177.     eax = [ebx header];
  178.     eax = [eax hasPrefix:@"POST /rate"];
  179.     if (eax == 0x0) goto loc_170c9;
  180.     goto loc_17097;
  181.  
  182. loc_170c9:
  183.     eax = [ebx header];
  184.     eax = [eax hasPrefix:@"PUT /setProperty"];
  185.     if (eax == 0x0) goto loc_1712a;
  186.     goto loc_170f8;
  187.  
  188. loc_1712a:
  189.     eax = [ebx header];
  190.     eax = [eax hasPrefix:@"POST /stream"];
  191.     if (eax == 0x0) goto loc_1724b;
  192.     goto loc_17163;
  193.  
  194. loc_1724b:
  195.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  196.     STK31 = ebx;
  197.     STK29 = 0x0;
  198.     goto loc_1725a;
  199.  
  200. loc_17163:
  201.     [ebx setExpectedAttachmentKind:0xb];
  202.     [ebx setExpectedAttachmentType:0x3];
  203.     eax = [ebx socket];
  204.     [eax readDataToLength:esi withTimeout:0x0 tag:0xbff00000 linkedData:0x28];
  205.     eax = [ebx delegate];
  206.     if (eax != 0x0) {
  207.             eax = [ebx delegate];
  208.             eax = [eax respondsToSelector:*objc_msg_messageBrokerDidStartMirroring_];
  209.             if (eax != 0x0) {
  210.                     eax = [ebx delegate];
  211.                     [eax messageBrokerDidStartMirroring:ebx];
  212.             }
  213.     }
  214.     eax = *objc_msg_readMirroringPacketHeader;
  215.     goto loc_172bc;
  216.  
  217. loc_170f8:
  218.     [ebx setExpectedAttachmentType:0x3];
  219.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  220.     STK31 = ebx;
  221.     STK29 = 0xf;
  222.     goto loc_1725a;
  223.  
  224. loc_17007:
  225.     [ebx setExpectedAttachmentType:0x1];
  226.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  227.     STK31 = ebx;
  228.     STK29 = 0x5;
  229.     goto loc_1725a;
  230.  
  231. loc_16fa9:
  232.     eax = [ebx brokerType];
  233.     if (eax != 0x3) goto loc_16fd8;
  234.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  235.     STK31 = ebx;
  236.     STK29 = 0x3;
  237.     goto loc_1725a;
  238.  
  239. loc_16e5a:
  240.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  241.     STK31 = ebx;
  242.     STK29 = 0x1;
  243.     goto loc_1725a;
  244.  
  245. loc_16e12:
  246.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  247.     STK31 = ebx;
  248.     STK29 = 0xa;
  249.     goto loc_1725a;
  250.  
  251. loc_16dca:
  252.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  253.     STK31 = ebx;
  254.     STK29 = 0x9;
  255.     goto loc_1725a;
  256.  
  257. loc_16c9a:
  258.     [ebx setExpectedAttachmentType:0x0];
  259.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  260.     STK31 = ebx;
  261.     STK29 = 0x6;
  262.     goto loc_1725a;
  263.  
  264. loc_16b76:
  265.     [ebx setExpectedAttachmentType:0x0];
  266.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  267.     STK31 = ebx;
  268.     STK29 = 0xe;
  269.     goto loc_1725a;
  270.  
  271. loc_16885:
  272.     STK30 = *objc_msg_setExpectedAttachmentKind_;
  273.     STK31 = ebx;
  274.     STK29 = 0x8;
  275.     goto loc_1725a;
  276.  
  277. loc_16574:
  278.     eax = [ebx parseAttachmentData:esi];
  279.     esi = eax;
  280.     eax = [ebx expectedAttachmentKind];
  281.     if (eax != 0x6) goto loc_1689e;
  282.     goto loc_165a5;
  283.  
  284. loc_1689e:
  285.     eax = *objc_msg_notifyMessageReceivedWithAttachment_;
  286.     goto loc_172bc;
  287.  
  288. loc_165a5:
  289.     ptrace(0x1f, 0x0, 0x0, 0x0);
  290.     eax = [esi bytes];
  291.     edi = ebx;
  292.     ebx = *(int8_t *)(eax + 0x4);
  293.     eax = [esi bytes];
  294.     var_42 = *(int8_t *)(eax + 0x6);
  295.     eax = [edi header];
  296.     [eax rangeOfString:@"X-Apple-ET"];
  297.     if (edx != 0x0) {
  298.             var_44 = esi;
  299.             eax = [edi header];
  300.             eax = [Utils parseMessage:eax forKey:@"X-Apple-ET"];
  301.             eax = [eax intValue];
  302.             ecx = 0x3;
  303.             if (eax != 0x20) {
  304.                     ecx = ebx;
  305.             }
  306.             var_43 = ecx;
  307.             var_48 = eax;
  308.     }
  309.     else {
  310.             var_44 = esi;
  311.             var_48 = 0x20;
  312.             var_43 = ebx;
  313.     }
  314.     eax = [edi encryptionContext];
  315.     eax = [eax fpInfo];
  316.     esi = eax;
  317.     eax = [edi encryptionContext];
  318.     eax = [eax sapInfo];
  319.     ebx = eax;
  320.     if (var_42 != 0x3) goto loc_169eb;
  321.     goto loc_16923;
  322.  
  323. loc_169eb:
  324.     edi = esi;
  325.     esi = arg_0;
  326.     if (eax != 0x1) goto loc_172c8;
  327.     eax = [esi encryptionContext];
  328.     eax = [eax hasSapInitialized];
  329.     esi = edi;
  330.     if (eax == 0x0) {
  331.             eax = time(0x0);
  332.             srand(eax);
  333.             sub_42ec0(esi, ebx);
  334.     }
  335.     var_75 = 0x0;
  336.     var_68 = 0x0;
  337.     var_64 = 0x0;
  338.     eax = [var_44 bytes];
  339.     sub_42f80(SIGN_EXTEND(var_43), esi, *ebx, eax, &var_64, &var_68, &var_75);
  340.     if (var_75 == 0x1) {
  341.             ebx = var_68;
  342.             if (*(arg_0 + 0x14) == 0x4) {
  343.                     eax = [ecx CSeq];
  344.                     ebx = ecx;
  345.                     STK28 = var_48;
  346.                     STK30 = *objc_msg_stringWithFormat_;
  347.                     STK31 = *cls_NSString;
  348.                     STK29 = @"RTSP/1.0 200 OK\\r\\nContent-Type: application/octet-stream\\r\\nX-Apple-ET: %i\\r\\nContent-Length: %u\\r\\nServer: AirTunes/%@\\r\\nCSeq: %u\\r\\n\\r\\n";
  349.             }
  350.             else {
  351.                     STK28 = var_48;
  352.                     STK30 = *objc_msg_stringWithFormat_;
  353.                     STK31 = *cls_NSString;
  354.                     STK29 = @"HTTP/1.0 200 OK\\r\\nContent-Type: application/octet-stream\\r\\nX-Apple-ET: %i\\r\\nContent-Length: %u\\r\\nServer: AirTunes/%@\\r\\n\\r\\n";
  355.                     ebx = ecx;
  356.             }
  357.             eax = objc_msgSend();
  358.             esi = eax;
  359.             eax = [NSMutableData alloc];
  360.             edi = eax;
  361.             eax = [esi dataUsingEncoding:0x1];
  362.             eax = [edi initWithData:eax];
  363.             esi = eax;
  364.             [esi appendBytes:var_64 length:var_68];
  365.             [ebx sendData:esi];
  366.             [esi release];
  367.     }
  368.     eax = var_64;
  369.  
  370. loc_16d8e:
  371.     eax = free(eax);
  372.     goto loc_172c8;
  373.  
  374. loc_16923:
  375.     edi = var_44;
  376.     [edi length];
  377.     var_63 = 0x1;
  378.     var_56 = 0x8e;
  379.     var_52 = 0x0;
  380.     eax = [edi bytes];
  381.     sub_42f80(SIGN_EXTEND(var_43), esi, *ebx, eax, &var_52, &var_56, &var_63);
  382.     if (var_63 == 0x0) {
  383.             ebx = var_56;
  384.             if (*(arg_0 + 0x14) == 0x4) {
  385.                     eax = [ecx CSeq];
  386.                     ebx = ecx;
  387.                     STK28 = var_48;
  388.                     STK30 = *objc_msg_stringWithFormat_;
  389.                     STK31 = *cls_NSString;
  390.                     STK29 = @"RTSP/1.0 200 OK\\r\\nContent-Type: application/octet-stream\\r\\nX-Apple-ET: %i\\r\\nContent-Length: %u\\r\\nCSeq: %u\\r\\n\\r\\n";
  391.             }
  392.             else {
  393.                     ebx = ecx;
  394.                     STK28 = var_48;
  395.                     STK30 = *objc_msg_stringWithFormat_;
  396.                     STK31 = *cls_NSString;
  397.                     STK29 = @"HTTP/1.0 200 OK\\r\\nContent-Type: application/octet-stream\\r\\nX-Apple-ET: %i\\r\\nContent-Length: %u\\r\\n\\r\\n";
  398.             }
  399.             eax = objc_msgSend();
  400.             esi = eax;
  401.             eax = [NSMutableData alloc];
  402.             edi = eax;
  403.             eax = [esi dataUsingEncoding:0x1];
  404.             eax = [edi initWithData:eax];
  405.             esi = eax;
  406.             [esi appendBytes:var_52 length:var_56];
  407.             [ebx sendData:esi];
  408.             [esi release];
  409.     }
  410.     eax = var_52;
  411.     goto loc_16d8e;
  412. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement