Function at 0x404ba9
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 r12
push rdi
push rsi
push rbx
mov rbp, rsp
sub rsp, 0x70
mov dword [rbp + 0x30], ecx
mov dword [rbp - 0x28], 0
mov dword [rbp - 0x24], 0x3e8
lea rax, [rbp - 0x30]
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 0x404bf8
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 - 0x18], eax
cmp dword [rbp - 0x18], 0
jne 0x404c22
mov edx, 0x8000
mov ecx, 0
mov rax, qword [sym.imp.msvcrt.dll__setmode]
call rax
lea rax, [0x0040db80]
mov rax, qword [rax]
mov eax, dword [rax]
cmp eax, 0x3f
ja 0x404c58
lea rax, [0x0040db80]
mov r8, qword [rax]
lea rax, [0x0040db80]
mov rax, qword [rax]
mov edx, dword [rax]
lea ecx, [rdx + 1]
mov dword [rax], ecx
mov eax, dword [rbp + 0x30]
mov edx, edx
mov qword [r8 + rdx*8 + 8], rax
mov word [rbp - 0x1a], 2
mov word [rbp - 0xc], 0
mov dword [rbp - 8], 0
mov eax, dword [rbp - 8]
mov dword [rbp - 4], eax
mov eax, dword [0x0040d06c]
test eax, eax
je 0x404d4e
mov eax, dword [0x0040d06c]
mov dword [rbp - 4], eax
lea rax, [0x0040db88]
mov rsi, qword [rax]
mov word [rbp - 0xc], 1
movzx eax, word [0x00408040]
test ax, ax
je 0x404cb3
mov dword [0x0040d06c], 0
jmp 0x404d4e
mov dword [rbp - 0x10], 0
jmp 0x404d2f
lea rax, [0x0040db80]
mov rdx, qword [rax]
mov eax, dword [rbp - 0x10]
mov rax, qword [rdx + rax*8 + 8]
test rax, rax
jne 0x404d2b
jmp 0x404d04
lea rax, [0x0040db80]
mov rcx, qword [rax]
mov eax, dword [rbp - 0x10]
lea r8d, [rax + 1]
lea rax, [0x0040db80]
mov rdx, qword [rax]
mov eax, r8d
mov rcx, qword [rcx + rax*8 + 8]
mov eax, dword [rbp - 0x10]
mov qword [rdx + rax*8 + 8], rcx
add dword [rbp - 0x10], 1
lea rax, [0x0040db80]
mov rax, qword [rax]
mov eax, dword [rax]
sub eax, 1
cmp dword [rbp - 0x10], eax
jb 0x404cd5
lea rax, [0x0040db80]
mov rax, qword [rax]
mov edx, dword [rax]
sub edx, 1
mov dword [rax], edx
jmp 0x404d44
add dword [rbp - 0x10], 1
lea rax, [0x0040db80]
mov rax, qword [rax]
mov eax, dword [rax]
cmp dword [rbp - 0x10], eax
jb 0x404cbc
mov ecx, 0
call sub.msvcrt.dll__close
mov eax, dword [0x0040d0bc]
test eax, eax
je 0x404d69
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 0x4052d1
mov word [rbp - 0xa], 0x2008
cmp word [rbp - 0xc], 0
je 0x404da3
mov word [rbp - 0xc], 0
jmp 0x40516a
lea rax, [0x0040db80]
mov rdx, qword [rax]
lea rax, [0x0040da68]
mov rax, qword [rax]
mov ecx, 0x208
mov r8, rcx
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rax, qword [0x0040d078]
test rax, rax
je 0x404de7
mov rdx, qword [0x0040d078]
mov rax, qword [0x0040d080]
mov rdx, qword [rdx]
mov qword [rax], rdx
lea rax, [0x0040da68]
mov rdx, qword [rax]
lea rax, [rbp - 0x28]
mov qword [rsp + 0x20], rax
mov r9d, 0
mov r8d, 0
mov ecx, 0x10
mov rax, qword [sym.imp.WSOCK32.dll_select]
call rax
mov ebx, eax
test ebx, ebx
jns 0x404e6f
mov rax, qword [sym.imp.WSOCK32.dll_WSAGetLastError]
call rax
cmp eax, 0x2714
je 0x404e6f
mov rax, qword [sym.imp.WSOCK32.dll_WSAGetLastError]
call rax
mov dword [rbp - 0x20], eax
lea rcx, str.select_fuxored
call fcn.004034a4
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 0x405316
test ebx, ebx
jne 0x404f0c
lea rax, [rbp - 0x38]
mov rcx, rax
call sub.msvcrt.dll__time64
mov eax, dword [0x0040d0cc]
test eax, eax
je 0x404f0c
mov rdx, qword [rbp - 0x38]
mov rax, qword [rbp - 0x30]
sub rdx, rax
mov rax, qword [0x0040d078]
mov eax, dword [rax]
cdqe
cmp rdx, rax
jle 0x404f0c
movzx eax, word [0x0040d0ca]
cmp ax, 1
jbe 0x404ec1
lea rcx, str.net_timeout
call fcn.004034a4
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, [0x0040db80]
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 0x405316
lea rax, [0x0040da68]
mov rdx, qword [rax]
mov eax, dword [rbp + 0x30]
mov rcx, rax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x405024
lea rax, [rbp - 0x30]
mov rcx, rax
call sub.msvcrt.dll__time64
lea rax, [0x0040da70]
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 0x405001
mov dword [rbp - 0x14], 0
jmp 0x404fe3
lea rax, [0x0040db80]
mov rdx, qword [rax]
mov eax, dword [rbp - 0x14]
mov rdx, qword [rdx + rax*8 + 8]
mov eax, dword [rbp + 0x30]
cmp rdx, rax
jne 0x404fdf
jmp 0x404fb8
lea rax, [0x0040db80]
mov rcx, qword [rax]
mov eax, dword [rbp - 0x14]
lea r8d, [rax + 1]
lea rax, [0x0040db80]
mov rdx, qword [rax]
mov eax, r8d
mov rcx, qword [rcx + rax*8 + 8]
mov eax, dword [rbp - 0x14]
mov qword [rdx + rax*8 + 8], rcx
add dword [rbp - 0x14], 1
lea rax, [0x0040db80]
mov rax, qword [rax]
mov eax, dword [rax]
sub eax, 1
cmp dword [rbp - 0x14], eax
jb 0x404f89
lea rax, [0x0040db80]
mov rax, qword [rax]
mov edx, dword [rax]
sub edx, 1
mov dword [rax], edx
jmp 0x404ff8
add dword [rbp - 0x14], 1
lea rax, [0x0040db80]
mov rax, qword [rax]
mov eax, dword [rax]
cmp dword [rbp - 0x14], eax
jb 0x404f6d
mov dword [rbp - 4], 0
jmp 0x405024
mov dword [rbp - 8], ebx
lea rax, [0x0040da70]
mov r12, qword [rax]
movzx eax, word [0x0040d0e0]
test ax, ax
je 0x405024
mov edx, ebx
mov rcx, r12
call fcn.00404adf
cmp dword [rbp - 4], 0
jne 0x405166
cmp dword [rbp - 0x18], 0
je 0x40510a
call sub.msvcrt.dll__kbhit
test eax, eax
je 0x40516a
lea rax, [0x0040db88]
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_gets
movzx eax, word [0x0040d0d2]
test ax, ax
je 0x405096
lea rax, [0x0040db88]
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, [0x0040db88]
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, [0x0040db88]
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov dword [rbp - 4], ebx
lea rax, [0x0040db88]
mov rsi, qword [rax]
movzx eax, word [0x00408040]
test ax, ax
jne 0x40516a
mov eax, ebx
mov dword [0x0040d06c], eax
mov ecx, 0
call sub.msvcrt.dll__close
jmp 0x40516a
lea rax, [0x0040db88]
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 0x405139
mov ecx, 0
call sub.msvcrt.dll__close
jmp 0x40516a
mov dword [rbp - 4], ebx
lea rax, [0x0040db88]
mov rsi, qword [rax]
movzx eax, word [0x00408040]
test ax, ax
jne 0x405169
mov eax, ebx
mov dword [0x0040d06c], eax
mov ecx, 0
call sub.msvcrt.dll__close
jmp 0x40516a
nop
jmp 0x40516a
nop
cmp dword [rbp - 4], 0x2008
ja 0x40517c
cmp dword [rbp - 8], 0x2008
jbe 0x4051a0
mov edx, dword [rbp - 8]
mov eax, dword [rbp - 4]
mov r8d, edx
mov edx, eax
lea rcx, str.Preposterous_Pointers:__d___d
call fcn.004034a4
mov dword [rbp - 8], 0
mov eax, dword [rbp - 8]
mov dword [rbp - 4], eax
cmp word [rbp - 0xa], 0
jne 0x4051bd
lea rcx, str.too_many_output_retries
call fcn.004034a4
mov eax, 1
jmp 0x405316
cmp dword [rbp - 8], 0
je 0x405229
mov eax, dword [rbp - 8]
mov r8d, eax
mov rdx, r12
mov ecx, 1
call sub.msvcrt.dll__write
mov ebx, eax
mov ecx, 0
mov rax, qword [fcn.00407900]
call rax
mov rcx, rax
call sub.msvcrt.dll_fflush
test ebx, ebx
jle 0x405229
movzx eax, word [0x0040d0c4]
test ax, ax
je 0x40520e
mov r8d, ebx
mov rdx, r12
mov ecx, 1
call fcn.004048e1
movsxd rax, ebx
add r12, rax
mov eax, ebx
sub dword [rbp - 8], eax
mov eax, dword [0x0040d070]
mov edx, ebx
add eax, edx
mov dword [0x0040d070], eax
cmp dword [rbp - 4], 0
je 0x405289
mov eax, dword [0x0040d0bc]
test eax, eax
je 0x40524a
mov eax, dword [rbp - 4]
mov edx, eax
mov rcx, rsi
call fcn.0040374e
mov ebx, eax
jmp 0x40524d
mov ebx, dword [rbp - 4]
mov eax, dword [rbp + 0x30]
mov r9d, 0
mov r8d, ebx
mov rdx, rsi
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_send]
call rax
mov ebx, eax
test ebx, ebx
jle 0x405289
movsxd rax, ebx
add rsi, rax
mov eax, ebx
sub dword [rbp - 4], eax
mov eax, dword [0x0040d074]
mov edx, ebx
add eax, edx
mov dword [0x0040d074], eax
mov eax, dword [0x0040d0bc]
test eax, eax
je 0x4052b5
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 0x4052d1
cmp dword [rbp - 4], 0
jne 0x4052c1
cmp dword [rbp - 8], 0
je 0x4052d1
movzx eax, word [rbp - 0xa]
sub eax, 1
mov word [rbp - 0xa], ax
jmp 0x40516a
lea rax, [0x0040db80]
mov rdx, qword [rax]
mov eax, dword [rbp + 0x30]
mov rcx, rax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x404d8b
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, 0x70
pop rbx
pop rsi
pop rdi
pop r12
pop rbp
ret