Function at 0x140004c90
Capabilities:
Send data
Send data on socket

Disassembly:
push rbp
push rbx
push rsi
push rdi
mov rbp, rsp
sub rsp, 0x58
mov rax, qword [0x14002e008]
xor rax, rsp
mov qword [rbp - 0x18], rax
mov rsi, rcx
xor ebx, ebx
mov ecx, 0x100000
mov dword [rbp - 0x24], ebx
mov dword [rbp - 0x28], ebx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rdi, rax
test rax, rax
jne 0x140004ce3
lea rdx, str.fdr_handle_proxy_cmd
lea rcx, str.ERROR:__s:_malloc_failed_n
call fcn.1400023a0
lea eax, [rbx - 1]
jmp 0x140004e7b
mov rcx, qword [rsi]
lea r9, [rbp - 0x28]
mov r8d, 0x100000
mov rdx, rdi
call qword [sym.imp.imobiledevice.dll_idevice_connection_receive]
test eax, eax
je 0x140004d1f
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rdx, rsi
lea rcx, str.ERROR:_FDR__p_failed_to_read_data_for_proxy_command_n
call fcn.1400023a0
mov eax, 0xffffffff
jmp 0x140004e7b
mov edx, dword [rbp - 0x28]
lea rcx, str.Got_proxy_command_with__u_bytes_n
call fcn.140002440
mov rcx, qword [rsi]
lea r9, [rbp - 0x24]
mov eax, 5
lea rdx, [rbp - 0x20]
mov word [rbp - 0x20], ax
lea r8d, [rax - 3]
call qword [sym.imp.imobiledevice.dll_idevice_connection_send]
test eax, eax
jne 0x1400050a0
cmp dword [rbp - 0x24], 2
jne 0x1400050a0
mov r8d, dword [rbp - 0x28]
cmp r8d, 3
jae 0x140004d84
mov rdx, rsi
lea rcx, str.FDR__p_proxy_command_data_too_short__retrying_n
call fcn.140002440
mov rcx, rsi
call fcn.1400040a0
jmp 0x140004e7b
mov rcx, qword [rsi]
lea r9, [rbp - 0x24]
mov rdx, rdi
call qword [sym.imp.imobiledevice.dll_idevice_connection_send]
test eax, eax
jne 0x140005076
mov eax, dword [rbp - 0x28]
cmp dword [rbp - 0x24], eax
jne 0x140005076
mov qword [rsp + 0x90], r14
mov qword [rsp + 0x50], r15
cmp byte [rdi], bl
jne 0x140005066
cmp byte [rdi + 1], 3
jne 0x140005066
add eax, 0xfffffffe
mov ecx, eax
movzx r15d, byte [rax + rdi + 1]
movzx eax, word [rax + rdi]
shl ax, 8
mov byte [rcx + rdi], bl
or r15w, ax
lea rcx, [rdi + 3]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__strdup]
movzx r9d, r15w
lea rcx, str.FDR__p_Proxy_connect_request_to__s:_u_n
mov r8, rax
mov rdx, rsi
mov r14, rax
call fcn.140002440
test r14, r14
je 0x140005066
cmp byte [rdi + 2], bl
je 0x140005066
movzx edx, r15w
mov qword [rsp + 0x88], r12
mov rcx, r14
call fcn.140018950
mov rcx, r14
movsxd r12, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r12d, r12d
jns 0x140004e90
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
mov rdx, rax
lea rcx, str.ERROR:_Failed_to_connect_socket:__s_n
call fcn.1400023a0
mov eax, 0xffffffff
mov r12, qword [rsp + 0x88]
mov r14, qword [rsp + 0x90]
mov r15, qword [rsp + 0x50]
mov rcx, qword [rbp - 0x18]
xor rcx, rsp
call fcn.14001bfa0
add rsp, 0x58
pop rdi
pop rsi
pop rbx
pop rbp
ret
mov rcx, qword [rsi]
lea r9, [rbp - 0x28]
mov r8d, 0x100000
mov dword [rbp - 0x28], ebx
mov rdx, rdi
mov dword [rsp + 0x20], 0x64
call qword [sym.imp.imobiledevice.dll_idevice_connection_receive_timeout]
mov r14d, eax
test eax, eax
jne 0x140005036
mov r8d, dword [rbp - 0x28]
test r8d, r8d
je 0x140004f28
mov rdx, rsi
lea rcx, str.FDR__p_got_payload_of__u_bytes__now_try_to_proxy_it_n
call fcn.140002440
mov edx, dword [rbp - 0x28]
lea rcx, str.Sending__u_bytes_of_data_n
call fcn.140002440
mov ecx, dword [rbp - 0x28]
mov eax, ebx
mov dword [rbp - 0x24], ebx
test ecx, ecx
je 0x140004f20
nop
sub ecx, eax
mov edx, eax
mov r8d, ecx
add rdx, rdi
mov rcx, r12
xor r9d, r9d
call qword [sym.imp.WS2_32.dll_send]
mov ecx, eax
test eax, eax
mov eax, dword [rbp - 0x24]
js 0x140004f1d
add eax, ecx
mov ecx, dword [rbp - 0x28]
mov dword [rbp - 0x24], eax
cmp eax, ecx
jb 0x140004ef0
jmp 0x140004f20
mov ecx, dword [rbp - 0x28]
cmp eax, ecx
jne 0x140004fd3
mov rdx, rdi
mov ecx, r12d
call fcn.140018b80
test eax, eax
js 0x140005003
mov dword [rbp - 0x28], eax
je 0x140004fc8
lea r9, [0x14001f492]
mov r8d, eax
mov rdx, rsi
lea rcx, str.FDR__p_Received__u_bytes_reply_data__s_sending_to_device_n
call fcn.140002440
mov eax, dword [rbp - 0x28]
mov r9d, ebx
mov dword [rbp - 0x24], ebx
mov ecx, ebx
test eax, eax
je 0x140004fa5
nop dword [rax]
sub eax, ecx
mov edx, ecx
mov rcx, qword [rsi]
lea r9, [rbp - 0x1c]
add rdx, rdi
mov r8d, eax
call qword [sym.imp.imobiledevice.dll_idevice_connection_send]
mov r9d, dword [rbp - 0x24]
mov r14d, eax
test eax, eax
mov eax, dword [rbp - 0x28]
jne 0x140004fad
add r9d, dword [rbp - 0x1c]
mov dword [rbp - 0x24], r9d
mov ecx, r9d
cmp r9d, eax
jb 0x140004f70
cmp eax, ecx
je 0x140004e90
mov r8d, r14d
mov dword [rsp + 0x20], eax
mov rdx, rsi
lea rcx, str.ERROR:_FDR__p_unable_to_send_data___d_._Sent__u_of__u_bytes._n
call fcn.1400023a0
jmp 0x140005048
inc dword [0x14002ec14]
jmp 0x140004e90
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
mov r9d, dword [rbp - 0x28]
lea rcx, str.ERROR:_Sending_proxy_payload_failed:__s._Sent__u_of__u_bytes.__n
mov r8d, dword [rbp - 0x24]
mov rdx, rax
call fcn.1400023a0
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
jmp 0x140005048
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [rax], ebx
je 0x14000502f
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
mov rdx, rsi
lea rcx, str.ERROR:_FDR__p_receiving_proxy_payload_failed:__s_n
mov r8, rax
call fcn.1400023a0
jmp 0x14000504d
mov ebx, 1
jmp 0x14000504d
mov r8d, eax
lea rcx, str.ERROR:_FDR__p_Unable_to_receive_proxy_payload___d__n
mov rdx, rsi
call fcn.1400023a0
mov ebx, 0xffffffff
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, ebx
jmp 0x140004e66
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor eax, eax
jmp 0x140004e6e
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r9d, dword [rbp - 0x28]
lea rcx, str.ERROR:_FDR__p_unable_to_send_data._Sent__u_of__u_bytes._n
mov r8d, dword [rbp - 0x24]
mov rdx, rsi
call fcn.1400023a0
mov eax, 0xffffffff
jmp 0x140004e7b
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r8d, dword [rbp - 0x24]
lea rcx, str.ERROR:_FDR__p_unable_to_send_ack._Sent__u_of__u_bytes._n
mov r9d, 2
mov rdx, rsi
call fcn.1400023a0
mov eax, 0xffffffff
jmp 0x140004e7b