Function at 0x40451e
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 sym._time
mov dword [esp], 1
mov eax, dword [sym.imp.msvcrt.dll__isatty]
call eax
test eax, eax
jne 0x404568
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 0x404595
mov dword [esp + 4], 0x8000
mov dword [esp], 0
mov eax, dword [sym.imp.msvcrt.dll__setmode]
call eax
mov eax, dword [0x4120f8]
mov eax, dword [eax]
cmp eax, 0x3f
ja 0x4045bb
mov ecx, dword [0x4120f8]
mov edx, dword [0x4120f8]
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 [0x4120cc]
test eax, eax
je 0x404683
mov eax, dword [0x4120cc]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x4120f0]
mov dword [ebp - 0x4c], eax
mov word [ebp - 0x24], 1
movzx eax, word [0x40d02c]
test ax, ax
je 0x40460f
mov dword [0x4120cc], 0
jmp 0x404683
mov dword [ebp - 0x28], 0
jmp 0x40466b
mov eax, dword [0x4120f8]
mov edx, dword [ebp - 0x28]
mov eax, dword [eax + edx*4 + 4]
test eax, eax
jne 0x404667
jmp 0x40464a
mov edx, dword [0x4120f8]
mov eax, dword [ebp - 0x28]
lea ecx, [eax + 1]
mov eax, dword [0x4120f8]
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 [0x4120f8]
mov eax, dword [eax]
sub eax, 1
cmp dword [ebp - 0x28], eax
jb 0x40462a
mov eax, dword [0x4120f8]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x404677
add dword [ebp - 0x28], 1
mov eax, dword [0x4120f8]
mov eax, dword [eax]
cmp dword [ebp - 0x28], eax
jb 0x404618
mov dword [esp], 0
call sym._close
mov eax, dword [0x412114]
test eax, eax
je 0x40469b
mov eax, dword [0x412114]
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 0x404ba5
mov word [ebp - 0x22], 0x2008
cmp word [ebp - 0x24], 0
je 0x4046d6
mov word [ebp - 0x24], 0
jmp 0x404a2d
mov eax, dword [0x4120f8]
mov edx, dword [0x4120fc]
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 [0x4120d8]
test eax, eax
je 0x404718
mov edx, dword [0x4120d8]
mov eax, dword [0x4120dc]
mov dword [esp + 8], 8
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._memcpy
mov eax, dword [0x4120fc]
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 0x4047a5
mov eax, dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
call eax
cmp eax, 0x2714
je 0x4047a5
mov eax, dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
call eax
mov dword [ebp - 0x38], eax
mov dword [esp], str.select_fuxored
call sym._holler
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 0x404bf1
test ebx, ebx
jne 0x40483b
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sym._time
mov eax, dword [0x412124]
test eax, eax
je 0x40483b
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
sub edx, eax
mov eax, dword [0x4120d8]
mov eax, dword [eax]
cmp edx, eax
jle 0x40483b
movzx eax, word [0x412122]
cmp ax, 1
jbe 0x4047ed
mov dword [esp], str.net_timeout
call sym._holler
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 [0x4120f8]
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 0x404bf1
mov eax, dword [0x4120fc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
je 0x40492d
lea eax, [ebp - 0x44]
mov dword [esp], eax
call sym._time
mov eax, dword [0x4120f4]
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 0x404906
mov dword [ebp - 0x2c], 0
jmp 0x4048f1
mov eax, dword [0x4120f8]
mov edx, dword [ebp - 0x2c]
mov eax, dword [eax + edx*4 + 4]
cmp dword [ebp + 8], eax
jne 0x4048ed
jmp 0x4048d0
mov edx, dword [0x4120f8]
mov eax, dword [ebp - 0x2c]
lea ecx, [eax + 1]
mov eax, dword [0x4120f8]
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 [0x4120f8]
mov eax, dword [eax]
sub eax, 1
cmp dword [ebp - 0x2c], eax
jb 0x4048b0
mov eax, dword [0x4120f8]
mov edx, dword [eax]
sub edx, 1
mov dword [eax], edx
jmp 0x4048fd
add dword [ebp - 0x2c], 1
mov eax, dword [0x4120f8]
mov eax, dword [eax]
cmp dword [ebp - 0x2c], eax
jb 0x40489d
mov dword [ebp - 0x1c], 0
jmp 0x40492d
mov dword [ebp - 0x20], ebx
mov eax, dword [0x4120f4]
mov edi, eax
mov dword [ebp - 0x50], edi
movzx eax, word [0x412134]
test ax, ax
je 0x40492d
mov dword [esp + 4], ebx
mov eax, edi
mov dword [esp], eax
call sym._atelnet
cmp dword [ebp - 0x1c], 0
jne 0x404a29
cmp dword [ebp - 0x30], 0
je 0x4049cc
call sym._kbhit
test eax, eax
je 0x404a2d
mov eax, dword [0x4120f0]
mov dword [esp], eax
call sym._gets
movzx eax, word [0x41212a]
test ax, ax
je 0x40497c
mov ebx, dword [0x4120f0]
mov dword [esp], ebx
call sym._strlen
add eax, ebx
mov word [eax], 0xd
mov ebx, dword [0x4120f0]
mov dword [esp], ebx
call sym._strlen
add eax, ebx
mov word [eax], 0xa
mov eax, dword [0x4120f0]
mov dword [esp], eax
call sym._strlen
mov ebx, eax
mov dword [ebp - 0x1c], ebx
mov eax, dword [0x4120f0]
mov dword [ebp - 0x4c], eax
movzx eax, word [0x40d02c]
test ax, ax
jne 0x404a2d
mov eax, ebx
mov dword [0x4120cc], eax
mov dword [esp], 0
call sym._close
jmp 0x404a2d
mov eax, dword [0x4120f0]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov dword [esp], 0
call sym._read
mov ebx, eax
test ebx, ebx
jg 0x4049fd
mov dword [esp], 0
call sym._close
jmp 0x404a2d
mov dword [ebp - 0x1c], ebx
mov eax, dword [0x4120f0]
mov dword [ebp - 0x4c], eax
movzx eax, word [0x40d02c]
test ax, ax
jne 0x404a2c
mov eax, ebx
mov dword [0x4120cc], eax
mov dword [esp], 0
call sym._close
jmp 0x404a2d
nop
jmp 0x404a2d
nop
cmp dword [ebp - 0x1c], 0x2008
ja 0x404a3f
cmp dword [ebp - 0x20], 0x2008
jbe 0x404a66
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 sym._holler
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
cmp word [ebp - 0x22], 0
jne 0x404a83
mov dword [esp], str.too_many_output_retries
call sym._holler
mov eax, 1
jmp 0x404bf1
cmp dword [ebp - 0x20], 0
je 0x404af7
mov eax, dword [ebp - 0x20]
mov dword [esp + 8], eax
mov edi, dword [ebp - 0x50]
mov dword [esp + 4], edi
mov dword [esp], 1
call sym._write
mov ebx, eax
mov dword [esp], 0
mov eax, dword [dbg.__acrt_iob_func]
call eax
mov dword [esp], eax
call sym._fflush
test ebx, ebx
jle 0x404af7
movzx eax, word [0x41211c]
test ax, ax
je 0x404adf
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], 1
call sym._oprint
mov eax, ebx
add dword [ebp - 0x50], eax
mov eax, ebx
sub dword [ebp - 0x20], eax
mov eax, dword [0x4120d0]
mov edx, ebx
add eax, edx
mov dword [0x4120d0], eax
cmp dword [ebp - 0x1c], 0
je 0x404b62
mov eax, dword [0x412114]
test eax, eax
je 0x404b1c
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call sym._findline
mov ebx, eax
jmp 0x404b1f
mov ebx, dword [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebx
mov esi, dword [ebp - 0x4c]
mov dword [esp + 4], esi
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 0x404b62
mov eax, ebx
add esi, eax
mov dword [ebp - 0x4c], esi
mov eax, ebx
sub dword [ebp - 0x1c], eax
mov eax, dword [0x4120d4]
mov edx, ebx
add eax, edx
mov dword [0x4120d4], eax
mov eax, dword [0x412114]
test eax, eax
je 0x404b89
mov eax, dword [0x412114]
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 0x404ba5
cmp dword [ebp - 0x1c], 0
jne 0x404b95
cmp dword [ebp - 0x20], 0
je 0x404ba5
movzx eax, word [ebp - 0x22]
sub eax, 1
mov word [ebp - 0x22], ax
jmp 0x404a2d
mov eax, dword [0x4120f8]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
jne 0x4046be
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