Function at 0x404b1d
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 rbp
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x78
lea rbp, [rsp + 0x80]
mov dword [rbp + 0x30], ecx
mov dword [rbp - 0x40], 0
mov dword [rbp - 0x3c], 0x3e8
lea rax, [rbp - 0x48]
mov rcx, rax
call sub.msvcrt.dll__time64
mov ecx, 1
mov rax, qword [sym.imp.msvcrt.dll__isatty]
call rax
test eax, eax
jne 0x404b73
mov edx, 0x8000
mov ecx, 1
mov rax, qword [sym.imp.msvcrt.dll__setmode]
call rax
mov ecx, 0
mov rax, qword [sym.imp.msvcrt.dll__isatty]
call rax
mov dword [rbp - 0x28], eax
cmp dword [rbp - 0x28], 0
jne 0x404b9d
mov edx, 0x8000
mov ecx, 0
mov rax, qword [sym.imp.msvcrt.dll__setmode]
call rax
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov eax, dword [rax]
cmp eax, 0x3f
ja 0x404bd5
lea rax, [0x0040dc40]
mov rcx, qword [rax]
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov edx, dword [rax]
lea r8d, [rdx + 1]
mov dword [rax], r8d
mov eax, dword [rbp + 0x30]
mov edx, edx
mov qword [rcx + rdx*8 + 8], rax
mov word [rbp - 0x2a], 2
mov word [rbp - 0x1c], 0
mov dword [rbp - 0x18], 0
mov eax, dword [rbp - 0x18]
mov dword [rbp - 0x14], eax
mov eax, dword [0x0040d06c]
test eax, eax
je 0x404cc9
mov eax, dword [0x0040d06c]
mov dword [rbp - 0x14], eax
lea rax, [0x0040dc48]
mov r12, qword [rax]
mov word [rbp - 0x1c], 1
movzx eax, word [0x0040803c]
test ax, ax
je 0x404c30
mov dword [0x0040d06c], 0
jmp 0x404cc9
mov dword [rbp - 0x20], 0
jmp 0x404caa
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov edx, dword [rbp - 0x20]
mov rax, qword [rax + rdx*8 + 8]
test rax, rax
jne 0x404ca6
jmp 0x404c7f
lea rax, [0x0040dc40]
mov rax, qword [rax]
lea rdx, [0x0040dc40]
mov rdx, qword [rdx]
mov ecx, dword [rbp - 0x20]
add ecx, 1
mov ecx, ecx
mov rcx, qword [rdx + rcx*8 + 8]
mov edx, dword [rbp - 0x20]
mov qword [rax + rdx*8 + 8], rcx
add dword [rbp - 0x20], 1
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov eax, dword [rax]
sub eax, 1
cmp eax, dword [rbp - 0x20]
ja 0x404c52
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov edx, dword [rax]
sub edx, 1
mov dword [rax], edx
jmp 0x404cbf
add dword [rbp - 0x20], 1
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov eax, dword [rax]
cmp eax, dword [rbp - 0x20]
ja 0x404c39
mov ecx, 0
call sub.msvcrt.dll__close
mov eax, dword [0x0040d0bc]
test eax, eax
je 0x404ce4
mov eax, dword [0x0040d0bc]
mov ecx, eax
mov rax, qword [sym.imp.msvcrt.dll__sleep]
call rax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
mov ecx, 0
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
jmp 0x40524f
mov word [rbp - 0x1a], 0x2008
cmp word [rbp - 0x1c], 0
je 0x404d1e
mov word [rbp - 0x1c], 0
jmp 0x4050ed
lea rax, [0x0040db08]
mov rdx, qword [rax]
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov r8, rax
mov eax, 0x41
mov rdi, rdx
mov rsi, r8
mov rcx, rax
rep movsq qword [rdi], qword [rsi]
mov rax, qword [0x0040d078]
test rax, rax
je 0x404d6e
mov rdx, qword [0x0040d078]
mov rax, qword [0x0040d080]
mov r8d, 8
mov rcx, rax
call sub.msvcrt.dll_memcpy
lea rax, [0x0040db08]
mov rax, qword [rax]
lea rdx, [rbp - 0x40]
mov qword [rsp + 0x20], rdx
mov r9d, 0
mov r8d, 0
mov rdx, rax
mov ecx, 0x10
mov rax, qword [sym.imp.WSOCK32.dll_select]
call rax
mov ebx, eax
test ebx, ebx
jns 0x404df9
mov rax, qword [sym.imp.WSOCK32.dll_WSAGetLastError]
call rax
cmp eax, 0x2714
je 0x404df9
mov rax, qword [sym.imp.WSOCK32.dll_WSAGetLastError]
call rax
mov dword [rbp - 0x30], eax
lea rcx, str.select_fuxored
call fcn.004033f9
mov eax, dword [rbp + 0x30]
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
mov eax, dword [rbp + 0x30]
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov eax, 1
jmp 0x405294
test ebx, ebx
jne 0x404e96
lea rax, [rbp - 0x50]
mov rcx, rax
call sub.msvcrt.dll__time64
mov eax, dword [0x0040d0cc]
test eax, eax
je 0x404e96
mov rdx, qword [rbp - 0x50]
mov rax, qword [rbp - 0x48]
sub rdx, rax
mov rax, qword [0x0040d078]
mov eax, dword [rax]
cdqe
cmp rdx, rax
jle 0x404e96
movzx eax, word [0x0040d0ca]
cmp ax, 1
jbe 0x404e4b
lea rcx, str.net_timeout
call fcn.004033f9
mov eax, dword [rbp + 0x30]
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
mov eax, dword [rbp + 0x30]
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov dword [rax], 0
mov ecx, 0
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
mov eax, 0
jmp 0x405294
lea rax, [0x0040db08]
mov rdx, qword [rax]
mov eax, dword [rbp + 0x30]
mov rcx, rax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x404fac
lea rax, [rbp - 0x48]
mov rcx, rax
call sub.msvcrt.dll__time64
lea rax, [0x0040db10]
mov rdx, qword [rax]
mov eax, dword [rbp + 0x30]
mov r9d, 0
mov r8d, 0x2000
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_recv]
call rax
mov ebx, eax
test ebx, ebx
jg 0x404f89
mov dword [rbp - 0x24], 0
jmp 0x404f6b
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov edx, dword [rbp - 0x24]
mov rdx, qword [rax + rdx*8 + 8]
mov eax, dword [rbp + 0x30]
cmp rdx, rax
jne 0x404f67
jmp 0x404f40
lea rax, [0x0040dc40]
mov rax, qword [rax]
lea rdx, [0x0040dc40]
mov rdx, qword [rdx]
mov ecx, dword [rbp - 0x24]
add ecx, 1
mov ecx, ecx
mov rcx, qword [rdx + rcx*8 + 8]
mov edx, dword [rbp - 0x24]
mov qword [rax + rdx*8 + 8], rcx
add dword [rbp - 0x24], 1
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov eax, dword [rax]
sub eax, 1
cmp eax, dword [rbp - 0x24]
ja 0x404f13
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov edx, dword [rax]
sub edx, 1
mov dword [rax], edx
jmp 0x404f80
add dword [rbp - 0x24], 1
lea rax, [0x0040dc40]
mov rax, qword [rax]
mov eax, dword [rax]
cmp eax, dword [rbp - 0x24]
ja 0x404ef7
mov dword [rbp - 0x14], 0
jmp 0x404fac
mov dword [rbp - 0x18], ebx
lea rax, [0x0040db10]
mov r13, qword [rax]
movzx eax, word [0x0040d0e0]
test ax, ax
je 0x404fac
mov edx, ebx
mov rcx, r13
call fcn.00404a58
cmp dword [rbp - 0x14], 0
je 0x404fb7
jmp 0x4050ed
cmp dword [rbp - 0x28], 0
je 0x405093
call sub.msvcrt.dll__kbhit
test eax, eax
je 0x4050ed
lea rax, [0x0040dc48]
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_gets
movzx eax, word [0x0040d0d2]
test ax, ax
je 0x40501f
lea rax, [0x0040dc48]
mov rdx, qword [rax]
mov rax, rdx
mov rcx, 0xffffffffffffffff
mov r8, rax
mov eax, 0
mov rdi, r8
repne scasb al, byte [rdi]
mov rax, rcx
not rax
sub rax, 1
add rax, rdx
mov word [rax], 0xd
lea rax, [0x0040dc48]
mov rdx, qword [rax]
mov rax, rdx
mov rcx, 0xffffffffffffffff
mov r8, rax
mov eax, 0
mov rdi, r8
repne scasb al, byte [rdi]
mov rax, rcx
not rax
sub rax, 1
add rax, rdx
mov word [rax], 0xa
lea rax, [0x0040dc48]
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [rbp - 0x14], ebx
lea rax, [0x0040dc48]
mov r12, qword [rax]
movzx eax, word [0x0040803c]
test ax, ax
jne 0x4050ed
mov eax, ebx
mov dword [0x0040d06c], eax
mov ecx, 0
call sub.msvcrt.dll__close
jmp 0x4050ed
lea rax, [0x0040dc48]
mov rax, qword [rax]
mov r8d, 0x2000
mov rdx, rax
mov ecx, 0
call sub.msvcrt.dll__read
mov ebx, eax
test ebx, ebx
jg 0x4050c2
mov ecx, 0
call sub.msvcrt.dll__close
jmp 0x4050ed
mov dword [rbp - 0x14], ebx
lea rax, [0x0040dc48]
mov r12, qword [rax]
movzx eax, word [0x0040803c]
test ax, ax
jne 0x4050ed
mov eax, ebx
mov dword [0x0040d06c], eax
mov ecx, 0
call sub.msvcrt.dll__close
cmp dword [rbp - 0x14], 0x2008
ja 0x4050ff
cmp dword [rbp - 0x18], 0x2008
jbe 0x405123
mov edx, dword [rbp - 0x18]
mov eax, dword [rbp - 0x14]
mov r8d, edx
mov edx, eax
lea rcx, str.Preposterous_Pointers:__d___d
call fcn.004033f9
mov dword [rbp - 0x18], 0
mov eax, dword [rbp - 0x18]
mov dword [rbp - 0x14], eax
cmp word [rbp - 0x1a], 0
jne 0x405140
lea rcx, str.too_many_output_retries
call fcn.004033f9
mov eax, 1
jmp 0x405294
cmp dword [rbp - 0x18], 0
je 0x4051a7
mov eax, dword [rbp - 0x18]
mov r8d, eax
mov rdx, r13
mov ecx, 1
call sub.msvcrt.dll__write
mov ebx, eax
mov rax, qword [sym.imp.msvcrt.dll___iob_func]
call rax
mov rcx, rax
call sub.msvcrt.dll_fflush
test ebx, ebx
jle 0x4051a7
movzx eax, word [0x0040d0c4]
test ax, ax
je 0x40518c
mov r8d, ebx
mov rdx, r13
mov ecx, 1
call fcn.0040485c
movsxd rax, ebx
add r13, rax
mov eax, ebx
sub dword [rbp - 0x18], eax
mov eax, dword [0x0040d070]
mov edx, ebx
add eax, edx
mov dword [0x0040d070], eax
cmp dword [rbp - 0x14], 0
je 0x405207
mov eax, dword [0x0040d0bc]
test eax, eax
je 0x4051c8
mov eax, dword [rbp - 0x14]
mov edx, eax
mov rcx, r12
call fcn.00403698
mov ebx, eax
jmp 0x4051cb
mov ebx, dword [rbp - 0x14]
mov eax, dword [rbp + 0x30]
mov r9d, 0
mov r8d, ebx
mov rdx, r12
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_send]
call rax
mov ebx, eax
test ebx, ebx
jle 0x405207
movsxd rax, ebx
add r12, rax
mov eax, ebx
sub dword [rbp - 0x14], eax
mov eax, dword [0x0040d074]
mov edx, ebx
add eax, edx
mov dword [0x0040d074], eax
mov eax, dword [0x0040d0bc]
test eax, eax
je 0x405233
mov eax, dword [0x0040d0bc]
mov ecx, eax
mov rax, qword [sym.imp.msvcrt.dll__sleep]
call rax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
jmp 0x40524f
cmp dword [rbp - 0x14], 0
jne 0x40523f
cmp dword [rbp - 0x18], 0
je 0x40524f
movzx eax, word [rbp - 0x1a]
sub eax, 1
mov word [rbp - 0x1a], ax
jmp 0x4050ed
lea rax, [0x0040dc40]
mov rdx, qword [rax]
mov eax, dword [rbp + 0x30]
mov rcx, rax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x404d06
mov eax, dword [rbp + 0x30]
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
mov eax, dword [rbp + 0x30]
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov eax, 0
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop rbp
ret