Function at 0x1400040a0
Capabilities:
Create thread

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
lea rbp, [rsp - 0xf60]
mov eax, 0x1060
call fcn.14001cdc0
sub rsp, rax
mov rax, qword [0x14002e008]
xor rax, rsp
mov qword [rbp + 0xf50], rax
xor edi, edi
mov rsi, rcx
mov dword [rsp + 0x44], edi
test rcx, rcx
jne 0x1400040f5
lea rcx, str.ERROR:_Invalid_FDR_client_n
call fcn.1400023a0
jmp 0x14000443f
mov rcx, qword [rcx]
lea r9, [rsp + 0x44]
mov r8d, 2
mov dword [rsp + 0x20], 0x4e20
lea rdx, [rsp + 0x40]
call qword [sym.imp.imobiledevice.dll_idevice_connection_receive_timeout]
test eax, eax
jne 0x14000441a
cmp dword [rsp + 0x44], 2
mov rdx, rsi
je 0x14000413b
lea rcx, str.FDR__p_timeout_waiting_for_command_n
call fcn.140002440
xor eax, eax
jmp 0x140004444
movzx eax, word [rsp + 0x40]
cmp eax, 1
jne 0x14000423b
lea rcx, str.FDR__p_got_sync_message_n
call fcn.140002440
mov rcx, qword [rsi]
lea r9, [rsp + 0x30]
mov r8d, 0x1000
mov dword [rsp + 0x30], edi
lea rdx, [rsp + 0x50]
call qword [sym.imp.imobiledevice.dll_idevice_connection_receive]
test eax, eax
jne 0x140004223
cmp dword [rsp + 0x30], 2
jne 0x140004223
mov rcx, qword [rsi + 8]
lea r8, [rsp + 0x38]
lea edx, [rax + 1]
call fcn.140003f60
test eax, eax
je 0x1400041b2
lea rcx, str.ERROR:_Failed_to_connect_to_FDR_port_n
call fcn.1400023a0
mov ebx, 0xffffffff
mov eax, ebx
jmp 0x140004444
lea rcx, str.FDR_connected_in_reply_to_sync_message__starting_command_thread_n
call fcn.140002440
mov rsi, qword [rsp + 0x38]
lea r8, [0x140004470]
mov r9, rsi
mov qword [rsp + 0x28], rdi
xor edx, edx
mov dword [rsp + 0x20], edi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
test rax, rax
jne 0x14000421a
lea rcx, str.ERROR:_Failed_to_start_FDR_command_thread_n
lea ebx, [rax - 1]
call fcn.1400023a0
test rsi, rsi
je 0x140004234
mov rcx, qword [rsi]
test rcx, rcx
je 0x14000420a
mov qword [rsi], rdi
call qword [sym.imp.imobiledevice.dll_idevice_disconnect]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, ebx
jmp 0x140004444
mov ebx, edi
mov eax, ebx
jmp 0x140004444
lea rcx, str.ERROR:_Unexpected_data_from_FDR_n
call fcn.1400023a0
mov ebx, 0xffffffff
mov eax, ebx
jmp 0x140004444
mov ecx, 0x105
cmp ax, cx
jne 0x14000425e
lea rcx, str.FDR__p_got_proxy_message_n
call fcn.140002440
mov rcx, rsi
call fcn.140004c90
jmp 0x140004444
mov ecx, 0xbbaa
cmp ax, cx
jne 0x140004401
lea rcx, str.FDR__p_got_plist_message_n
call fcn.140002440
lea rdx, [rsp + 0x30]
mov rcx, rsi
call fcn.140004500
test eax, eax
je 0x1400042a4
mov rdx, rsi
lea rcx, str.ERROR:_FDR__p_could_not_receive_plist_command._n
call fcn.1400023a0
mov ebx, 0xffffffff
mov eax, ebx
jmp 0x140004444
mov rcx, qword [rsp + 0x30]
lea rdx, str.Command
call qword [sym.imp.plist.dll_plist_dict_get_item]
mov rbx, rax
test rax, rax
je 0x1400043de
mov rcx, rax
call qword [sym.imp.plist.dll_plist_get_node_type]
cmp eax, 3
jne 0x1400043de
lea rdx, [rsp + 0x38]
mov qword [rsp + 0x38], rdi
mov rcx, rbx
call qword [sym.imp.plist.dll_plist_get_string_val]
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.plist.dll_plist_free]
mov r8, qword [rsp + 0x38]
test r8, r8
jne 0x140004317
mov rdx, rsi
lea rcx, str.FDR__p_received_empty_plist_command_n
call fcn.140002320
mov ebx, 0xffffffff
mov eax, ebx
jmp 0x140004444
lea rcx, str.Ping
nop
movzx eax, byte [r8 + rdi]
inc rdi
cmp al, byte [rcx + rdi - 1]
jne 0x1400043bb
cmp rdi, 5
jne 0x140004320
call qword [sym.imp.plist.dll_plist_new_dict]
mov cl, 1
mov qword [rsp + 0x30], rax
call qword [sym.imp.plist.dll_plist_new_bool]
mov rcx, qword [rsp + 0x30]
lea rdx, str.Pong
mov r8, rax
call qword [sym.imp.plist.dll_plist_dict_set_item]
mov rdx, qword [rsp + 0x30]
mov rcx, rsi
call fcn.140004610
mov rcx, qword [rsp + 0x30]
mov ebx, eax
call qword [sym.imp.plist.dll_plist_free]
test ebx, ebx
je 0x1400043a4
mov rdx, rsi
lea rcx, str.ERROR:_FDR__p_could_not_send_Ping_command_reply._n
call fcn.1400023a0
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ebx, 0xffffffff
mov eax, ebx
jmp 0x140004444
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ebx, 1
mov eax, ebx
jmp 0x140004444
mov rdx, rsi
lea rcx, str.WARNING:_FDR__p_received_unknown_plist_command:__s_n
call fcn.1400023a0
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ebx, 0xffffffff
mov eax, ebx
jmp 0x140004444
mov rdx, rsi
lea rcx, str.ERROR:_FDR__p_Could_not_find_Command_in_plist_command_n
call fcn.1400023a0
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.plist.dll_plist_free]
mov ebx, 0xffffffff
mov eax, ebx
jmp 0x140004444
mov r8d, eax
lea rcx, str.WARNING:_FDR__p_received_unknown_packet__x_of_size__u_n
mov r9d, 2
call fcn.1400023a0
xor eax, eax
jmp 0x140004444
cmp qword [rsi], rdi
je 0x14000443f
mov r9d, dword [rsp + 0x44]
lea rcx, str.ERROR:_Unable_to_receive_message_from_FDR__p___d_.__u__d_bytes_n
mov r8d, eax
mov qword [rsp + 0x20], 2
mov rdx, rsi
call fcn.1400023a0
mov eax, 0xffffffff
mov rcx, qword [rbp + 0xf50]
xor rcx, rsp
call fcn.14001bfa0
lea r11, [rsp + 0x1060]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret