Function at 0x42fb60
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, 0x18
push esi
push edi
mov edi, ecx
mov eax, dword [edi + 0x18]
cmp eax, 4
je 0x42fe89
cmp eax, 3
je 0x42fe89
cmp eax, 2
jne 0x42fbb9
push dword [edi + 0x14]
lea edx, [ebp - 8]
push ecx
mov ecx, dword [edi + 8]
push 4
call fcn.00437cd0
test eax, eax
jne 0x42fba6
mov dword [edi + 0x18], 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret
js 0x42fd06
push dword [edi + 8]
push str._3d:_ERROR:_read_data_from_a_completed_request
jmp 0x42fe91
cmp eax, 1
je 0x42fbde
push eax
push dword [edi + 8]
push str._3d:_ERROR:_read_msg_called_with_invalid_transfer_state___d_
push 0
call fcn.0041dc40
add esp, 0x10
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [edi + 0x1c]
cmp ecx, 0x1c
jae 0x42fcd0
push dword [edi + 0x14]
mov eax, 0x1c
lea edx, [edi + 0x20]
sub eax, ecx
add edx, ecx
push ecx
mov ecx, dword [edi + 8]
push eax
call fcn.00437cd0
test eax, eax
je 0x42fb99
js 0x42fd06
add dword [edi + 0x1c], eax
mov eax, dword [edi + 0x1c]
cmp eax, 0x1c
jbe 0x42fc25
push dword [edi + 8]
push str._3d:_ERROR:_read_msg___read_too_many_header_bytes
jmp 0x42fe91
jne 0x42fcd0
lea ecx, [edi + 0x20]
call fcn.004081c0
mov eax, dword [edi + 0x20]
cmp eax, 1
je 0x42fc5d
push 1
push eax
push dword [edi + 8]
push str._3d:_ERROR:_client_version_0x_08X_daemon_version_0x_08X
push 0
call fcn.0041dc40
add esp, 0x14
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x24]
cmp eax, 0x11170
jbe 0x42fc88
push eax
push eax
push dword [edi + 8]
push str._3d:_ERROR:_read_msg:_hdr.datalen__u__0x_X____70000
push 0
call fcn.0041dc40
add esp, 0x14
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret
add eax, 5
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edx, eax
add esp, 4
mov dword [edi + 0x40], edx
test edx, edx
jne 0x42fcb5
mov ecx, str.ERROR:_malloc
call fcn.00428b00
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [edi + 0x24]
mov dword [edi + 0x44], edx
lea eax, [ecx + edx]
mov dword [edi + 0x48], eax
lea eax, [ecx + 5]
push eax
push 0
push edx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
cmp dword [edi + 0x1c], 0x1c
jne 0x42fea2
mov ecx, dword [edi + 0x3c]
mov eax, dword [edi + 0x24]
cmp ecx, eax
jae 0x42fd6a
push dword [edi + 0x14]
mov edx, dword [edi + 0x40]
sub eax, ecx
push ecx
add edx, ecx
mov ecx, dword [edi + 8]
push eax
call fcn.00437cd0
test eax, eax
je 0x42fb99
jns 0x42fd52
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
cmp eax, 0x2733
je 0x42fea2
call esi
cmp eax, 0x2714
je 0x42fea2
call esi
mov ecx, eax
call fcn.00408040
push eax
call esi
push eax
push dword [edi + 8]
push str._3d:_ERROR:_read_msg_errno__d___s_
push 0
call fcn.0041dc40
add esp, 0x14
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret
add dword [edi + 0x3c], eax
mov eax, dword [edi + 0x3c]
cmp eax, dword [edi + 0x24]
jbe 0x42fd6a
push dword [edi + 8]
push str._3d:_ERROR:_read_msg___read_too_many_data_bytes
jmp 0x42fe91
cmp dword [edi + 0x1c], 0x1c
jne 0x42fea2
mov eax, dword [edi + 0x3c]
cmp eax, dword [edi + 0x24]
jne 0x42fea2
cmp dword [edi + 0x5c], 0
je 0x42fe7c
cmp dword [edi + 0x2c], 0x3f
je 0x42fe7c
mov ecx, dword [edi + 0x44]
mov dword [ebp - 8], 1
push str.127.0.0.1
movzx eax, byte [ecx]
mov byte [ebp - 4], al
movzx eax, byte [ecx + 1]
mov byte [ebp - 3], al
lea eax, [ecx + 2]
mov dword [edi + 0x44], eax
mov eax, 2
mov word [ebp - 0x18], ax
mov ax, word [ebp - 4]
mov word [ebp - 0x16], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0
push 1
push 2
mov dword [ebp - 0x14], eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [edi + 0xc], eax
cmp eax, 0xffffffff
jne 0x42fdfb
mov ecx, str.ERROR:_socket
call fcn.00428b00
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push 0x10
lea ecx, [ebp - 0x18]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
js 0x42fe9b
cmp dword [0x44f480], 0
je 0x42fe34
push dword [edi + 0x30]
push dword [edi + 0x34]
push dword [edi + 0xc]
push dword [edi + 8]
push str._3d:_Error_socket__d_created__08X__08X
push 1
call fcn.0041dc40
add esp, 0x18
lea eax, [ebp - 8]
push eax
push 0x8004667e
push dword [edi + 0xc]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x42fe7c
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call esi
mov ecx, eax
call fcn.00408040
push eax
call esi
push eax
push dword [edi + 8]
push str._3d:_ERROR:_could_not_set_control_socket_to_non_blocking_mode_errno__d___s_
push 0
call fcn.0041dc40
add esp, 0x14
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x18], 2
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push dword [edi + 8]
push str._3d:_ERROR:_read_msg_called_with_transfer_state_terminated_or_error
push 0
call fcn.0041dc40
add esp, 0xc
mov dword [edi + 0x18], 3
pop edi
pop esi
mov esp, ebp
pop ebp
ret