Function at 0x403000
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], 0x64
call fcn.00404a00
add esp, 4
push 1
call fcn.004049d0
add esp, 4
test eax, eax
jne 0x40303f
push 0x8000
push 1
call fcn.00404950
add esp, 8
push edi
call fcn.004049d0
add esp, 4
cmp eax, edi
mov dword [esp + 0x28], eax
jne 0x40305e
push 0x8000
push edi
call fcn.00404950
add esp, 8
mov edx, dword [0x4100ec]
mov eax, dword [edx]
cmp eax, 0x40
jae 0x403083
mov ecx, dword [esp + 0x38]
mov dword [edx + eax*4 + 4], ecx
mov eax, dword [0x4100ec]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov edx, dword [0x4100ec]
mov eax, dword [0x40fc70]
xor ebp, ebp
xor ebx, ebx
cmp eax, edi
mov dword [esp + 0x18], edi
je 0x403100
cmp word [0x40c2e8], di
mov ebx, eax
mov eax, dword [0x4100e4]
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], eax
je 0x4030b8
mov dword [0x40fc70], edi
jmp 0x403100
mov esi, dword [edx]
xor eax, eax
cmp esi, edi
jbe 0x4030f7
lea ecx, [edx + 4]
cmp dword [ecx], edi
je 0x4030d1
inc eax
add ecx, 4
cmp eax, esi
jb 0x4030c3
jmp 0x4030f7
dec esi
cmp eax, esi
jae 0x4030f5
lea ecx, [eax*4 + 4]
mov esi, dword [edx + ecx + 4]
inc eax
mov dword [edx + ecx], esi
mov edx, dword [0x4100ec]
add ecx, 4
mov esi, dword [edx]
dec esi
cmp eax, esi
jb 0x4030dd
dec dword [edx]
push edi
call fcn.00409080
add esp, 4
mov eax, dword [0x40fca0]
cmp eax, edi
je 0x403112
push eax
call fcn.00404570
add esp, 4
push edi
mov dword [0x40fcd0], edi
call sub.WSOCK32.dll_WSASetLastError
mov ecx, dword [0x4100ec]
mov edx, dword [esp + 0x38]
push ecx
push edx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x4034ea
jmp 0x40313b
xor edi, edi
cmp word [esp + 0x18], di
mov dword [esp + 0x1c], 0x2008
je 0x403153
mov dword [esp + 0x18], edi
jmp 0x40334a
mov esi, dword [0x4100ec]
mov edi, dword [0x4100f0]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x40fc7c]
test eax, eax
je 0x403185
mov edx, dword [0x40fc80]
mov ecx, dword [eax]
mov dword [edx], ecx
mov ecx, dword [0x40fc80]
mov eax, dword [eax + 4]
mov dword [ecx + 4], eax
mov eax, dword [0x4100f0]
lea edx, [esp + 0x2c]
push edx
push 0
push 0
push eax
push 0x10
call sub.WSOCK32.dll_select
mov esi, eax
test esi, esi
jge 0x4031b3
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2714
jne 0x40346a
test esi, esi
jne 0x4031e4
lea ecx, [esp + 0x24]
push ecx
call fcn.00404a00
mov eax, dword [0x40fcbc]
add esp, 4
test eax, eax
jbe 0x4031e4
mov eax, dword [0x40fc7c]
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
mov ecx, dword [eax]
sub edx, esi
cmp edx, ecx
jg 0x403493
mov ecx, dword [0x4100f0]
mov esi, dword [esp + 0x38]
push ecx
push esi
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x40328c
lea edx, [esp + 0x20]
push edx
call fcn.00404a00
mov eax, dword [0x4100e0]
add esp, 4
push 0
push 0x2000
push eax
push esi
call sub.WSOCK32.dll_recv
test eax, eax
jg 0x40326c
mov edi, dword [0x4100ec]
xor eax, eax
mov ecx, dword [edi]
test ecx, ecx
jbe 0x403268
lea edx, [edi + 4]
cmp dword [edx], esi
je 0x403242
inc eax
add edx, 4
cmp eax, ecx
jb 0x403232
xor ebx, ebx
jmp 0x40328c
dec ecx
cmp eax, ecx
jae 0x403266
lea ecx, [eax*4 + 4]
mov edx, dword [edi + ecx + 4]
inc eax
mov dword [edi + ecx], edx
mov edi, dword [0x4100ec]
add ecx, 4
mov edx, dword [edi]
dec edx
cmp eax, edx
jb 0x40324e
dec dword [edi]
xor ebx, ebx
jmp 0x40328c
mov ecx, dword [0x4100e0]
cmp word [0x40fcc8], 0
mov ebp, eax
mov dword [esp + 0x10], ecx
je 0x40328c
push eax
push ecx
call fcn.00402f90
add esp, 8
test ebx, ebx
jne 0x40334a
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40330c
call fcn.00409ca0
test eax, eax
je 0x40334a
mov eax, dword [0x4100e4]
push eax
call fcn.004048f0
mov edi, 0x40c668
or ecx, 0xffffffff
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [0x4100e4]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [0x4100e4]
or ecx, 0xffffffff
mov edi, edx
mov dword [esp + 0x14], edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp word [0x40c2e8], ax
mov ebx, ecx
jne 0x40334a
mov dword [0x40fc70], ebx
jmp 0x403340
mov eax, dword [0x4100e4]
push 0x2000
push eax
push 0
call fcn.00408680
add esp, 0xc
test eax, eax
jle 0x403340
mov ecx, dword [0x4100e4]
cmp word [0x40c2e8], 0
mov ebx, eax
mov dword [esp + 0x14], ecx
jne 0x40334a
mov dword [0x40fc70], eax
push 0
call fcn.00409080
add esp, 4
mov edi, dword [esp + 0x14]
cmp ebx, 0x2008
ja 0x40335e
cmp ebp, 0x2008
jbe 0x403371
push ebp
push ebx
push str.Preposterous_Pointers:__d___d
call fcn.00402120
add esp, 0xc
xor ebp, ebp
xor ebx, ebx
cmp word [esp + 0x1c], 0
je 0x4034d0
test ebp, ebp
je 0x4033c9
mov edx, dword [esp + 0x10]
push ebp
push edx
push 1
call fcn.00406590
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x4033c9
cmp word [0x40fcac], 0
je 0x4033b1
mov eax, dword [esp + 0x10]
push esi
push eax
push 1
call fcn.00402e40
add esp, 0xc
mov edx, dword [esp + 0x10]
mov eax, dword [0x40fc74]
add edx, esi
sub ebp, esi
add eax, esi
mov dword [esp + 0x10], edx
mov dword [0x40fc74], eax
test ebx, ebx
je 0x40340c
mov eax, dword [0x40fca0]
test eax, eax
je 0x4033e2
push ebx
push edi
call fcn.00402280
add esp, 8
jmp 0x4033e4
mov eax, ebx
mov ecx, dword [esp + 0x38]
push 0
push eax
push edi
push ecx
call sub.WSOCK32.dll_send
test eax, eax
jle 0x40340c
mov ecx, dword [0x40fc78]
add edi, eax
sub ebx, eax
add ecx, eax
mov dword [esp + 0x14], edi
mov dword [0x40fc78], ecx
mov eax, dword [0x40fca0]
test eax, eax
jne 0x40342a
test ebx, ebx
jne 0x40341d
test ebp, ebp
je 0x40343d
add dword [esp + 0x1c], 0xffff
jmp 0x40334e
push eax
call fcn.00404570
add esp, 4
mov dword [0x40fcd0], 0
mov edx, dword [0x4100ec]
mov eax, dword [esp + 0x38]
push edx
push eax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x403139
mov ecx, dword [esp + 0x38]
push ecx
call sub.WSOCK32.dll_closesocket
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
call sub.WSOCK32.dll_WSAGetLastError
push str.select_fuxored
call fcn.00402120
mov ecx, dword [esp + 0x3c]
add esp, 4
push ecx
call sub.WSOCK32.dll_closesocket
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
cmp word [0x40fcb8], 1
jbe 0x4034aa
push str.net_timeout
call fcn.00402120
add esp, 4
mov edx, dword [esp + 0x38]
push edx
call sub.WSOCK32.dll_closesocket
mov eax, dword [0x4100ec]
push 0
mov dword [eax], 0
call sub.WSOCK32.dll_WSASetLastError
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
push str.too_many_output_retries
call fcn.00402120
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov ecx, dword [esp + 0x38]
push ecx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret