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

Disassembly:
sub esp, 0x44
push ebx
push ebp
push esi
push edi
push 6
push 1
mov ebp, ecx
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [ebp + 4], eax
je 0x402787
mov ebx, dword [esp + 0x58]
mov word [esp + 0x14], 2
push ebx
call sub.WSOCK32.dll_inet_addr
mov dword [esp + 0x18], eax
mov ax, word [ebx + 0x100]
push eax
call sub.WSOCK32.dll_htons
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x14]
push 0x10
push ecx
push edx
mov word [esp + 0x22], ax
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
je 0x402787
mov al, byte [ebx + 0x208]
lea esi, [ebx + 0x208]
mov edx, dword [ebp + 4]
push 0
neg al
sbb al, al
lea ecx, [esp + 0x38]
push 3
and eax, 2
push ecx
push edx
mov byte [esp + 0x44], 5
mov byte [esp + 0x45], 1
mov byte [esp + 0x46], al
call sub.WSOCK32.dll_send
cmp eax, 3
jne 0x402787
mov ecx, dword [ebp + 4]
push 0
lea eax, [esp + 0x38]
push 2
push eax
push ecx
call sub.WSOCK32.dll_recv
test eax, eax
jle 0x402787
cmp byte [esp + 0x34], 5
jne 0x402787
mov al, byte [esp + 0x35]
cmp al, 2
jne 0x402783
mov eax, dword [ebx + 0x204]
test eax, eax
je 0x402793
cmp byte [esi], 0
je 0x402793
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
mov byte [esp + 0x34], 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [ebx + 0x307]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x36]
mov eax, ecx
mov byte [esp + 0x35], dl
push 0
lea ecx, [eax + edx + 3]
mov dword [esp + 0x14], ecx
mov ecx, edx
mov ebx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
mov ebx, dword [esp + 0x5c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, eax
mov byte [esp + edx + 0x3a], al
lea edi, [esp + edx + 0x3b]
mov edx, ecx
lea esi, [ebx + 0x307]
lea eax, [esp + 0x38]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x14]
mov ecx, dword [ebp + 4]
push esi
push eax
push ecx
call sub.WSOCK32.dll_send
cmp eax, esi
jne 0x402787
mov eax, dword [ebp + 4]
push 0
lea edx, [esp + 0x38]
push 2
push edx
push eax
call sub.WSOCK32.dll_recv
test eax, eax
jle 0x402787
cmp byte [esp + 0x34], 1
jne 0x402787
mov al, byte [esp + 0x35]
test al, al
je 0x4027af
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x44
ret 4
mov ecx, dword [ebp + 4]
push ecx
call sub.WSOCK32.dll_closesocket
pop edi
mov dword [ebp + 4], 0
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x44
ret 4
mov dx, word [ebx + 0x202]
push edx
call sub.WSOCK32.dll_htons
lea esi, [ebx + 0x102]
mov di, ax
push esi
mov word [esp + 0x2a], di
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
jne 0x40280f
or ecx, eax
mov edi, esi
xor eax, eax
mov byte [esp + 0x37], 3
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x39]
mov ebx, ecx
mov eax, ecx
shr ecx, 2
mov byte [esp + 0x38], bl
add ebx, 5
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
add ebx, 2
rep movsb byte es:[edi], byte [esi]
mov cx, word [esp + 0x26]
mov word [esp + ebx + 0x32], cx
jmp 0x402822
mov byte [esp + 0x37], 1
mov dword [esp + 0x38], eax
mov word [esp + 0x3c], di
mov ebx, 0xa
mov eax, dword [ebp + 4]
push 0
lea edx, [esp + 0x38]
push ebx
push edx
push eax
mov byte [esp + 0x44], 5
mov byte [esp + 0x45], 1
mov byte [esp + 0x46], 0
call sub.WSOCK32.dll_send
cmp eax, ebx
jne 0x402787
mov edx, dword [ebp + 4]
push 0
lea ecx, [esp + 0x38]
push 0xa
push ecx
push edx
call sub.WSOCK32.dll_recv
cmp eax, 2
jl 0x402787
mov al, byte [esp + 0x35]
test al, al
jne 0x402787
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x44
ret 4