Function at 0x40f6b0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffbc8
push edi
push esi
push ebx
mov dword [ebp - 4], 0xffffffff
push dword [ebp + 8]
call sub.ws2_32.dll_inet_addr
mov esi, eax
push 6
push 1
push 2
call sub.ws2_32.dll_socket
cmp eax, 0xffffffff
je 0x40f9bf
mov dword [ebp - 0x42c], eax
mov word [ebp - 0x14], 2
push 0x8b
call sub.ws2_32.dll_htons
mov word [ebp - 0x12], ax
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x418], 1
lea eax, [ebp - 0x418]
push eax
push 0x8004667e
push dword [ebp - 0x42c]
call sub.ws2_32.dll_ioctlsocket
mov word [ebp - 0x430], 1
mov word [ebp - 0x42e], 0
push 4
lea eax, [ebp - 0x430]
push eax
push 0x80
push 0xffff
push dword [ebp - 0x42c]
call sub.ws2_32.dll_setsockopt
push 0x10
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x42c]
call sub.ws2_32.dll_connect
cmp eax, 0xffffffff
jne 0x40f9b6
call sub.ws2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x40f88a
mov dword [ebp - 0x420], 6
mov dword [ebp - 0x41c], 0
mov dword [ebp - 0x428], 1
mov eax, dword [ebp - 0x42c]
mov dword [ebp - 0x424], eax
lea eax, [ebp - 0x420]
push eax
push 0
lea eax, [ebp - 0x428]
push eax
push 0
push 0
call sub.ws2_32.dll_select
or eax, eax
je 0x40f883
cmp eax, 0xffffffff
je 0x40f883
push 0
push 0x4c
push 0x41a970
push dword [ebp - 0x42c]
call sub.ws2_32.dll_send
cmp eax, 0xffffffff
jne 0x40f7eb
jmp 0x40f88a
mov dword [ebp - 0x420], 6
mov dword [ebp - 0x41c], 0
mov dword [ebp - 0x428], 1
mov eax, dword [ebp - 0x42c]
mov dword [ebp - 0x424], eax
lea eax, [ebp - 0x420]
push eax
push 0
push 0
lea eax, [ebp - 0x428]
push eax
push 0
call sub.ws2_32.dll_select
or eax, eax
je 0x40f87c
cmp eax, 0xffffffff
je 0x40f87c
push 0
push 0x400
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x42c]
call sub.ws2_32.dll_recv
cmp eax, 0xffffffff
jne 0x40f857
jmp 0x40f88a
lea ecx, [ebp - 0x414]
cmp byte [ecx], 0x82
jne 0x40f867
cmp eax, 7
jbe 0x40f869
jmp 0x40f88a
push dword [ebp - 0x42c]
pop dword [ebp - 4]
jmp 0x40f9bf
jmp 0x40f88a
jmp 0x40f88a
push dword [ebp - 0x42c]
call sub.ws2_32.dll_closesocket
push 6
push 1
push 2
call sub.ws2_32.dll_socket
cmp eax, 0xffffffff
je 0x40f9b4
mov dword [ebp - 0x42c], eax
push 0x1bd
call sub.ws2_32.dll_htons
mov word [ebp - 0x12], ax
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x418], 1
lea eax, [ebp - 0x418]
push eax
push 0x8004667e
push dword [ebp - 0x42c]
call sub.ws2_32.dll_ioctlsocket
mov word [ebp - 0x430], 1
mov word [ebp - 0x42e], 0
push 4
lea eax, [ebp - 0x430]
push eax
push 0x80
push 0xffff
push dword [ebp - 0x42c]
call sub.ws2_32.dll_setsockopt
push 0x10
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x42c]
call sub.ws2_32.dll_connect
cmp eax, 0xffffffff
jne 0x40f9ae
call sub.ws2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x40f994
mov dword [ebp - 0x420], 6
mov dword [ebp - 0x41c], 0
mov dword [ebp - 0x428], 1
mov eax, dword [ebp - 0x42c]
mov dword [ebp - 0x424], eax
lea eax, [ebp - 0x420]
push eax
push 0
lea eax, [ebp - 0x428]
push eax
push 0
push 0
call sub.ws2_32.dll_select
or eax, eax
je 0x40f990
cmp eax, 0xffffffff
je 0x40f990
push dword [ebp - 0x42c]
pop dword [ebp - 4]
jmp 0x40f9bf
jmp 0x40f994
push 2
push dword [ebp - 0x42c]
call sub.ws2_32.dll_shutdown
push dword [ebp - 0x42c]
call sub.ws2_32.dll_closesocket
jmp 0x40f9b4
or eax, eax
jne 0x40f9b4
jmp 0x40f983
jmp 0x40f9bf
or eax, eax
jne 0x40f9bf
jmp 0x40f7cd
mov eax, dword [ebp - 4]
pop ebx
pop esi
pop edi
leave
ret 8