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

Disassembly:
sub esp, 0x24
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x20]
xor edi, edi
push eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], 0x3e8
call fcn.00404996
push 1
call fcn.0040496f
add esp, 8
test eax, eax
jne 0x402e5c
push 0x8000
push 1
call fcn.004048ed
add esp, 8
push edi
call fcn.0040496f
add esp, 4
cmp eax, edi
mov dword [esp + 0x28], eax
jne 0x402e7b
push 0x8000
push edi
call fcn.004048ed
add esp, 8
mov edx, dword [0x40ea44]
mov eax, dword [edx]
cmp eax, 0x40
jae 0x402e9d
mov ecx, dword [esp + 0x38]
mov dword [edx + eax*4 + 4], ecx
mov eax, dword [0x40ea44]
inc dword [eax]
mov edx, dword [0x40ea44]
mov eax, dword [0x40e76c]
xor ebp, ebp
cmp eax, edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], edi
je 0x402f23
cmp word [0x40e064], di
mov ebx, dword [0x40e9ec]
mov ebp, eax
mov dword [esp + 0x18], 1
je 0x402ed1
mov dword [0x40e76c], edi
jmp 0x402f27
mov ecx, dword [edx]
xor eax, eax
cmp ecx, edi
jbe 0x402f18
lea esi, [edx + 4]
lea esp, [esp]
cmp dword [esi], edi
je 0x402ef7
inc eax
add esi, 4
cmp eax, ecx
jb 0x402ee0
push edi
call fcn.00409ec3
add esp, 4
jmp 0x402f27
dec ecx
cmp eax, ecx
jae 0x402f16
lea esp, [esp]
mov ecx, dword [edx + eax*4 + 8]
mov dword [edx + eax*4 + 4], ecx
mov edx, dword [0x40ea44]
mov ecx, dword [edx]
inc eax
dec ecx
cmp eax, ecx
jb 0x402f00
dec dword [edx]
push edi
call fcn.00409ec3
add esp, 4
jmp 0x402f27
mov ebx, dword [esp + 0x28]
mov eax, dword [0x40e79c]
cmp eax, edi
je 0x402f39
push eax
call fcn.00404592
add esp, 4
push edi
mov dword [0x40e7cc], edi
call sub.WS2_32.dll_WSASetLastError
mov edx, dword [0x40ea44]
mov eax, dword [esp + 0x38]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4032a5
mov edi, edi
cmp word [esp + 0x18], 0
mov dword [esp + 0x1c], 0x2008
je 0x402f7d
mov dword [esp + 0x18], 0
jmp 0x40316a
mov esi, dword [0x40ea44]
mov edi, dword [0x40e9e8]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x40e778]
test eax, eax
je 0x402faf
mov ecx, dword [eax]
mov edx, dword [0x40e77c]
mov dword [edx], ecx
mov eax, dword [eax + 4]
mov ecx, dword [0x40e77c]
mov dword [ecx + 4], eax
mov eax, dword [0x40e9e8]
lea edx, [esp + 0x2c]
push edx
push 0
push 0
push eax
push 0x10
call sub.WS2_32.dll_select
mov esi, eax
test esi, esi
jge 0x402fdd
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
jne 0x4032c1
test esi, esi
jne 0x40300e
lea ecx, [esp + 0x24]
push ecx
call fcn.00404996
mov eax, dword [0x40e7b8]
add esp, 4
test eax, eax
jbe 0x40300e
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
mov eax, dword [0x40e778]
mov ecx, dword [eax]
sub edx, esi
cmp edx, ecx
jg 0x4032f2
mov ecx, dword [0x40e9e8]
mov edi, dword [esp + 0x38]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4030be
lea edx, [esp + 0x20]
push edx
call fcn.00404996
mov eax, dword [0x40ea40]
add esp, 4
push 0
push 0x2000
push eax
push edi
call sub.WS2_32.dll_recv
test eax, eax
jg 0x40309c
mov esi, dword [0x40ea44]
mov ecx, dword [esi]
xor eax, eax
test ecx, ecx
jbe 0x403098
lea edx, [esi + 4]
lea esp, [esp]
cmp dword [edx], edi
je 0x403070
inc eax
add edx, 4
cmp eax, ecx
jb 0x403060
xor ebp, ebp
jmp 0x4030c6
dec ecx
cmp eax, ecx
jae 0x403096
jmp 0x403080
mov ecx, dword [esi + eax*4 + 8]
mov dword [esi + eax*4 + 4], ecx
mov esi, dword [0x40ea44]
mov edx, dword [esi]
inc eax
dec edx
cmp eax, edx
jb 0x403080
dec dword [esi]
xor ebp, ebp
jmp 0x4030c6
cmp word [0x40e7c4], 0
mov ecx, dword [0x40ea40]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ecx
je 0x4030be
push eax
push ecx
call fcn.00402db0
add esp, 8
test ebp, ebp
jne 0x40316a
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40312f
call fcn.0040a1e1
test eax, eax
je 0x40316a
mov eax, dword [0x40e9ec]
push eax
call fcn.004048a3
mov edi, dword [0x40e9ec]
add esp, 4
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4030f0
mov cx, word [0x40b784]
mov word [edi], cx
mov edx, dword [0x40e9ec]
mov eax, edx
lea esi, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403110
sub eax, esi
cmp word [0x40e064], 0
mov ebp, eax
mov ebx, edx
jne 0x40316a
mov dword [0x40e76c], ebp
jmp 0x403160
mov edx, dword [0x40e9ec]
push 0x2000
push edx
push 0
call fcn.00409250
add esp, 0xc
test eax, eax
jle 0x403160
cmp word [0x40e064], 0
mov ebx, dword [0x40e9ec]
mov ebp, eax
jne 0x40316a
mov dword [0x40e76c], eax
push 0
call fcn.00409ec3
add esp, 4
mov edi, dword [esp + 0x14]
mov edi, edi
cmp ebp, 0x2008
ja 0x403180
cmp edi, 0x2008
jbe 0x403197
push edi
push ebp
push str.Preposterous_Pointers:__d___d
call fcn.00402060
xor edi, edi
add esp, 0xc
mov dword [esp + 0x14], edi
xor ebp, ebp
cmp word [esp + 0x1c], 0
je 0x403338
test edi, edi
je 0x4031fd
mov eax, dword [esp + 0x10]
push edi
push eax
push 1
call fcn.00406865
push 0x40e098
mov esi, eax
call fcn.00404346
add esp, 0x10
test esi, esi
jle 0x4031fd
cmp word [0x40e7a8], 0
je 0x4031e1
mov ecx, dword [esp + 0x10]
push esi
push ecx
push 1
call fcn.00402c50
add esp, 0xc
mov edx, dword [esp + 0x10]
mov eax, dword [0x40e770]
add edx, esi
sub edi, esi
add eax, esi
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], edi
mov dword [0x40e770], eax
test ebp, ebp
je 0x403257
mov eax, dword [0x40e79c]
test eax, eax
je 0x403231
test ebx, ebx
jne 0x403212
xor eax, eax
jmp 0x403233
cmp ebp, 0x2000
jbe 0x40321e
xor eax, eax
jmp 0x403233
test ebp, ebp
mov ecx, ebp
mov eax, ebx
jle 0x403231
cmp byte [eax], 0xa
je 0x403275
inc eax
dec ecx
test ecx, ecx
jg 0x403226
mov eax, ebp
mov edx, dword [esp + 0x38]
push 0
push eax
push ebx
push edx
call sub.WS2_32.dll_send
test eax, eax
jle 0x403257
mov ecx, dword [0x40e774]
add ebx, eax
sub ebp, eax
add ecx, eax
mov dword [0x40e774], ecx
mov eax, dword [0x40e79c]
test eax, eax
jne 0x40327a
test ebp, ebp
jne 0x403268
test edi, edi
je 0x40328d
add dword [esp + 0x1c], 0xffff
jmp 0x403170
sub eax, ebx
inc eax
jmp 0x403233
push eax
call fcn.00404592
add esp, 4
mov dword [0x40e7cc], 0
mov eax, dword [0x40ea44]
mov ecx, dword [esp + 0x38]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x402f60
mov esi, dword [esp + 0x38]
push 2
push esi
call sub.WS2_32.dll_shutdown
push esi
call sub.WS2_32.dll_closesocket
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
call sub.WS2_32.dll_WSAGetLastError
push str.select_fuxored
call fcn.00402060
mov esi, dword [esp + 0x3c]
add esp, 4
push 2
push esi
call sub.WS2_32.dll_shutdown
push esi
call sub.WS2_32.dll_closesocket
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret
cmp word [0x40e7b4], 1
jbe 0x403309
push str.net_timeout
call fcn.00402060
add esp, 4
mov esi, dword [esp + 0x38]
push 2
push esi
call sub.WS2_32.dll_shutdown
push esi
call sub.WS2_32.dll_closesocket
mov edx, dword [0x40ea44]
push 0
mov dword [edx], 0
call sub.WS2_32.dll_WSASetLastError
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
push str.too_many_output_retries
call fcn.00402060
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret