Function at 0x40461b
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
mov eax, dword [sym.imp.msvcrt.dll__isatty]
call eax
test eax, eax
jne 0x404665
mov dword [esp + 4], 0x8000
mov dword [esp], 1
mov eax, dword [sym.imp.msvcrt.dll__setmode]
call eax
mov dword [esp], 0
mov eax, dword [sym.imp.msvcrt.dll__isatty]
call eax
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jne 0x404692
mov dword [esp + 4], 0x8000
mov dword [esp], 0
mov eax, dword [sym.imp.msvcrt.dll__setmode]
call eax
mov eax, dword [0x40a54c]
mov eax, dword [eax]
cmp eax, 0x3f
ja 0x4046b8
mov ecx, dword [0x40a54c]
mov edx, dword [0x40a54c]
mov eax, dword [edx]
lea ebx, [eax + 1]
mov dword [edx], ebx
mov edx, dword [ebp + 8]
mov dword [ecx + eax*4 + 4], edx
mov word [ebp - 0x32], 2
mov word [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40a048]
test eax, eax
je 0x404780
mov eax, dword [0x40a048]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x40a548]
mov dword [ebp - 0x4c], eax
mov word [ebp - 0x24], 1
movzx eax, word [0x407028]
test ax, ax
je 0x40470c
mov dword [0x40a048], 0
jmp 0x404780
mov dword [ebp - 0x28], 0
jmp 0x404768
mov eax, dword [0x40a54c]
mov edx, dword [ebp - 0x28]
mov eax, dword [eax + edx*4 + 4]
test eax, eax
jne 0x404764
jmp 0x404747
mov eax, dword [0x40a54c]
mov edx, dword [0x40a54c]
mov ecx, dword [ebp - 0x28]
add ecx, 1
mov ecx, dword [edx + ecx*4 + 4]
mov edx, dword [ebp - 0x28]
mov dword [eax + edx*4 + 4], ecx
add dword [ebp - 0x28], 1
mov eax, dword [0x40a54c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x28]
ja 0x404727
mov eax, dword [0x40a54c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x404774
add dword [ebp - 0x28], 1
mov eax, dword [0x40a54c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
ja 0x404715
mov dword [esp], 0
call sub.msvcrt.dll__close
mov eax, dword [0x40a078]
test eax, eax
je 0x404798
mov eax, dword [0x40a078]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__sleep]
call eax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov dword [eax], 0
mov dword [esp], 0
mov eax, dword [sym.imp.WSOCK32.DLL_WSASetLastError]
call eax
sub esp, 4
jmp 0x404cb6
mov word [ebp - 0x22], 0x2008
cmp word [ebp - 0x24], 0
je 0x4047d3
mov word [ebp - 0x24], 0
jmp 0x404b46
mov edx, dword [0x40a554]
mov eax, dword [0x40a54c]
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 [0x40a054]
test eax, eax
je 0x404815
mov edx, dword [0x40a054]
mov eax, dword [0x40a058]
mov dword [esp + 8], 8
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [0x40a554]
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
mov eax, dword [sym.imp.WSOCK32.DLL_select]
call eax
sub esp, 0x14
mov ebx, eax
test ebx, ebx
jns 0x4048a2
mov eax, dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
call eax
cmp eax, 0x2714
je 0x4048a2
mov eax, dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
call eax
mov dword [ebp - 0x38], eax
mov dword [esp], str.select_fuxored
call fcn.0040307f
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_shutdown]
call eax
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_closesocket]
call eax
sub esp, 4
mov eax, 1
jmp 0x404d02
test ebx, ebx
jne 0x404938
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40a088]
test eax, eax
je 0x404938
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
sub edx, eax
mov eax, dword [0x40a054]
mov eax, dword [eax]
cmp edx, eax
jle 0x404938
movzx eax, word [0x40a086]
cmp ax, 1
jbe 0x4048ea
mov dword [esp], str.net_timeout
call fcn.0040307f
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_shutdown]
call eax
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_closesocket]
call eax
sub esp, 4
mov eax, dword [0x40a54c]
mov dword [eax], 0
mov dword [esp], 0
mov eax, dword [sym.imp.WSOCK32.DLL_WSASetLastError]
call eax
sub esp, 4
mov eax, 0
jmp 0x404d02
mov eax, dword [0x40a554]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0040594c
sub esp, 8
test eax, eax
je 0x404a29
lea eax, [ebp - 0x44]
mov dword [esp], eax
call sub.msvcrt.dll_time
mov eax, dword [0x40a540]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_recv]
call eax
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jg 0x404a03
mov dword [ebp - 0x2c], 0
jmp 0x4049ee
mov eax, dword [0x40a54c]
mov edx, dword [ebp - 0x2c]
mov eax, dword [eax + edx*4 + 4]
cmp eax, dword [ebp + 8]
jne 0x4049ea
jmp 0x4049cd
mov eax, dword [0x40a54c]
mov edx, dword [0x40a54c]
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 [0x40a54c]
mov eax, dword [eax]
sub eax, 1
cmp eax, dword [ebp - 0x2c]
ja 0x4049ad
mov eax, dword [0x40a54c]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x4049fa
add dword [ebp - 0x2c], 1
mov eax, dword [0x40a54c]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x2c]
ja 0x40499a
mov dword [ebp - 0x1c], 0
jmp 0x404a29
mov dword [ebp - 0x20], ebx
mov eax, dword [0x40a540]
mov dword [ebp - 0x50], eax
movzx eax, word [0x40a094]
test ax, ax
je 0x404a29
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x50]
mov dword [esp], eax
call fcn.00404566
cmp dword [ebp - 0x1c], 0
je 0x404a34
jmp 0x404b46
cmp dword [ebp - 0x30], 0
je 0x404aeb
call sub.msvcrt.dll__kbhit
test eax, eax
je 0x404b46
mov eax, dword [0x40a548]
mov dword [esp], eax
call sub.msvcrt.dll_gets
movzx eax, word [0x40a08e]
test ax, ax
je 0x404a8a
mov edx, dword [0x40a548]
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], 0xd
mov edx, dword [0x40a548]
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 [0x40a548]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [ebp - 0x1c], ebx
mov eax, dword [0x40a548]
mov dword [ebp - 0x4c], eax
movzx eax, word [0x407028]
test ax, ax
jne 0x404b46
mov eax, ebx
mov dword [0x40a048], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x404b46
mov eax, dword [0x40a548]
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 0x404b1c
mov dword [esp], 0
call sub.msvcrt.dll__close
jmp 0x404b46
mov dword [ebp - 0x1c], ebx
mov eax, dword [0x40a548]
mov dword [ebp - 0x4c], eax
movzx eax, word [0x407028]
test ax, ax
jne 0x404b46
mov eax, ebx
mov dword [0x40a048], eax
mov dword [esp], 0
call sub.msvcrt.dll__close
cmp dword [ebp - 0x1c], 0x2008
ja 0x404b58
cmp dword [ebp - 0x20], 0x2008
jbe 0x404b7f
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.0040307f
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
cmp word [ebp - 0x22], 0
jne 0x404b9c
mov dword [esp], str.too_many_output_retries
call fcn.0040307f
mov eax, 1
jmp 0x404d02
cmp dword [ebp - 0x20], 0
je 0x404c0a
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 0x404c0a
movzx eax, word [0x40a080]
test ax, ax
je 0x404bf2
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x50]
mov dword [esp + 4], eax
mov dword [esp], 1
call fcn.004043b1
mov eax, ebx
add dword [ebp - 0x50], eax
mov eax, ebx
sub dword [ebp - 0x20], eax
mov eax, dword [0x40a04c]
mov edx, ebx
add eax, edx
mov dword [0x40a04c], eax
cmp dword [ebp - 0x1c], 0
je 0x404c73
mov eax, dword [0x40a078]
test eax, eax
je 0x404c2f
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call fcn.004032b7
mov ebx, eax
jmp 0x404c32
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
mov eax, dword [sym.imp.WSOCK32.DLL_send]
call eax
sub esp, 0x10
mov ebx, eax
test ebx, ebx
jle 0x404c73
mov eax, ebx
add dword [ebp - 0x4c], eax
mov eax, ebx
sub dword [ebp - 0x1c], eax
mov eax, dword [0x40a050]
mov edx, ebx
add eax, edx
mov dword [0x40a050], eax
mov eax, dword [0x40a078]
test eax, eax
je 0x404c9a
mov eax, dword [0x40a078]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__sleep]
call eax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov dword [eax], 0
jmp 0x404cb6
cmp dword [ebp - 0x1c], 0
jne 0x404ca6
cmp dword [ebp - 0x20], 0
je 0x404cb6
movzx eax, word [ebp - 0x22]
sub eax, 1
mov word [ebp - 0x22], ax
jmp 0x404b46
mov eax, dword [0x40a54c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0040594c
sub esp, 8
test eax, eax
jne 0x4047bb
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_shutdown]
call eax
sub esp, 8
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.WSOCK32.DLL_closesocket]
call eax
sub esp, 4
mov eax, 0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret