Function at 0x437840
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x45a0b0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [esi + 0x18]
push ebx
push edi
mov edi, 4
lea ebx, [edi - 1]
cmp eax, edi
je 0x437bc2
cmp eax, ebx
je 0x437bc2
cmp eax, 2
jne 0x4378b1
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 8]
push eax
push 0
push edi
lea ecx, [ebp - 0x1c]
push ecx
push edx
call fcn.00426a20
test eax, eax
jne 0x43789d
mov dword [esi + 0x18], edi
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
js 0x437a1f
mov eax, dword [esi + 8]
push eax
push str._3d:_ERROR:_read_data_from_a_completed_request
jmp 0x437bcb
cmp eax, 1
je 0x4378dd
mov ecx, dword [esi + 8]
push eax
push ecx
push str._3d:_ERROR:_read_msg_called_with_invalid_transfer_state___d_
push 0
call fcn.00420520
add esp, 0x10
pop edi
mov dword [esi + 0x18], ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi + 0x1c]
cmp ecx, 0x1c
jae 0x4379e5
mov edx, dword [esi + 0x14]
push edx
push 0
mov eax, 0x1c
sub eax, ecx
push eax
lea eax, [ecx + esi + 0x20]
mov ecx, dword [esi + 8]
push eax
push ecx
call fcn.00426a20
test eax, eax
je 0x43788a
js 0x437a1f
add dword [esi + 0x1c], eax
mov eax, dword [esi + 0x1c]
cmp eax, 0x1c
jbe 0x437928
mov edx, dword [esi + 8]
push edx
push str._3d:_ERROR:_read_msg___read_too_many_header_bytes
jmp 0x437bcb
jne 0x4379e5
lea edi, [esi + 0x20]
push edi
call fcn.00408760
mov eax, dword [edi]
cmp eax, 1
je 0x437967
push 1
push eax
mov eax, dword [esi + 8]
push eax
push str._3d:_ERROR:_client_version_0x_08X_daemon_version_0x_08X
push 0
call fcn.00420520
add esp, 0x14
pop edi
mov dword [esi + 0x18], ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
mov edi, dword [esi + 0x24]
cmp edi, 0x11170
jbe 0x43799a
mov ecx, dword [esi + 8]
push edi
push edi
push ecx
push str._3d:_ERROR:_read_msg:_hdr.datalen__u__0x_X____70000
push 0
call fcn.00420520
add esp, 0x14
pop edi
mov dword [esi + 0x18], ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
lea ebx, [edi + 5]
push ebx
call fcn.0043a967
add esp, 4
mov dword [esi + 0x40], eax
test eax, eax
jne 0x4379ce
push str.ERROR:_malloc
call fcn.00432430
pop edi
mov dword [esi + 0x18], 3
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
push ebx
add edi, eax
push eax
mov dword [esi + 0x44], eax
mov dword [esi + 0x48], edi
call fcn.00420680
mov edi, 4
lea ebx, [edi - 1]
cmp dword [esi + 0x1c], 0x1c
jne 0x437bd8
mov ecx, dword [esi + 0x3c]
mov eax, dword [esi + 0x24]
cmp ecx, eax
jae 0x437a8a
mov edx, dword [esi + 0x14]
push edx
sub eax, ecx
push 0
push eax
mov eax, dword [esi + 0x40]
add eax, ecx
mov ecx, dword [esi + 8]
push eax
push ecx
call fcn.00426a20
test eax, eax
je 0x43788a
jns 0x437a71
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2733
je 0x437bd8
call edi
cmp eax, 0x2714
je 0x437bd8
call edi
push eax
call fcn.00408500
push eax
call edi
mov edx, dword [esi + 8]
push eax
push edx
push str._3d:_ERROR:_read_msg_errno__d___s_
push 0
call fcn.00420520
add esp, 0x14
pop edi
mov dword [esi + 0x18], ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
add dword [esi + 0x3c], eax
mov eax, dword [esi + 0x3c]
cmp eax, dword [esi + 0x24]
jbe 0x437a8a
mov eax, dword [esi + 8]
push eax
push str._3d:_ERROR:_read_msg___read_too_many_data_bytes
jmp 0x437bcb
cmp dword [esi + 0x1c], 0x1c
jne 0x437bd8
mov ecx, dword [esi + 0x3c]
cmp ecx, dword [esi + 0x24]
jne 0x437bd8
cmp dword [esi + 0x5c], 0
je 0x437bab
cmp dword [esi + 0x2c], 0x3f
je 0x437bab
mov eax, dword [esi + 0x44]
mov dword [ebp - 0x1c], 1
mov dl, byte [eax]
mov cl, byte [eax + 1]
add eax, 2
mov byte [ebp - 0x18], dl
mov byte [ebp - 0x17], cl
mov dword [esi + 0x44], eax
mov ax, word [ebp - 0x18]
mov edx, 2
push str.127.0.0.1
mov word [ebp - 0x14], dx
mov word [ebp - 0x12], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0
push 1
push 2
mov dword [ebp - 0x10], eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 0xc], eax
cmp eax, 0xffffffff
jne 0x437b1f
push str.ERROR:_socket
call fcn.00432430
pop edi
mov dword [esi + 0x18], ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
push 0x10
lea ecx, [ebp - 0x14]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
js 0x437bd5
cmp dword [0x45b59c], 0
je 0x437b5c
mov edx, dword [esi + 0x30]
mov eax, dword [esi + 0x34]
mov ecx, dword [esi + 0xc]
push edx
mov edx, dword [esi + 8]
push eax
push ecx
push edx
push str._3d:_Error_socket__d_created__08X__08X
push 1
call fcn.00420520
add esp, 0x18
mov ecx, dword [esi + 0xc]
lea eax, [ebp - 0x1c]
push eax
push 0x8004667e
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x437bab
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
push eax
call fcn.00408500
push eax
call edi
mov edx, dword [esi + 8]
push eax
push edx
push str._3d:_ERROR:_could_not_set_control_socket_to_non_blocking_mode_errno__d___s_
push 0
call fcn.00420520
add esp, 0x14
pop edi
mov dword [esi + 0x18], ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
pop edi
mov dword [esi + 0x18], 2
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00439e8a
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 8]
push eax
push str._3d:_ERROR:_read_msg_called_with_transfer_state_terminated_or_error
push 0
call fcn.00420520
add esp, 0xc
mov dword [esi + 0x18], ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.00439e8a
mov esp, ebp
pop ebp
ret