Function at 0x40de41
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get socket status
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2dc
mov ebx, dword [ebp + 8]
lea edx, [ebp - 0x2b4]
lea esi, [ebp - 0x11c]
mov dword [ebp - 0x2c0], 0xffffffff
mov eax, dword [ebx]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [ebp - 0x118], eax
inc eax
mov dword [esp + 4], esi
mov dword [esp], eax
mov dword [ebp - 0x2bc], 0xffffffff
mov dword [ebp - 0x2b4], 5
mov dword [ebp - 0x2b0], 0
mov dword [ebp - 0x11c], 1
call sub.WS2_32.dll_select
sub esp, 0x14
test eax, eax
jle 0x40e0ee
mov dword [esp + 4], esi
mov eax, dword [ebx]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
push esi
push esi
je 0x40e0ee
lea eax, [ebp - 0x2bc]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 4
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
jle 0x40e0ee
cmp dword [ebp - 0x2bc], 1
mov eax, dword [ebx]
lea esi, [ebp - 0x21c]
mov dword [esp + 0xc], 0
jne 0x40dfac
mov dword [esp + 8], 6
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
cmp eax, 6
jne 0x40e0ee
lea eax, [ebp - 0x2aa]
mov dword [esp], eax
mov dword [esp + 8], 2
mov dword [esp + 4], esi
mov word [ebp - 0x2ac], 2
call fcn.0040b2af
lea eax, [ebp - 0x21a]
mov dword [esp + 4], eax
lea eax, [ebp - 0x2a8]
mov dword [esp], eax
mov dword [esp + 8], 4
call fcn.0040b2af
lea eax, [ebp - 0x2a4]
mov dword [esp + 8], 8
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.0040b1ee
jmp 0x40e04a
mov dword [esp + 8], 0x100
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
jle 0x40e0ee
lea edi, [ebp - 0x29c]
mov dword [esp + 8], pe_nt_image_headers32
mov dword [esp + 4], esi
mov dword [esp], edi
mov dword [ebp - 0x2b8], 0
call fcn.0040ad48
mov dword [esp + 8], 2
lea eax, [esi + eax + 1]
mov dword [esp + 4], eax
lea eax, [ebp - 0x2b8]
mov dword [esp], eax
call fcn.0040b2af
movzx eax, word [ebp - 0x2b8]
mov dword [esp], eax
call sub.WS2_32.dll_ntohs
lea edx, [ebp - 0x2ac]
movzx eax, ax
push ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], edi
mov dword [ebp - 0x2b8], eax
call fcn.004033a1
test al, al
jne 0x40e04a
mov dword [esp + 4], 1
jmp 0x40e07c
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
cmp eax, 0xffffffff
mov dword [ebp - 0x2c0], eax
jne 0x40e088
mov dword [esp + 4], 2
mov eax, dword [ebx]
mov dword [esp], eax
call fcn.0040de0a
jmp 0x40e0ee
lea edx, [ebp - 0x2ac]
mov dword [esp + 8], 0x10
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.WS2_32.dll_connect
sub esp, 0xc
inc eax
mov eax, dword [ebx]
je 0x40e0d0
mov dword [esp + 4], 3
mov dword [esp], eax
call fcn.0040de0a
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c0]
mov dword [esp], eax
call fcn.0040db64
jmp 0x40e0ee
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.0040de0a
lea eax, [ebp - 0x2c0]
mov dword [esp], eax
call fcn.00403b94
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret