Function at 0x402650
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

Disassembly:
sub esp, 0x20
push ebx
push ebp
or ebp, 0xffffffff
push 0x40020
mov dword [esp + 0xc], ebp
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4028c7
push esi
push edi
xor eax, eax
mov ecx, 0x10008
mov edi, ebx
xor esi, esi
rep stosd dword es:[edi], eax
mov dword [esp + 0x18], esi
test esi, esi
jne 0x40269a
cmp ebp, 0xffffffff
je 0x40269a
test ebp, ebp
jne 0x40272e
jmp 0x4026b1
test ebp, ebp
je 0x4026b1
cmp ebp, 0xffffffff
je 0x4026b1
push 2
push ebp
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
push 6
mov edi, 2
push 1
push edi
call sub.WSOCK32.dll_socket
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x4026d8
mov dword [esp + 0x10], 0x15
mov dword [esp + 0x18], edi
jmp 0x402844
mov eax, dword [esp + 0x34]
cmp esi, 5
mov word [esp + 0x20], di
mov word [esp + 0x22], 0x69a7
mov dword [esp + 0x24], eax
ja 0x402856
lea ecx, [esp + 0x20]
push 0x10
push ecx
push ebp
call sub.WSOCK32.dll_connect
test eax, eax
jge 0x40272e
push edi
push ebp
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
push 0x7d0
or ebp, 0xffffffff
mov dword [esp + 0x14], 3
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x402844
mov edx, dword [esp + 0x38]
or ecx, 0xffffffff
mov dword [ebx + 4], edx
mov edx, dword [esp + 0x3c]
mov edi, edx
xor eax, eax
mov dword [ebx], 0xaabbccdd
mov dword [ebx + 8], 0x30303030
repne scasb al, byte es:[edi]
not ecx
add ecx, 2
lea edi, [ebx + 0x20]
shr ecx, 2
shl ecx, 2
push edx
push edi
mov dword [ebx + 0x10], ecx
mov dword [ebx + 0x14], 0x74401100
call fcn.00401060
mov eax, dword [ebx + 0x14]
mov ecx, dword [ebx + 0x10]
push eax
push ecx
push edi
call fcn.00402600
mov edx, dword [ebx + 0x10]
push edx
push edi
call fcn.004025d0
mov esi, dword [ebx + 0x10]
add esp, 0x1c
add esi, 0x20
mov dword [ebx + 0xc], eax
push 0
push esi
push ebx
push ebp
call sub.WSOCK32.dll_send
cmp eax, esi
je 0x4027ad
mov dword [esp + 0x10], 0x2c
jmp 0x402844
xor eax, eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [ebx], eax
mov dword [esp + 0x1c], eax
mov esi, 0x40020
mov eax, dword [esp + 0x14]
push 0
push esi
push eax
push ebp
call sub.WSOCK32.dll_recv
test eax, eax
jle 0x40281a
cmp eax, esi
jg 0x40281a
cmp esi, 0x40020
jne 0x4027ee
cmp dword [ebx], 0xaabbccdd
jne 0x4027ee
mov esi, dword [ebx + 0x10]
add esi, 0x20
mov ecx, dword [esp + 0x1c]
sub esi, eax
add ecx, eax
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x14]
add ecx, eax
test esi, esi
mov dword [esp + 0x14], ecx
jne 0x4027c2
cmp dword [ebx], 0xaabbccdd
je 0x402824
mov dword [esp + 0x10], 0x4f
jmp 0x402844
mov dword [esp + 0x10], 0x4e
jmp 0x402844
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x40287e
push eax
push edi
call fcn.004025d0
mov ecx, dword [ebx + 0xc]
add esp, 8
cmp ecx, eax
je 0x40287e
mov dword [esp + 0x10], 0x50
mov esi, dword [esp + 0x18]
inc esi
cmp esi, 5
mov dword [esp + 0x18], esi
jb 0x402687
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
test ebp, ebp
pop edi
pop esi
jle 0x402874
push 2
push ebp
call sub.WSOCK32.dll_shutdown
push ebp
call sub.WSOCK32.dll_closesocket
mov eax, dword [esp + 8]
pop ebp
pop ebx
add esp, 0x20
ret
mov eax, dword [ebx + 8]
test eax, eax
je 0x40288b
mov dword [esp + 0x10], eax
jmp 0x402856
mov ecx, dword [ebx + 0x14]
mov edx, dword [ebx + 0x10]
lea esi, [ebx + 0x20]
push ecx
push edx
push esi
call fcn.00402600
mov edi, dword [esp + 0x4c]
add esp, 0xc
test edi, edi
je 0x4028b8
mov ecx, dword [ebx + 0x10]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x44]
test eax, eax
je 0x402856
mov ecx, dword [ebx + 0x10]
mov dword [eax], ecx
jmp 0x402856
pop ebp
mov eax, 1
pop ebx
add esp, 0x20
ret