Function at 0x40db64
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x24c
mov dword [esp], 0x1000
call sub.msvcrt.dll_malloc
test eax, eax
mov dword [ebp - 0x22c], eax
je 0x40de02
mov eax, dword [ebp + 0xc]
lea esi, [ebp - 0x11c]
cmp dword [ebp + 8], eax
cmovge eax, dword [ebp + 8]
inc eax
mov dword [ebp - 0x240], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov dword [ebp - 0x228], 0xf
mov dword [ebp - 0x224], 0
mov dword [ebp - 0x21c], edx
cmp edx, eax
mov dword [ebp - 0x220], 1
jne 0x40ddd8
cmp edx, eax
mov dword [ebp - 0x118], edx
mov dword [ebp - 0x11c], 1
jne 0x40dded
lea eax, [ebp - 0x228]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x240]
lea edi, [ebp - 0x220]
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.WS2_32.dll_select
sub esp, 0x14
test eax, eax
je 0x40dba1
jns 0x40dc4b
lea eax, [ebp - 0x22c]
mov dword [esp], eax
call fcn.00405434
lea eax, [ebp + 8]
mov dword [esp], eax
call fcn.00403b94
lea eax, [ebp + 0xc]
mov dword [esp], eax
call fcn.00403b94
jmp 0x40de02
mov eax, dword [ebp + 8]
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
push edx
push edx
jne 0x40dc22
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
push ebx
push ebx
jne 0x40dc22
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
push ecx
push ecx
jne 0x40dca8
mov eax, dword [ebp + 8]
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
push edx
push edx
je 0x40dba1
jmp 0x40dd4a
mov eax, dword [ebp - 0x22c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
mov ebx, eax
jle 0x40dc22
mov dword [ebp - 0x23c], 0
mov eax, dword [ebp - 0x23c]
add eax, dword [ebp - 0x22c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_send
sub esp, 0x10
cmp eax, 0xffffffff
jne 0x40dd2d
call fcn.0040339c
cmp eax, 0x2733
jne 0x40dd3d
mov dword [esp], 1
call fcn.004053d0
jmp 0x40dd35
add dword [ebp - 0x23c], eax
sub ebx, eax
cmp dword [ebp - 0x23c], ebx
jl 0x40dce4
test ebx, ebx
je 0x40dc8a
jmp 0x40dc22
mov eax, dword [ebp - 0x22c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x1000
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
test eax, eax
mov ebx, eax
jle 0x40dc22
xor edi, edi
mov eax, dword [ebp - 0x22c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
add eax, edi
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sub.WS2_32.dll_send
sub esp, 0x10
cmp eax, 0xffffffff
jne 0x40ddc3
call fcn.0040339c
cmp eax, 0x2733
jne 0x40ddcb
mov dword [esp], 1
call fcn.004053d0
jmp 0x40ddc7
sub ebx, eax
add edi, eax
cmp edi, ebx
jl 0x40dd7e
test ebx, ebx
je 0x40dba1
jmp 0x40dc22
mov dword [ebp - 0x218], eax
mov dword [ebp - 0x220], 2
jmp 0x40dbd3
mov dword [ebp - 0x114], eax
mov dword [ebp - 0x11c], 2
jmp 0x40dbeb
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret