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

Disassembly:
sub esp, 0x10
push ebx
push esi
mov esi, ecx
push edi
cmp dword [esi], 0
jne 0x4165b8
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
mov eax, dword [esp + 0x20]
test eax, eax
mov dword [esi + 8], eax
je 0x4166d0
mov eax, dword [esi + 0x1a4]
or edi, 0xffffffff
cmp eax, edi
jne 0x4165f4
push 6
push 1
push 2
call sub.WSOCK32.dll_socket
cmp eax, edi
mov dword [esi + 0x1a4], eax
jne 0x4165f4
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
xor eax, eax
mov dword [esp + 0xc], eax
mov word [esp + 0xc], 2
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
push eax
mov dword [esp + 0x1c], eax
call sub.WSOCK32.dll_htonl
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x10], eax
push ecx
call sub.WSOCK32.dll_htons
mov word [esp + 0xe], ax
mov eax, dword [esi + 0x1a4]
lea edx, [esp + 0xc]
push 0x10
push edx
push eax
call sub.WSOCK32.dll_bind
cmp eax, edi
jne 0x41665e
mov eax, dword [esi + 0x1a4]
cmp eax, edi
je 0x4166c5
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1a4], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
mov ecx, dword [esi]
mov edx, dword [esi + 0x1a4]
push 8
push 0x8064
push ecx
push edx
call sub.WSOCK32.dll_WSAAsyncSelect
cmp eax, edi
jne 0x416699
mov eax, dword [esi + 0x1a4]
cmp eax, edi
je 0x4166c5
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1a4], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
mov eax, dword [esi + 0x1a4]
push 1
push eax
call sub.WSOCK32.dll_listen
cmp eax, edi
jne 0x416842
mov eax, dword [esi + 0x1a4]
cmp eax, edi
je 0x4166c5
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1a4], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
mov ecx, dword [esp + 0x24]
push ecx
call sub.WSOCK32.dll_inet_addr
mov ebx, eax
or edi, 0xffffffff
cmp ebx, edi
jne 0x4166ee
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
push 6
push 1
push 2
call sub.WSOCK32.dll_socket
cmp eax, edi
mov dword [esi + 0x1a8], eax
jne 0x41670e
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
lea edx, [esp + 0x20]
push 4
push edx
push 1
push 6
push eax
mov dword [esp + 0x34], 1
call sub.WSOCK32.dll_setsockopt
cmp eax, edi
jne 0x416750
mov eax, dword [esi + 0x1a8]
cmp eax, edi
je 0x416837
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1a8], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
mov ecx, dword [esi + 0x1a8]
lea eax, [esp + 0x24]
push eax
push 0x8004667e
push ecx
mov dword [esp + 0x30], 1
call sub.WSOCK32.dll_ioctlsocket
cmp eax, edi
jne 0x416797
mov eax, dword [esi + 0x1a8]
cmp eax, edi
je 0x416837
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1a8], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
mov edx, dword [esi]
mov eax, dword [esi + 0x1a8]
push 0x10
push 0x8064
push edx
push eax
call sub.WSOCK32.dll_WSAAsyncSelect
cmp eax, edi
jne 0x4167d2
mov eax, dword [esi + 0x1a8]
cmp eax, edi
je 0x416837
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1a8], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
mov edx, dword [esp + 0x28]
xor ecx, ecx
mov dword [esp + 0xc], ecx
push edx
mov dword [esp + 0x14], ecx
mov word [esp + 0x10], 2
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x1c], ecx
call sub.WSOCK32.dll_htons
mov ecx, dword [esi + 0x1a8]
mov word [esp + 0xe], ax
lea eax, [esp + 0xc]
push 0x10
push eax
push ecx
call sub.WSOCK32.dll_connect
cmp eax, edi
jne 0x416842
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x416842
mov eax, dword [esi + 0x1a8]
cmp eax, edi
je 0x416837
push eax
call sub.WSOCK32.dll_closesocket
mov dword [esi + 0x1a8], edi
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 0xc
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x10
ret 0xc