Function at 0x4029b0
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
push edi
lea eax, [esp + 0x20]
xor edi, edi
push eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], 0x3e8
call fcn.00404121
push 1
call fcn.004040fb
add esp, 8
test eax, eax
jne 0x4029ec
push 0x8000
push 1
call fcn.00404085
add esp, 8
push edi
call fcn.004040fb
add esp, 4
cmp eax, edi
mov dword [esp + 0x28], eax
jne 0x402a0b
push 0x8000
push edi
call fcn.00404085
add esp, 8
mov edx, dword [0x40fe2c]
mov eax, dword [edx]
cmp eax, 0x40
jae 0x402a30
mov ecx, dword [esp + 0x38]
mov dword [edx + eax*4 + 4], ecx
mov eax, dword [0x40fe2c]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov edx, dword [0x40fe2c]
mov eax, dword [0x40faec]
xor ebp, ebp
xor ebx, ebx
cmp eax, edi
mov dword [esp + 0x18], edi
je 0x402aad
cmp word [0x40c1b0], di
mov ebx, eax
mov eax, dword [0x40fe24]
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], eax
je 0x402a65
mov dword [0x40faec], edi
jmp 0x402aad
mov ecx, dword [edx]
xor eax, eax
cmp ecx, edi
jbe 0x402aa4
lea esi, [edx + 4]
cmp dword [esi], edi
je 0x402a7e
inc eax
add esi, 4
cmp eax, ecx
jb 0x402a70
jmp 0x402aa4
dec ecx
cmp eax, ecx
jae 0x402aa2
lea ecx, [eax*4 + 4]
mov esi, dword [ecx + edx + 4]
inc eax
mov dword [ecx + edx], esi
mov edx, dword [0x40fe2c]
add ecx, 4
mov esi, dword [edx]
dec esi
cmp eax, esi
jb 0x402a8a
dec dword [edx]
push edi
call fcn.00409577
add esp, 4
mov eax, dword [0x40fb1c]
cmp eax, edi
je 0x402abf
push eax
call fcn.00403c64
add esp, 4
push edi
mov dword [0x40fb38], edi
call sub.WS2_32.dll_WSASetLastError
mov ecx, dword [0x40fe2c]
mov edx, dword [esp + 0x38]
push ecx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x402dec
jmp 0x402ae8
xor edi, edi
cmp word [esp + 0x18], di
mov dword [esp + 0x1c], 0x2008
je 0x402b00
mov dword [esp + 0x18], edi
jmp 0x402ce0
mov esi, dword [0x40fe2c]
mov edi, dword [0x40fe30]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x40faf8]
test eax, eax
je 0x402b32
mov edx, dword [0x40fafc]
mov ecx, dword [eax]
mov dword [edx], ecx
mov ecx, dword [0x40fafc]
mov eax, dword [eax + 4]
mov dword [ecx + 4], eax
mov eax, dword [0x40fe30]
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 0x402b60
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
jne 0x402e00
test esi, esi
jne 0x402b91
lea ecx, [esp + 0x24]
push ecx
call fcn.00404121
mov eax, dword [0x40fb2c]
add esp, 4
test eax, eax
jbe 0x402b91
mov eax, dword [0x40faf8]
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
mov ecx, dword [eax]
sub edx, esi
cmp edx, ecx
jg 0x402e29
mov ecx, dword [0x40fe30]
mov edi, dword [esp + 0x38]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x402c21
lea edx, [esp + 0x20]
push edx
call fcn.00404121
mov eax, dword [0x40fe20]
add esp, 4
push 0
push 0x2000
push eax
push edi
call sub.WS2_32.dll_recv
test eax, eax
jg 0x402c15
mov edx, dword [0x40fe2c]
xor eax, eax
mov ecx, dword [edx]
test ecx, ecx
jbe 0x402c11
lea esi, [edx + 4]
cmp dword [esi], edi
je 0x402beb
inc eax
add esi, 4
cmp eax, ecx
jb 0x402bdb
xor ebx, ebx
jmp 0x402c29
dec ecx
cmp eax, ecx
jae 0x402c0f
lea ecx, [eax*4 + 4]
mov esi, dword [ecx + edx + 4]
inc eax
mov dword [ecx + edx], esi
mov edx, dword [0x40fe2c]
add ecx, 4
mov esi, dword [edx]
dec esi
cmp eax, esi
jb 0x402bf7
dec dword [edx]
xor ebx, ebx
jmp 0x402c29
mov ecx, dword [0x40fe20]
mov ebp, eax
mov dword [esp + 0x10], ecx
test ebx, ebx
jne 0x402ce0
mov eax, dword [esp + 0x28]
test eax, eax
je 0x402ca2
call fcn.00409eab
test eax, eax
je 0x402ce0
mov edx, dword [0x40fe24]
push edx
call fcn.0040403b
mov edi, 0x40c528
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 [0x40fe24]
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 [0x40fe24]
or ecx, 0xffffffff
mov edi, edx
mov dword [esp + 0x14], edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp word [0x40c1b0], ax
mov ebx, ecx
jne 0x402ce0
mov dword [0x40faec], ebx
jmp 0x402cd6
mov eax, dword [0x40fe24]
push 0x2000
push eax
push 0
call fcn.00408962
add esp, 0xc
test eax, eax
jle 0x402cd6
mov ecx, dword [0x40fe24]
cmp word [0x40c1b0], 0
mov ebx, eax
mov dword [esp + 0x14], ecx
jne 0x402ce0
mov dword [0x40faec], eax
push 0
call fcn.00409577
add esp, 4
mov edi, dword [esp + 0x14]
cmp ebx, 0x2008
ja 0x402cf4
cmp ebp, 0x2008
jbe 0x402d07
push ebp
push ebx
push str.Preposterous_Pointers:__d___d
call fcn.00401b80
add esp, 0xc
xor ebp, ebp
xor ebx, ebx
cmp word [esp + 0x1c], 0
je 0x402e66
test ebp, ebp
je 0x402d5f
mov edx, dword [esp + 0x10]
push ebp
push edx
push 1
call fcn.00405160
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x402d5f
cmp word [0x40fb24], 0
je 0x402d47
mov eax, dword [esp + 0x10]
push esi
push eax
push 1
call fcn.00402860
add esp, 0xc
mov edx, dword [esp + 0x10]
mov eax, dword [0x40faf0]
add edx, esi
sub ebp, esi
add eax, esi
mov dword [esp + 0x10], edx
mov dword [0x40faf0], eax
test ebx, ebx
je 0x402da2
mov eax, dword [0x40fb1c]
test eax, eax
je 0x402d78
push ebx
push edi
call fcn.00401cd0
add esp, 8
jmp 0x402d7a
mov eax, ebx
mov ecx, dword [esp + 0x38]
push 0
push eax
push edi
push ecx
call sub.WS2_32.dll_send
test eax, eax
jle 0x402da2
mov ecx, dword [0x40faf4]
add edi, eax
sub ebx, eax
add ecx, eax
mov dword [esp + 0x14], edi
mov dword [0x40faf4], ecx
mov eax, dword [0x40fb1c]
test eax, eax
jne 0x402dc0
test ebx, ebx
jne 0x402db3
test ebp, ebp
je 0x402dd3
add dword [esp + 0x1c], 0xffff
jmp 0x402ce4
push eax
call fcn.00403c64
add esp, 4
mov dword [0x40fb38], 0
mov edx, dword [0x40fe2c]
mov eax, dword [esp + 0x38]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x402ae6
mov ecx, dword [esp + 0x38]
push ecx
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.00401b80
mov ecx, dword [esp + 0x3c]
add esp, 4
push ecx
call sub.WS2_32.dll_closesocket
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret
cmp word [0x40fb2a], 1
jbe 0x402e40
push str.net_timeout
call fcn.00401b80
add esp, 4
mov edx, dword [esp + 0x38]
push edx
call sub.WS2_32.dll_closesocket
mov eax, dword [0x40fe2c]
push 0
mov dword [eax], 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.00401b80
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret