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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
mov dword [ebp - 0x15c], ecx
mov eax, dword [ebp - 0x15c]
cmp dword [eax], 0xffffffff
jne 0x401b0b
mov eax, 0xfffffff7
jmp 0x401e67
mov ecx, dword [ebp - 0x15c]
call fcn.00405100
mov ecx, dword [ebp + 0xc]
and ecx, 0xffff
add ecx, 0x10
push ecx
call fcn.00405940
add esp, 4
mov dword [ebp - 0x134], eax
mov edx, dword [ebp - 0x134]
mov dword [ebp - 0xc], edx
cmp dword [ebp - 0xc], 0
jne 0x401b4a
mov eax, 0xfffffff8
jmp 0x401e67
mov dword [ebp - 0x120], 0
mov dword [ebp - 0x12c], 0
jmp 0x401b6f
mov eax, dword [ebp - 0x12c]
add eax, 1
mov dword [ebp - 0x12c], eax
mov ecx, dword [ebp - 0x12c]
cmp ecx, dword [ebp - 0x120]
jae 0x401b98
mov edx, dword [ebp - 0x12c]
mov eax, dword [ebp - 0x15c]
mov ecx, dword [ebp + edx*4 - 0x11c]
cmp ecx, dword [eax]
jne 0x401b96
jmp 0x401b98
jmp 0x401b60
mov edx, dword [ebp - 0x12c]
cmp edx, dword [ebp - 0x120]
jne 0x401bd3
cmp dword [ebp - 0x120], 0x40
jae 0x401bd3
mov eax, dword [ebp - 0x12c]
mov ecx, dword [ebp - 0x15c]
mov edx, dword [ecx]
mov dword [ebp + eax*4 - 0x11c], edx
mov eax, dword [ebp - 0x120]
add eax, 1
mov dword [ebp - 0x120], eax
xor ecx, ecx
test ecx, ecx
jne 0x401b54
mov dx, word [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x15c]
mov dl, byte [ecx + 0x34]
push edx
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x15c]
call fcn.004015cb
push 0
push 0x10
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x15c]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_send]
mov dword [ebp - 0x124], eax
cmp dword [ebp - 0x124], 0xffffffff
jne 0x401c51
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x138], ecx
mov edx, dword [ebp - 0x138]
push edx
call fcn.00405935
add esp, 4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x124], eax
or eax, 0xffffffff
jmp 0x401e67
mov eax, dword [ebp - 0x15c]
add eax, 0x18
push eax
push 0
push 0
lea ecx, [ebp - 0x120]
push ecx
mov edx, dword [ebp - 0x15c]
mov eax, dword [edx]
add eax, 1
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jne 0x401c9e
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x13c], ecx
mov edx, dword [ebp - 0x13c]
push edx
call fcn.00405935
add esp, 4
mov eax, 0xfffffffe
jmp 0x401e67
push 0
mov eax, dword [ebp + 0xc]
and eax, 0xffff
add eax, 0x10
push eax
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0x15c]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x124], eax
mov ecx, dword [ebp + 0xc]
and ecx, 0xffff
add ecx, 0x10
cmp ecx, dword [ebp - 0x124]
je 0x401cfb
mov edx, dword [ebp - 0xc]
mov dword [ebp - 0x140], edx
mov eax, dword [ebp - 0x140]
push eax
call fcn.00405935
add esp, 4
mov eax, 0xfffffffa
jmp 0x401e67
mov ecx, dword [ebp + 0xc]
and ecx, 0xffff
push ecx
call fcn.00405940
add esp, 4
mov dword [ebp - 0x144], eax
mov edx, dword [ebp - 0x144]
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 0
jne 0x401d44
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x148], eax
mov ecx, dword [ebp - 0x148]
push ecx
call fcn.00405935
add esp, 4
mov eax, 0xfffffff8
jmp 0x401e67
mov edx, dword [ebp - 8]
push edx
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 4]
push ecx
lea edx, [ebp - 0x128]
push edx
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 0x15c]
call fcn.00401978
mov dword [ebp - 0x124], eax
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x14c], ecx
mov edx, dword [ebp - 0x14c]
push edx
call fcn.00405935
add esp, 4
cmp dword [ebp - 0x124], 1
jne 0x401dec
mov eax, dword [ebp - 4]
and eax, 0xff
test eax, eax
jne 0x401dec
mov ecx, dword [ebp - 0x15c]
xor edx, edx
mov dl, byte [ecx + 0x34]
mov eax, dword [ebp - 0x128]
and eax, 0xff
cmp edx, eax
jne 0x401dec
mov ecx, dword [ebp + 0xc]
and ecx, 0xffff
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp + 0x10]
push eax
call fcn.00405600
add esp, 0xc
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x150], ecx
mov edx, dword [ebp - 0x150]
push edx
call fcn.00405935
add esp, 4
mov eax, 1
jmp 0x401e67
cmp dword [ebp - 0x124], 1
jne 0x401e4a
mov eax, dword [ebp - 4]
and eax, 0xff
test eax, eax
je 0x401e4a
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x154], ecx
mov edx, dword [ebp - 0x154]
push edx
call fcn.00405935
add esp, 4
lea eax, [ebp - 0x130]
push eax
mov ecx, dword [ebp - 0x15c]
call fcn.004039e1
mov dword [ebp - 0x124], eax
cmp dword [ebp - 0x124], 1
jne 0x401e42
mov eax, dword [ebp - 0x130]
jmp 0x401e67
mov eax, dword [ebp - 0x124]
jmp 0x401e67
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x158], ecx
mov edx, dword [ebp - 0x158]
push edx
call fcn.00405935
add esp, 4
mov eax, 0xfffffffa
mov esp, ebp
pop ebp
ret 0xc