Function at 0x4016b0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Initialize winsock library
Set socket configuration

Disassembly:
sub esp, 0x3e0
mov ecx, dword [esp + 0x3e4]
push ebx
push ebp
push esi
lea eax, [esp + 0x24]
push edi
push eax
push ecx
xor ebp, ebp
mov dword [esp + 0x2c], 1
call sub.wtxapi.dll_wtxRpcKeySplit
add esp, 8
test eax, eax
je 0x4016ed
or ebp, 0xffffffff
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3e0
ret
lea edx, [esp + 0x260]
push edx
push 0x101
call sub.WSOCK32.dll_WSAStartup
test eax, eax
je 0x401713
or ebp, 0xffffffff
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3e0
ret
push 0
call sub.WINRPC32.dll_Ordinal_129
mov edi, dword [esp + 0x3fc]
add esp, 4
xor ebx, ebx
mov ecx, dword [esp + 0x58]
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov edx, dword [ecx + ebx]
push edx
call sub.WSOCK32.dll_inet_addr
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x34]
test ax, ax
mov word [esp + 0x14], 2
jne 0x4017c6
mov eax, dword [esp + 0x58]
push 0x6f
push 2
push 0x186a0
mov ecx, dword [eax + ebx]
lea edx, [esp + 0x42]
push ecx
push edx
lea eax, [esp + 0x174]
push 0x4060c8
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x1c
lea ecx, [esp + 0x160]
push edi
push ecx
call fcn.004016b0
mov ebp, eax
add esp, 8
cmp ebp, 0xffffffff
je 0x4018f4
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
push edx
push eax
lea edx, [esp + 0x1c]
push ecx
push edx
call sub.WINRPC32.dll_Ordinal_101
add esp, 0x10
test ax, ax
je 0x4018b7
push eax
call sub.WSOCK32.dll_htons
push 6
push 1
push 2
mov word [esp + 0x22], ax
call sub.WSOCK32.dll_socket
test eax, eax
mov dword [esp + 0x10], eax
jl 0x4018b7
lea ecx, [esp + 0x24]
push ecx
push 0x8004667e
push eax
call sub.WSOCK32.dll_ioctlsocket
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x14]
push 0x10
push edx
push eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x68], 1
call sub.WSOCK32.dll_connect
mov esi, eax
call sub.WSOCK32.dll_WSAGetLastError
cmp esi, 0xffffffff
jne 0x40182c
cmp eax, 0x2733
jne 0x4018c8
lea eax, [esp + 0x5c]
push edi
lea ecx, [esp + 0x60]
push eax
lea edx, [esp + 0x64]
push ecx
push edx
push 0x40
call sub.WSOCK32.dll_select
cmp eax, 0xffffffff
je 0x4018bc
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
push 0
lea eax, [esp + 0x14]
push 0
push eax
push ecx
lea eax, [esp + 0x24]
push edx
push eax
call sub.WINRPC32.dll_Ordinal_58
mov esi, eax
add esp, 0x18
test esi, esi
je 0x4018bc
mov ecx, dword [edi + 4]
mov edx, dword [edi]
push ecx
push edx
push 0
push 0x40433e
push 0
push 0x40433e
push 0
push esi
call sub.WINRPC32.dll_Ordinal_52
add esp, 0x20
test eax, eax
je 0x4018dc
mov eax, dword [esp + 0x58]
add ebx, 4
cmp dword [eax + ebx], 0
je 0x4018cd
push esi
call sub.WINRPC32.dll_Ordinal_55
mov ecx, dword [esp + 0x14]
add esp, 4
push ecx
call sub.WSOCK32.dll_closesocket
jmp 0x401726
or ebp, 0xffffffff
jmp 0x4018f4
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], 0x1000f
or ebp, 0xffffffff
jmp 0x4018e5
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], 0x1000f
or ebp, 0xffffffff
push esi
call sub.WINRPC32.dll_Ordinal_55
add esp, 4
mov edx, dword [esp + 0x10]
push edx
call sub.WSOCK32.dll_closesocket
call sub.WINRPC32.dll_Ordinal_127
lea eax, [esp + 0x28]
push eax
call sub.wtxapi.dll_wtxRpcKeySplitFree
add esp, 4
call sub.WSOCK32.dll_WSACleanup
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x3e0
ret