Function at 0x403915
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:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0x3e8
lea eax, [ebp - 0x44]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov dword [esp], 1
call sub.msvcrt.dll__isatty
test eax, eax
jne 0x40395b
mov dword [esp + 4], 0x8000
mov dword [esp], 1
call sub.msvcrt.dll__setmode
mov dword [esp], 0
call sub.msvcrt.dll__isatty
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x403984
mov dword [esp + 4], 0x8000
mov dword [esp], 0
call sub.msvcrt.dll__setmode
mov dword [ebp - 0x28], 0
jmp 0x4039a2
mov eax, dword [0x40c12c]
mov edx, dword [ebp - 0x28]
mov eax, dword [eax + edx*4 + 4]
cmp eax, dword [ebp + 8]
je 0x4039b0
add dword [ebp - 0x28], 1
mov eax, dword [0x40c12c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
ja 0x40398d
jmp 0x4039b1
nop
mov eax, dword [0x40c12c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
jne 0x4039e4
mov eax, dword [0x40c12c]
mov eax, dword [eax]
cmp eax, 0x3f
ja 0x4039e4
mov eax, dword [0x40c12c]
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp + 8]
mov dword [eax + edx*4 + 4], ecx
mov eax, dword [0x40c12c]
mov edx, dword [eax]
add edx, 1
mov dword [eax], edx
mov word [ebp - 0x36], 2
mov word [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40c048]
test eax, eax
je 0x403aac
mov eax, dword [0x40c048]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40c128]
mov dword [ebp - 0x4c], eax
mov word [ebp - 0x24], 1
movzx eax, word [0x408028]
test ax, ax
je 0x403a38
mov dword [0x40c048], 0
jmp 0x403aac
mov dword [ebp - 0x2c], 0
jmp 0x403a94
mov eax, dword [0x40c12c]
mov edx, dword [ebp - 0x2c]
mov eax, dword [eax + edx*4 + 4]
test eax, eax
jne 0x403a90
jmp 0x403a73
mov eax, dword [0x40c12c]
mov edx, dword [0x40c12c]
mov ecx, dword [ebp - 0x2c]
add ecx, 1
mov ecx, dword [edx + ecx*4 + 4]
mov edx, dword [ebp - 0x2c]
mov dword [eax + edx*4 + 4], ecx
add dword [ebp - 0x2c], 1
mov eax, dword [0x40c12c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x2c]
ja 0x403a53
mov eax, dword [0x40c12c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x403aa0
add dword [ebp - 0x2c], 1
mov eax, dword [0x40c12c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x2c]
ja 0x403a41
mov dword [esp], 0
call sub.msvcrt.dll__close
mov eax, dword [0x40c078]
test eax, eax
je 0x403ac2
mov eax, dword [0x40c078]
mov dword [esp], eax
call sub.msvcrt.dll__sleep
call sub.msvcrt.dll__errno
mov dword [eax], 0
mov dword [esp], 0
call sub.WS2_32.dll_WSASetLastError
sub esp, 4
jmp 0x403f61
mov word [ebp - 0x22], 0x2008
cmp word [ebp - 0x24], 0
je 0x403af9
mov word [ebp - 0x24], 0
jmp 0x403df7
mov edx, dword [0x40c134]
mov eax, dword [0x40c12c]
mov ebx, eax
mov eax, 0x41
mov edi, edx
mov esi, ebx
mov ecx, eax
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x40c054]
test eax, eax
je 0x403b31
mov eax, dword [0x40c054]
mov ecx, dword [0x40c058]
mov edx, dword [eax + 4]
mov eax, dword [eax]
mov dword [ecx], eax
mov dword [ecx + 4], edx
mov eax, dword [0x40c134]
lea edx, [ebp - 0x40]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], 0x10
call sub.WS2_32.dll_select
sub esp, 0x14
mov ebx, eax
test ebx, ebx
jns 0x403bac
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2714
je 0x403bac
mov dword [esp], str.select_fuxored
call fcn.00402513
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_closesocket
sub esp, 4
mov eax, 1
jmp 0x403fa9
test ebx, ebx
jne 0x403c3c
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40c088]
test eax, eax
je 0x403c3c
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
sub edx, eax
mov eax, dword [0x40c054]
mov eax, dword [eax]
cmp edx, eax
jle 0x403c3c
movzx eax, word [0x40c086]
cmp ax, 1
jbe 0x403bf4
mov dword [esp], str.net_timeout
call fcn.00402513
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_closesocket
sub esp, 4
mov eax, dword [0x40c12c]
mov dword [eax], 0
mov dword [esp], 0
call sub.WS2_32.dll_WSASetLastError
sub esp, 4
mov eax, 0
jmp 0x403fa9
mov eax, dword [0x40c134]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x403d10
lea eax, [ebp - 0x44]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40c120]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_recv
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jg 0x403d05
mov dword [ebp - 0x30], 0
jmp 0x403cf0
mov eax, dword [0x40c12c]
mov edx, dword [ebp - 0x30]
mov eax, dword [eax + edx*4 + 4]
cmp eax, dword [ebp + 8]
jne 0x403cec
jmp 0x403ccf
mov eax, dword [0x40c12c]
mov edx, dword [0x40c12c]
mov ecx, dword [ebp - 0x30]
add ecx, 1
mov ecx, dword [edx + ecx*4 + 4]
mov edx, dword [ebp - 0x30]
mov dword [eax + edx*4 + 4], ecx
add dword [ebp - 0x30], 1
mov eax, dword [0x40c12c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x30]
ja 0x403caf
mov eax, dword [0x40c12c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x403cfc
add dword [ebp - 0x30], 1
mov eax, dword [0x40c12c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x30]
ja 0x403c9c
mov dword [ebp - 0x1c], 0
jmp 0x403d10
mov dword [ebp - 0x20], ebx
mov eax, dword [0x40c120]
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x1c], 0
je 0x403d1b
jmp 0x403df7
cmp dword [ebp - 0x34], 0
je 0x403d9c
call sub.msvcrt.dll__kbhit
test eax, eax
je 0x403df7
mov eax, dword [0x40c128]
mov dword [esp], eax
call sub.msvcrt.dll_gets
mov edx, dword [0x40c128]
mov eax, edx
mov ecx, 0xffffffff
mov ebx, eax
mov eax, 0
mov edi, ebx
repne scasb al, byte es:[edi]
mov eax, ecx
not eax
sub eax, 1
add eax, edx
mov word [eax], 0xa
mov eax, dword [0x40c128]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [ebp - 0x1c], ebx
mov eax, dword [0x40c128]
mov dword [ebp - 0x4c], eax
movzx eax, word [0x408028]
test ax, ax
jne 0x403df7
mov eax, ebx
mov dword [0x40c048], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x403df7
mov eax, dword [0x40c128]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov dword [esp], 0
call sub.msvcrt.dll__read
mov ebx, eax
test ebx, ebx
jg 0x403dcd
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x403df7
mov dword [ebp - 0x1c], ebx
mov eax, dword [0x40c128]
mov dword [ebp - 0x4c], eax
movzx eax, word [0x408028]
test ax, ax
jne 0x403df7
mov eax, ebx
mov dword [0x40c048], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
cmp dword [ebp - 0x1c], 0x2008
ja 0x403e09
cmp dword [ebp - 0x20], 0x2008
jbe 0x403e30
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov dword [esp], str.Preposterous_Pointers:__d___d
call fcn.00402513
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
cmp word [ebp - 0x22], 0
jne 0x403e4d
mov dword [esp], str.too_many_output_retries
call fcn.00402513
mov eax, 1
jmp 0x403fa9
cmp dword [ebp - 0x20], 0
je 0x403ebb
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x50]
mov dword [esp + 4], eax
mov dword [esp], 1
call sub.msvcrt.dll__write
mov ebx, eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
test ebx, ebx
jle 0x403ebb
movzx eax, word [0x40c080]
test ax, ax
je 0x403ea3
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x50]
mov dword [esp + 4], eax
mov dword [esp], 1
call fcn.0040375e
mov eax, ebx
add dword [ebp - 0x50], eax
mov eax, ebx
sub dword [ebp - 0x20], eax
mov eax, dword [0x40c04c]
mov edx, ebx
add eax, edx
mov dword [0x40c04c], eax
cmp dword [ebp - 0x1c], 0
je 0x403f22
mov eax, dword [0x40c078]
test eax, eax
je 0x403ee0
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call fcn.0040273e
mov ebx, eax
jmp 0x403ee3
mov ebx, dword [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x4c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_send
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jle 0x403f22
mov eax, ebx
add dword [ebp - 0x4c], eax
mov eax, ebx
sub dword [ebp - 0x1c], eax
mov eax, dword [0x40c050]
mov edx, ebx
add eax, edx
mov dword [0x40c050], eax
mov eax, dword [0x40c078]
test eax, eax
je 0x403f45
mov eax, dword [0x40c078]
mov dword [esp], eax
call sub.msvcrt.dll__sleep
call sub.msvcrt.dll__errno
mov dword [eax], 0
jmp 0x403f61
cmp dword [ebp - 0x1c], 0
jne 0x403f51
cmp dword [ebp - 0x20], 0
je 0x403f61
movzx eax, word [ebp - 0x22]
sub eax, 1
mov word [ebp - 0x22], ax
jmp 0x403df7
mov eax, dword [0x40c12c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
jne 0x403ae1
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WS2_32.dll_closesocket
sub esp, 4
mov eax, 0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret