I'm trying to emulate the message exchange between Safari & Mobile Safari when remote debugging (using Node).

I've sniffed the traffic between the two; they're exchanging binary plists over TCP. I've managed to replicated the packets up to the point where a particular tab is chosen for debugging ("socket setup"), but after this Mobile Safari ignores my plist instructions and instead sends back a listing.

Here's the raw tcpdump of the socket setup packet Safari is sending, and a JSON representation of the plist it contains:

10:36:42.318662 IP6 localhost.58028 > localhost.27753: Flags [P.], seq 1601:1930, ack 803, win 9125, options [nop,nop,TS val 69074378 ecr 69074378], length 329
0x0000:  6000 0000 0169 0640 0000 0000 0000 0000  `....i.@........
0x0010:  0000 0000 0000 0001 0000 0000 0000 0000  ................
0x0020:  0000 0000 0000 0001 e2ac 6c69 344e 2443  ..........li4N$C
0x0030:  4e32 497b 8018 23a5 0171 0000 0101 080a  N2I{..#..q......
0x0040:  041d fdca 041d fdca 6270 6c69 7374 3030  ........bplist00
0x0050:  d201 0203 0c5a 5f5f 6172 6775 6d65 6e74  .....Z__argument
0x0060:  5a5f 5f73 656c 6563 746f 72d4 0405 0607  Z__selector.....
0x0070:  0809 0a0b 5f10 1b57 4952 4170 706c 6963  ...._..WIRApplic
0x0080:  6174 696f 6e49 6465 6e74 6966 6965 724b  ationIdentifierK
0x0090:  6579 5f10 1a57 4952 436f 6e6e 6563 7469  ey_..WIRConnecti
0x00a0:  6f6e 4964 656e 7469 6669 6572 4b65 795c  onIdentifierKey\
0x00b0:  5749 5253 656e 6465 724b 6579 5f10 1457  WIRSenderKey_..W
0x00c0:  4952 5061 6765 4964 656e 7469 6669 6572  IRPageIdentifier
0x00d0:  4b65 795f 1016 636f 6d2e 6170 706c 652e  Key_..com.apple.
0x00e0:  6d6f 6269 6c65 7361 6661 7269 5f10 2441  mobilesafari_.$A
0x00f0:  3535 3134 3645 372d 3244 4544 2d34 3832  55146E7-2DED-482
0x0100:  412d 3839 3133 2d31 3033 3337 4537 4634  A-8913-10337E7F4
0x0110:  3330 465f 1024 3230 3041 3935 3146 2d30  30F_.$200A951F-0
0x0120:  3839 432d 3445 3741 2d41 3642 322d 3331  89C-4E7A-A6B2
Edit
Report