samdmarshall/SDMMobileDevice — pull request #57 by JeremyAgost (2014-10-28 17:10:48+00:00)
Title: Extended pairing options

Newer versions of MobileDevice framework have moved pairing code into AMDeviceExtendedPairWithOptions, supporting an "ExtendedResponse" dictionary returned by the device. AMDevicePairWithOptions calls this new function with a NULL third argument.
```
void _AMDevicePairWithOptions() {
rax = _AMDeviceExtendedPairWithOptions(rdi, rsi, 0x0);
return;
}
```
The send_pair function also has an additional argument for passing back a reference to the ExtendedResponse dictionary, if the device provides it.
```
int _send_pair(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5) {
rcx = arg3;
rdx = arg2;
rsi = arg1;
var_40 = arg5;
var_38 = arg4;
...
r14 = var_40;
if (r14 != 0x0) {
rax = CFDictionaryGetValue(rdi, @"ExtendedResponse");
*r14 = rax;
if (rax != 0x0) {
CFRetain(rax);
}
rdi = var_30;
}
...
}
```
Three new error messages are recognized by _ConvertLockdowndError: FMiPProtected, MCProtected and MCChallengeRequired. I mapped them to corresponding AMDError codes.