Function at 0x140004803
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 rdi
push rsi
push rbx
sub rsp, 0x78
lea rbp, [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 0x140004852
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 0x14000487c
mov edx, 0x8000
mov ecx, 0
mov rax, qword [sym.imp.msvcrt.dll__setmode]
call rax
mov rax, qword [0x1400121d8]
mov eax, dword [rax]
cmp eax, 0x3f
ja 0x1400048a9
mov r8, qword [0x1400121d8]
mov rax, qword [0x1400121d8]
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 [0x14001218c]
test eax, eax
je 0x140004984
mov eax, dword [0x14001218c]
mov dword [rbp - 4], eax
mov rsi, qword [0x1400121c8]
mov word [rbp - 0xc], 1
movzx eax, word [0x14000d030]
test ax, ax
je 0x140004901
mov dword [0x14001218c], 0
jmp 0x140004984
mov dword [rbp - 0x10], 0
jmp 0x14000496c
mov rdx, qword [0x1400121d8]
mov eax, dword [rbp - 0x10]
mov rax, qword [rdx + rax*8 + 8]
test rax, rax
jne 0x140004968
jmp 0x140004947
mov rax, qword [0x1400121d8]
mov edx, dword [rbp - 0x10]
lea ecx, [rdx + 1]
mov rdx, qword [0x1400121d8]
mov ecx, ecx
mov rcx, qword [rax + rcx*8 + 8]
mov eax, dword [rbp - 0x10]
mov qword [rdx + rax*8 + 8], rcx
add dword [rbp - 0x10], 1
mov rax, qword [0x1400121d8]
mov eax, dword [rax]
sub eax, 1
cmp dword [rbp - 0x10], eax
jb 0x140004920
mov rax, qword [0x1400121d8]
mov edx, dword [rax]
sub edx, 1
mov dword [rax], edx
jmp 0x14000497a
add dword [rbp - 0x10], 1
mov rax, qword [0x1400121d8]
mov eax, dword [rax]
cmp dword [rbp - 0x10], eax
jb 0x14000490a
mov ecx, 0
call sym.close
mov eax, dword [0x140012208]
test eax, eax
je 0x14000499f
mov eax, dword [0x140012208]
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.WS2_32.dll_WSASetLastError]
call rax
jmp 0x140004e8f
mov word [rbp - 0xa], 0x2008
cmp word [rbp - 0xc], 0
je 0x1400049d9
mov word [rbp - 0xc], 0
jmp 0x140004d22
mov rax, qword [0x1400121d8]
mov rdx, qword [0x1400121e0]
mov rcx, rdx
mov edx, 0x208
mov r8, rdx
mov rdx, rax
call sym.memcpy
mov rax, qword [0x140012198]
test rax, rax
je 0x140004a1a
mov rdx, qword [0x140012198]
mov rax, qword [0x1400121a0]
mov rdx, qword [rdx]
mov qword [rax], rdx
mov rax, qword [0x1400121e0]
lea rdx, [rbp - 0x28]
mov qword [rsp + 0x20], rdx
mov r9d, 0
mov r8d, 0
mov rdx, rax
mov ecx, 0x10
mov rax, qword [sym.imp.WS2_32.dll_select]
call rax
mov ebx, eax
test ebx, ebx
jns 0x140004aa5
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
cmp eax, 0x2714
je 0x140004aa5
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov dword [rbp - 0x20], eax
lea rax, str.select_fuxored
mov rcx, rax
call sym.holler
mov eax, dword [rbp + 0x30]
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_shutdown]
call rax
mov eax, dword [rbp + 0x30]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov eax, 1
jmp 0x140004ed1
test ebx, ebx
jne 0x140004b42
lea rax, [rbp - 0x38]
mov rcx, rax
call sub.msvcrt.dll__time64
mov eax, dword [0x140012218]
test eax, eax
je 0x140004b42
mov rdx, qword [rbp - 0x38]
mov rax, qword [rbp - 0x30]
sub rdx, rax
mov rax, qword [0x140012198]
mov eax, dword [rax]
cdqe
cmp rdx, rax
jle 0x140004b42
movzx eax, word [0x140012216]
cmp ax, 1
jbe 0x140004afa
lea rax, str.net_timeout
mov rcx, rax
call sym.holler
mov eax, dword [rbp + 0x30]
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_shutdown]
call rax
mov eax, dword [rbp + 0x30]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [0x1400121d8]
mov dword [rax], 0
mov ecx, 0
mov rax, qword [sym.imp.WS2_32.dll_WSASetLastError]
call rax
mov eax, 0
jmp 0x140004ed1
mov rdx, qword [0x1400121e0]
mov eax, dword [rbp + 0x30]
mov rcx, rax
call sym.__WSAFDIsSet
test eax, eax
je 0x140004c23
lea rax, [rbp - 0x30]
mov rcx, rax
call sub.msvcrt.dll__time64
mov rdx, qword [0x1400121d0]
mov eax, dword [rbp + 0x30]
mov r9d, 0
mov r8d, 0x2000
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_recv]
call rax
mov ebx, eax
test ebx, ebx
jg 0x140004c19
mov dword [rbp - 0x14], 0
jmp 0x140004c02
mov rdx, qword [0x1400121d8]
mov eax, dword [rbp - 0x14]
mov rdx, qword [rdx + rax*8 + 8]
mov eax, dword [rbp + 0x30]
cmp rdx, rax
jne 0x140004bfe
jmp 0x140004bdd
mov rax, qword [0x1400121d8]
mov edx, dword [rbp - 0x14]
lea ecx, [rdx + 1]
mov rdx, qword [0x1400121d8]
mov ecx, ecx
mov rcx, qword [rax + rcx*8 + 8]
mov eax, dword [rbp - 0x14]
mov qword [rdx + rax*8 + 8], rcx
add dword [rbp - 0x14], 1
mov rax, qword [0x1400121d8]
mov eax, dword [rax]
sub eax, 1
cmp dword [rbp - 0x14], eax
jb 0x140004bb6
mov rax, qword [0x1400121d8]
mov edx, dword [rax]
sub edx, 1
mov dword [rax], edx
jmp 0x140004c10
add dword [rbp - 0x14], 1
mov rax, qword [0x1400121d8]
mov eax, dword [rax]
cmp dword [rbp - 0x14], eax
jb 0x140004b9d
mov dword [rbp - 4], 0
jmp 0x140004c23
mov dword [rbp - 8], ebx
mov rdi, qword [0x1400121d0]
cmp dword [rbp - 4], 0
jne 0x140004d1e
cmp dword [rbp - 0x18], 0
je 0x140004cc8
call sym.kbhit
test eax, eax
je 0x140004d22
mov rax, qword [0x1400121c8]
mov rcx, rax
call sym.gets
movzx eax, word [0x14001221e]
test ax, ax
je 0x140004c76
mov rbx, qword [0x1400121c8]
mov rcx, rbx
call sym.strlen
add rax, rbx
mov word [rax], 0xd
mov rbx, qword [0x1400121c8]
mov rcx, rbx
call sym.strlen
add rax, rbx
mov word [rax], 0xa
mov rax, qword [0x1400121c8]
mov rcx, rax
call sym.strlen
mov ebx, eax
mov dword [rbp - 4], ebx
mov rsi, qword [0x1400121c8]
movzx eax, word [0x14000d030]
test ax, ax
jne 0x140004d22
mov eax, ebx
mov dword [0x14001218c], eax
mov ecx, 0
call sym.close
jmp 0x140004d22
mov rax, qword [0x1400121c8]
mov r8d, 0x2000
mov rdx, rax
mov ecx, 0
call sym.read
mov ebx, eax
test ebx, ebx
jg 0x140004cf4
mov ecx, 0
call sym.close
jmp 0x140004d22
mov dword [rbp - 4], ebx
mov rsi, qword [0x1400121c8]
movzx eax, word [0x14000d030]
test ax, ax
jne 0x140004d21
mov eax, ebx
mov dword [0x14001218c], eax
mov ecx, 0
call sym.close
jmp 0x140004d22
nop
jmp 0x140004d22
nop
cmp dword [rbp - 4], 0x2008
ja 0x140004d34
cmp dword [rbp - 8], 0x2008
jbe 0x140004d5b
mov edx, dword [rbp - 8]
mov eax, dword [rbp - 4]
mov r8d, edx
mov edx, eax
lea rax, str.Preposterous_Pointers:__d___d
mov rcx, rax
call sym.holler
mov dword [rbp - 8], 0
mov eax, dword [rbp - 8]
mov dword [rbp - 4], eax
cmp word [rbp - 0xa], 0
jne 0x140004d7b
lea rax, str.too_many_output_retries
mov rcx, rax
call sym.holler
mov eax, 1
jmp 0x140004ed1
cmp dword [rbp - 8], 0
je 0x140004de7
mov eax, dword [rbp - 8]
mov r8d, eax
mov rdx, rdi
mov ecx, 1
call sym.write
mov ebx, eax
mov ecx, 0
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
call sym.fflush
test ebx, ebx
jle 0x140004de7
movzx eax, word [0x140012210]
test ax, ax
je 0x140004dcc
mov r8d, ebx
mov rdx, rdi
mov ecx, 1
call sym.oprint
movsxd rax, ebx
add rdi, rax
mov eax, ebx
sub dword [rbp - 8], eax
mov eax, dword [0x140012190]
mov edx, ebx
add eax, edx
mov dword [0x140012190], eax
cmp dword [rbp - 4], 0
je 0x140004e47
mov eax, dword [0x140012208]
test eax, eax
je 0x140004e08
mov eax, dword [rbp - 4]
mov edx, eax
mov rcx, rsi
call sym.findline
mov ebx, eax
jmp 0x140004e0b
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.WS2_32.dll_send]
call rax
mov ebx, eax
test ebx, ebx
jle 0x140004e47
movsxd rax, ebx
add rsi, rax
mov eax, ebx
sub dword [rbp - 4], eax
mov eax, dword [0x140012194]
mov edx, ebx
add eax, edx
mov dword [0x140012194], eax
mov eax, dword [0x140012208]
test eax, eax
je 0x140004e73
mov eax, dword [0x140012208]
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 0x140004e8f
cmp dword [rbp - 4], 0
jne 0x140004e7f
cmp dword [rbp - 8], 0
je 0x140004e8f
movzx eax, word [rbp - 0xa]
sub eax, 1
mov word [rbp - 0xa], ax
jmp 0x140004d22
mov rdx, qword [0x1400121d8]
mov eax, dword [rbp + 0x30]
mov rcx, rax
call sym.__WSAFDIsSet
test eax, eax
jne 0x1400049c1
mov eax, dword [rbp + 0x30]
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_shutdown]
call rax
mov eax, dword [rbp + 0x30]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov eax, 0
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
ret