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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 4], 0
push 0x100000
mov dword [ebp - 0x10], esi
mov dword [ebp - 8], 0
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4071cc
push str.fdr_handle_proxy_cmd
push str.ERROR:__s:_malloc_failed_n
call fcn.00404d10
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi]
lea eax, [ebp - 8]
push eax
push 0x100000
mov edx, ebx
call fcn.0041ffb0
add esp, 8
test eax, eax
je 0x407207
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push esi
push str.ERROR:_FDR__p_failed_to_read_data_for_proxy_command_n
call fcn.00404d10
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 8]
push edi
push str.Got_proxy_command_with__u_bytes_n
call fcn.00404da0
mov ecx, dword [esi]
lea eax, [ebp - 4]
push eax
push 2
lea edx, [ebp - 0x14]
mov dword [ebp - 0x14], 5
call fcn.0041fdb0
add esp, 0x10
test eax, eax
jne 0x407516
cmp dword [ebp - 4], 2
jne 0x407516
cmp edi, 3
jae 0x407262
push esi
push str.FDR__p_proxy_command_data_too_short__retrying_n
call fcn.00404da0
add esp, 8
mov ecx, esi
call fcn.004065c0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi]
lea eax, [ebp - 4]
push eax
push edi
mov edx, ebx
call fcn.0041fdb0
add esp, 8
test eax, eax
jne 0x4074f0
cmp dword [ebp - 4], edi
jne 0x4074f0
cmp byte [ebx], al
jne 0x4074dd
cmp byte [ebx + 1], 3
jne 0x4074dd
mov ax, word [edi + ebx - 2]
movzx ecx, byte [edi + ebx - 1]
shl ax, 8
or cx, ax
mov byte [edi + ebx - 2], 0
movzx eax, cx
mov dword [ebp - 0xc], eax
lea eax, [ebx + 3]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__strdup]
add esp, 4
mov edi, eax
mov eax, dword [ebp - 0xc]
movzx ecx, ax
push ecx
push edi
push esi
push str.FDR__p_Proxy_connect_request_to__s:_u_n
call fcn.00404da0
add esp, 0x10
test edi, edi
je 0x4074dd
cmp byte [ebx + 2], 0
je 0x4074dd
mov edx, dword [ebp - 0xc]
mov ecx, edi
call fcn.0041bc70
push edi
mov dword [ebp - 4], eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
cmp dword [ebp - 4], 0
jge 0x40733a
mov eax, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call eax
add esp, 4
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.ERROR:_Failed_to_connect_socket:__s_n
call fcn.00404d10
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0xc], 0
mov ecx, dword [esi]
lea eax, [ebp - 8]
push 0x64
push eax
push 0x100000
mov edx, ebx
mov dword [ebp - 8], 0
call fcn.0041feb0
add esp, 0xc
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x4074a9
mov edi, dword [ebp - 8]
test edi, edi
je 0x4073b9
push edi
push esi
push str.FDR__p_got_payload_of__u_bytes__now_try_to_proxy_it_n
call fcn.00404da0
add esp, 0xc
push edi
push str.Sending__u_bytes_of_data_n
call fcn.00404da0
add esp, 8
xor esi, esi
test edi, edi
je 0x4073b2
push 0
mov eax, edi
sub eax, esi
push eax
lea eax, [esi + ebx]
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
js 0x4073b2
add esi, eax
cmp esi, edi
jb 0x407394
cmp esi, edi
jne 0x407434
mov esi, dword [ebp - 0x10]
push 0x64
push ecx
mov ecx, dword [ebp - 4]
mov edx, ebx
push 0x100000
call fcn.0041c020
mov edi, eax
add esp, 0xc
test edi, edi
js 0x407475
je 0x407429
push 0x4486c2
push edi
push esi
push str.FDR__p_Received__u_bytes_reply_data__s_sending_to_device_n
call fcn.00404da0
add esp, 0x10
xor esi, esi
test edi, edi
je 0x40741a
lea eax, [ebp - 0x18]
push eax
mov eax, edi
lea edx, [esi + ebx]
sub eax, esi
push eax
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax]
call fcn.0041fdb0
add esp, 8
test eax, eax
jne 0x407460
add esi, dword [ebp - 0x18]
cmp esi, edi
jb 0x4073f4
jmp 0x40741d
mov eax, dword [ebp - 0x1c]
cmp edi, esi
jne 0x407460
mov esi, dword [ebp - 0x10]
jmp 0x407341
inc dword [0x44885c]
jmp 0x407341
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push edi
push esi
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.ERROR:_Sending_proxy_payload_failed:__s._Sent__u_of__u_bytes.__n
call fcn.00404d10
add esp, 0x10
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x4074b8
push edi
push esi
push eax
push dword [ebp - 0x10]
push str.ERROR:_FDR__p_unable_to_send_data___d_._Sent__u_of__u_bytes._n
call fcn.00404d10
add esp, 0x14
jmp 0x4074b8
mov edi, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
call edi
cmp dword [eax], 0
je 0x4074a0
call edi
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push esi
push str.ERROR:_FDR__p_receiving_proxy_payload_failed:__s_n
call fcn.00404d10
add esp, 0xc
jmp 0x4074bf
mov dword [ebp - 0xc], 1
jmp 0x4074bf
push eax
push esi
push str.ERROR:_FDR__p_Unable_to_receive_proxy_payload___d__n
call fcn.00404d10
add esp, 0xc
mov dword [ebp - 0xc], 0xffffffff
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call eax
mov eax, dword [ebp - 0xc]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push edi
push dword [ebp - 4]
push esi
push str.ERROR:_FDR__p_unable_to_send_data._Sent__u_of__u_bytes._n
call fcn.00404d10
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push 2
push dword [ebp - 4]
push esi
push str.ERROR:_FDR__p_unable_to_send_ack._Sent__u_of__u_bytes._n
call fcn.00404d10
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret