Function at 0x404301
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, 0x7c
cld
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0x3e8
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov dword [esp], 1
call sub.msvcrt.dll__isatty
test eax, eax
jne 0x404348
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 0x404371
mov dword [esp + 4], 0x8000
mov dword [esp], 0
call sub.msvcrt.dll__setmode
mov dword [ebp - 0x28], 0
jmp 0x40438f
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x28]
mov eax, dword [eax + edx*4 + 4]
cmp eax, dword [ebp + 8]
je 0x40439b
add dword [ebp - 0x28], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
ja 0x40437a
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
jne 0x4043ce
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, 0x3f
ja 0x4043ce
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp + 8]
mov dword [eax + edx*4 + 4], ecx
mov eax, dword [0x40a14c]
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 [0x40a030]
test eax, eax
je 0x404496
mov eax, dword [0x40a030]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40a148]
mov dword [ebp - 0x5c], eax
mov word [ebp - 0x24], 1
movzx eax, word [0x407024]
test ax, ax
je 0x404422
mov dword [0x40a030], 0
jmp 0x404496
mov dword [ebp - 0x2c], 0
jmp 0x40447e
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x2c]
mov eax, dword [eax + edx*4 + 4]
test eax, eax
jne 0x40447a
jmp 0x40445d
mov eax, dword [0x40a14c]
mov edx, dword [0x40a14c]
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 [0x40a14c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x2c]
ja 0x40443d
mov eax, dword [0x40a14c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x40448a
add dword [ebp - 0x2c], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x2c]
ja 0x40442b
mov dword [esp], 0
call sub.msvcrt.dll__close
mov eax, dword [0x40a060]
test eax, eax
je 0x4044ac
mov eax, dword [0x40a060]
mov dword [esp], eax
call sub.msvcrt.dll__sleep
call sub.msvcrt.dll__errno
mov dword [eax], 0
mov dword [esp], 0
call sub.WSOCK32.DLL_WSASetLastError
sub esp, 4
jmp 0x40497d
mov word [ebp - 0x22], 0x2008
cmp word [ebp - 0x24], 0
je 0x4044e3
mov word [ebp - 0x24], 0
jmp 0x404815
mov edx, dword [0x40a154]
mov eax, dword [0x40a14c]
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 [0x40a03c]
test eax, eax
je 0x404525
mov edx, dword [0x40a03c]
mov eax, dword [0x40a040]
mov dword [esp + 8], 8
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [0x40a154]
lea edx, [ebp - 0x44]
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.WSOCK32.DLL_select
sub esp, 0x14
mov ebx, eax
test ebx, ebx
jns 0x4045a8
call sub.WSOCK32.DLL_WSAGetLastError
cmp eax, 0x2714
je 0x4045a8
call sub.WSOCK32.DLL_WSAGetLastError
mov dword [ebp - 0x3c], eax
mov dword [esp], str.select_fuxored
call fcn.00402dec
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_closesocket
sub esp, 4
mov eax, 1
jmp 0x4049c5
test ebx, ebx
jne 0x404638
lea eax, [ebp - 0x4c]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40a070]
test eax, eax
je 0x404638
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x48]
sub edx, eax
mov eax, dword [0x40a03c]
mov eax, dword [eax]
cmp edx, eax
jle 0x404638
movzx eax, word [0x40a06e]
cmp ax, 1
jbe 0x4045f0
mov dword [esp], str.net_timeout
call fcn.00402dec
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_closesocket
sub esp, 4
mov eax, dword [0x40a14c]
mov dword [eax], 0
mov dword [esp], 0
call sub.WSOCK32.DLL_WSASetLastError
sub esp, 4
mov eax, 0
jmp 0x4049c5
mov eax, dword [0x40a154]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x404727
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40a140]
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.WSOCK32.DLL_recv
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jg 0x404701
mov dword [ebp - 0x30], 0
jmp 0x4046ec
mov eax, dword [0x40a14c]
mov edx, dword [ebp - 0x30]
mov eax, dword [eax + edx*4 + 4]
cmp eax, dword [ebp + 8]
jne 0x4046e8
jmp 0x4046cb
mov eax, dword [0x40a14c]
mov edx, dword [0x40a14c]
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 [0x40a14c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x30]
ja 0x4046ab
mov eax, dword [0x40a14c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x4046f8
add dword [ebp - 0x30], 1
mov eax, dword [0x40a14c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x30]
ja 0x404698
mov dword [ebp - 0x1c], 0
jmp 0x404727
mov dword [ebp - 0x20], ebx
mov eax, dword [0x40a140]
mov dword [ebp - 0x60], eax
movzx eax, word [0x40a07c]
test ax, ax
je 0x404727
mov dword [esp + 4], ebx
mov ecx, dword [ebp - 0x60]
mov dword [esp], ecx
call fcn.00404249
cmp dword [ebp - 0x1c], 0
jne 0x404814
cmp dword [ebp - 0x34], 0
je 0x4047b6
call sub.msvcrt.dll__kbhit
test eax, eax
je 0x404815
mov eax, dword [0x40a148]
mov dword [esp], eax
call sub.msvcrt.dll_gets
mov ebx, dword [0x40a148]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea eax, [ebx + eax]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x408958
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [0x40a148]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [ebp - 0x1c], ebx
mov esi, dword [0x40a148]
mov dword [ebp - 0x5c], esi
movzx eax, word [0x407024]
test ax, ax
jne 0x404815
mov eax, ebx
mov dword [0x40a030], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x404815
mov eax, dword [0x40a148]
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 0x4047e7
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x404815
mov dword [ebp - 0x1c], ebx
mov edi, dword [0x40a148]
mov dword [ebp - 0x5c], edi
movzx eax, word [0x407024]
test ax, ax
jne 0x404815
mov eax, ebx
mov dword [0x40a030], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x404815
nop
cmp dword [ebp - 0x1c], 0x2008
ja 0x404827
cmp dword [ebp - 0x20], 0x2008
jbe 0x40484e
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.00402dec
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
cmp word [ebp - 0x22], 0
jne 0x40486b
mov dword [esp], str.too_many_output_retries
call fcn.00402dec
mov eax, 1
jmp 0x4049c5
cmp dword [ebp - 0x20], 0
je 0x4048db
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x60]
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 0x4048db
movzx eax, word [0x40a068]
test ax, ax
je 0x4048c1
mov dword [esp + 8], ebx
mov ecx, dword [ebp - 0x60]
mov dword [esp + 4], ecx
mov dword [esp], 1
call fcn.00404088
mov eax, ebx
add dword [ebp - 0x60], eax
mov eax, ebx
sub dword [ebp - 0x20], eax
mov edx, dword [0x40a034]
mov eax, ebx
lea eax, [edx + eax]
mov dword [0x40a034], eax
cmp dword [ebp - 0x1c], 0
je 0x404944
mov eax, dword [0x40a060]
test eax, eax
je 0x404900
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov esi, dword [ebp - 0x5c]
mov dword [esp], esi
call fcn.00403015
mov ebx, eax
jmp 0x404903
mov ebx, dword [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov edi, dword [ebp - 0x5c]
mov dword [esp + 4], edi
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_send
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jle 0x404944
mov eax, ebx
add dword [ebp - 0x5c], eax
mov eax, ebx
sub dword [ebp - 0x1c], eax
mov edx, dword [0x40a038]
mov eax, ebx
lea eax, [edx + eax]
mov dword [0x40a038], eax
mov eax, dword [0x40a060]
test eax, eax
je 0x404967
mov eax, dword [0x40a060]
mov dword [esp], eax
call sub.msvcrt.dll__sleep
call sub.msvcrt.dll__errno
mov dword [eax], 0
jmp 0x40497d
cmp dword [ebp - 0x1c], 0
jne 0x404973
cmp dword [ebp - 0x20], 0
je 0x40497d
sub word [ebp - 0x22], 1
jmp 0x404815
mov eax, dword [0x40a14c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL___WSAFDIsSet
sub esp, 8
test eax, eax
jne 0x4044cb
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_shutdown
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.WSOCK32.DLL_closesocket
sub esp, 4
mov eax, 0
lea esp, [ebp - 0xc]
add esp, 0
pop ebx
pop esi
pop edi
pop ebp
ret