Function at 0x403160
Capabilities:
Get socket status
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x24
push ebx
push ebp
push esi
lea eax, [esp + 0x1c]
push edi
xor ebx, ebx
push eax
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], 0x3e8
call fcn.004049a1
push 1
call fcn.0040497b
add esp, 8
test eax, eax
jne 0x40319c
push 0x8000
push 1
call fcn.00404905
add esp, 8
push ebx
call fcn.0040497b
add esp, 4
cmp eax, ebx
mov dword [esp + 0x28], eax
jne 0x4031bb
push 0x8000
push ebx
call fcn.00404905
add esp, 8
mov edx, dword [0x40ffcc]
mov edi, dword [esp + 0x38]
xor eax, eax
mov ecx, dword [edx]
cmp ecx, ebx
jbe 0x4031dc
lea esi, [edx + 4]
cmp dword [esi], edi
je 0x4031dc
inc eax
add esi, 4
cmp eax, ecx
jb 0x4031d0
cmp eax, ecx
jne 0x4031f9
cmp ecx, 0x40
jae 0x4031f9
mov dword [edx + eax*4 + 4], edi
mov eax, dword [0x40ffcc]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov edx, dword [0x40ffcc]
mov eax, dword [0x40fc80]
xor ebp, ebp
test eax, eax
mov dword [esp + 0x18], ebx
je 0x403277
mov ecx, dword [0x40ffc4]
cmp word [0x40c2e0], bp
mov ebx, eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], 1
je 0x40322d
mov dword [0x40fc80], ebp
jmp 0x403277
mov ecx, dword [edx]
xor eax, eax
test ecx, ecx
jbe 0x40326d
lea esi, [edx + 4]
cmp dword [esi], 0
je 0x403247
inc eax
add esi, 4
cmp eax, ecx
jb 0x403238
jmp 0x40326d
dec ecx
cmp eax, ecx
jae 0x40326b
lea ecx, [eax*4 + 4]
mov esi, dword [ecx + edx + 4]
inc eax
mov dword [ecx + edx], esi
mov edx, dword [0x40ffcc]
add ecx, 4
mov esi, dword [edx]
dec esi
cmp eax, esi
jb 0x403253
dec dword [edx]
push 0
call fcn.00409df3
add esp, 4
mov eax, dword [0x40fcb0]
test eax, eax
je 0x403289
push eax
call fcn.00404594
add esp, 4
push 0
mov dword [0x40fcd4], 0
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov edx, dword [0x40ffcc]
push edx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4035e5
cmp word [esp + 0x18], 0
mov dword [esp + 0x1c], 0x2008
je 0x4032cd
mov dword [esp + 0x18], 0
jmp 0x4034ca
mov esi, dword [0x40ffcc]
mov edi, dword [0x40ffd0]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x40fc8c]
test eax, eax
je 0x4032ff
mov edx, dword [0x40fc90]
mov ecx, dword [eax]
mov dword [edx], ecx
mov ecx, dword [0x40fc90]
mov eax, dword [eax + 4]
mov dword [ecx + 4], eax
mov eax, dword [0x40ffd0]
lea edx, [esp + 0x2c]
push edx
push 0
push 0
push eax
push 0x10
call dword [sym.imp.WS2_32.dll_select]
mov esi, eax
test esi, esi
jge 0x403331
mov edi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call edi
cmp eax, 0x2714
jne 0x4035f6
test esi, esi
jne 0x403362
lea ecx, [esp + 0x24]
push ecx
call fcn.004049a1
mov eax, dword [0x40fcc0]
add esp, 4
test eax, eax
jbe 0x403362
mov eax, dword [0x40fc8c]
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
mov ecx, dword [eax]
sub edx, esi
cmp edx, ecx
jg 0x40361d
mov ecx, dword [0x40ffd0]
mov edi, dword [esp + 0x38]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40340b
lea edx, [esp + 0x20]
push edx
call fcn.004049a1
mov eax, dword [0x40ffc0]
add esp, 4
push 0
push 0x2000
push eax
push edi
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jg 0x4033eb
mov edx, dword [0x40ffcc]
xor eax, eax
mov ecx, dword [edx]
test ecx, ecx
jbe 0x4033e7
lea esi, [edx + 4]
cmp dword [esi], edi
je 0x4033c1
inc eax
add esi, 4
cmp eax, ecx
jb 0x4033b1
xor ebx, ebx
jmp 0x403413
dec ecx
cmp eax, ecx
jae 0x4033e5
lea ecx, [eax*4 + 4]
mov esi, dword [ecx + edx + 4]
inc eax
mov dword [ecx + edx], esi
mov edx, dword [0x40ffcc]
add ecx, 4
mov esi, dword [edx]
dec esi
cmp eax, esi
jb 0x4033cd
dec dword [edx]
xor ebx, ebx
jmp 0x403413
mov ecx, dword [0x40ffc0]
cmp word [0x40fccc], 0
mov ebp, eax
mov dword [esp + 0x14], ecx
je 0x40340b
push eax
push ecx
call fcn.004030f0
add esp, 8
test ebx, ebx
jne 0x4034ca
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40348c
call fcn.0040a78b
test eax, eax
je 0x4034ca
mov ecx, dword [0x40ffc4]
push ecx
call fcn.004048bb
mov edi, 0x40c658
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 [0x40ffc4]
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 [0x40ffc4]
or ecx, 0xffffffff
mov edi, edx
mov dword [esp + 0x10], edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp word [0x40c2e0], ax
mov ebx, ecx
jne 0x4034ca
mov dword [0x40fc80], ebx
jmp 0x4034c0
mov eax, dword [0x40ffc4]
push 0x2000
push eax
push 0
call fcn.0040910f
add esp, 0xc
test eax, eax
jle 0x4034c0
mov ecx, dword [0x40ffc4]
cmp word [0x40c2e0], 0
mov ebx, eax
mov dword [esp + 0x10], ecx
jne 0x4034ca
mov dword [0x40fc80], eax
push 0
call fcn.00409df3
add esp, 4
mov edi, dword [sym.imp.WS2_32.dll_send]
cmp ebx, 0x2008
ja 0x4034e0
cmp ebp, 0x2008
jbe 0x4034f3
push ebp
push ebx
push str.Preposterous_Pointers:__d___d
call fcn.00402150
add esp, 0xc
xor ebp, ebp
xor ebx, ebx
cmp word [esp + 0x1c], 0
je 0x40365d
test ebp, ebp
je 0x40354b
mov edx, dword [esp + 0x14]
push ebp
push edx
push 1
call fcn.00406d80
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x40354b
cmp word [0x40fcb8], 0
je 0x403533
mov eax, dword [esp + 0x14]
push esi
push eax
push 1
call fcn.00402fa0
add esp, 0xc
mov edx, dword [esp + 0x14]
mov eax, dword [0x40fc84]
add edx, esi
sub ebp, esi
add eax, esi
mov dword [esp + 0x14], edx
mov dword [0x40fc84], eax
test ebx, ebx
je 0x403597
mov eax, dword [0x40fcb0]
test eax, eax
je 0x403568
mov ecx, dword [esp + 0x10]
push ebx
push ecx
call fcn.004022b0
add esp, 8
jmp 0x40356a
mov eax, ebx
mov edx, dword [esp + 0x10]
push 0
push eax
mov eax, dword [esp + 0x40]
push edx
push eax
call edi
test eax, eax
jle 0x403597
mov esi, dword [esp + 0x10]
mov ecx, dword [0x40fc88]
add esi, eax
sub ebx, eax
add ecx, eax
mov dword [esp + 0x10], esi
mov dword [0x40fc88], ecx
mov eax, dword [0x40fcb0]
test eax, eax
jne 0x4035b5
test ebx, ebx
jne 0x4035a8
test ebp, ebp
je 0x4035c8
add dword [esp + 0x1c], 0xffff
jmp 0x4034d0
push eax
call fcn.00404594
add esp, 4
mov dword [0x40fcd4], 0
mov ecx, dword [0x40ffcc]
mov edx, dword [esp + 0x38]
push ecx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x4032b0
mov edi, dword [esp + 0x38]
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
call edi
push str.select_fuxored
call fcn.00402150
mov eax, dword [esp + 0x3c]
add esp, 4
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret
cmp word [0x40fcbe], 1
jbe 0x403634
push str.net_timeout
call fcn.00402150
add esp, 4
mov ecx, dword [esp + 0x38]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [0x40ffcc]
push 0
mov dword [edx], 0
call dword [sym.imp.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.00402150
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret