Function at 0x140001510
Capabilities:
Download and write a file
Get socket status
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Write file on windows

Disassembly:
push r15
mov eax, 0x2368
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.140004160
sub rsp, rax
movaps xmmword [rsp + 0x2350], xmm6
mov rsi, qword [sym.imp.WS2_32.dll_getpeername]
movsxd rbx, dword [rcx]
movsxd rdi, dword [rcx + 4]
lea rbp, [rsp + 0x88]
movq xmm0, rbx
mov rcx, rbx
mov dword [rsp + 0x88], 0x10
lea rdx, [rsp + 0xb0]
movq xmm1, rdi
mov r8, rbp
punpcklqdq xmm0, xmm1
movaps xmmword [rsp + 0x90], xmm0
call rsi
cmp eax, 0xffffffff
je 0x1400018a0
lea rdx, [rsp + 0xc0]
mov r8, rbp
mov rcx, rdi
call rsi
cmp eax, 0xffffffff
je 0x1400018a0
lea rax, [rsp + 0xb4]
mov rsi, qword [sym.imp.WS2_32.dll_htons]
movq xmm6, rbx
mov r12, rdi
movq xmm0, rax
movzx ecx, word [rsp + 0xb2]
lea rax, [rsp + 0xc4]
lea rbp, [rsp + 0x140]
movq xmm2, rax
punpcklqdq xmm0, xmm2
movaps xmmword [rsp + 0xa0], xmm0
call rsi
movzx ecx, word [rsp + 0xc2]
mov word [rsp + 0x8c], ax
call rsi
mov dword [rsp + 0x7c], 0
mov word [rsp + 0x8e], ax
xor eax, eax
cmp rbx, rdi
cmovne rax, rdi
setne sil
mov rdi, rbx
add dword [0x14000f030], 1
movzx esi, sil
add esi, 1
movq xmm3, rax
punpcklqdq xmm6, xmm3
mov dword [rsp + 0x78], esi
nop
mov eax, dword [rsp + 0x78]
xor r9d, r9d
xor r8d, r8d
mov rdx, rbp
movups xmmword [rsp + 0x148], xmm6
mov ecx, 0x40
mov qword [rsp + 0x20], 0
mov dword [rsp + 0x140], eax
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x140001990
lea r13, [rsp + 0x90]
xor ebx, ebx
mov r14, qword [r13 + rbx*8]
mov rdx, rbp
mov rcx, r14
call sym.__WSAFDIsSet
test eax, eax
jne 0x140001698
test rbx, rbx
jne 0x140001630
mov ebx, 1
jmp 0x140001672
lea rsi, [rsp + 0x350]
xor r9d, r9d
mov rcx, r14
mov r8d, 0x2000
mov rdx, rsi
call qword [sym.imp.WS2_32.dll_recv]
movsxd r14, eax
test r14d, r14d
jle 0x140001910
mov r10, rbx
xor r9d, r9d
mov r8d, r14d
xor r10, 1
mov rdx, rsi
mov rcx, qword [rsp + r10*8 + 0x90]
mov qword [rsp + 0x70], r10
call qword [sym.imp.WS2_32.dll_send]
test eax, eax
jle 0x140001910
mov rax, qword [rsp + rbx*8 + 0xa0]
lea r15, [rsp + 0xd0]
mov r10, qword [rsp + 0x70]
mov r8d, dword [0x14000f030]
add dword [rsp + 0x7c], r14d
movzx r9d, byte [rax]
mov rdx, qword [rsp + r10*8 + 0xa0]
mov dword [rsp + 0x68], r14d
movzx ecx, word [rsp + r10*2 + 0x8c]
mov dword [rsp + 0x60], ecx
movzx ecx, byte [rdx + 3]
mov dword [rsp + 0x58], ecx
movzx ecx, byte [rdx + 2]
mov dword [rsp + 0x50], ecx
movzx ecx, byte [rdx + 1]
mov dword [rsp + 0x48], ecx
movzx edx, byte [rdx]
mov rcx, r15
mov dword [rsp + 0x40], edx
movzx edx, word [rsp + rbx*2 + 0x8c]
mov dword [rsp + 0x38], edx
movzx edx, byte [rax + 3]
mov dword [rsp + 0x30], edx
movzx edx, byte [rax + 2]
mov dword [rsp + 0x28], edx
movzx eax, byte [rax + 1]
lea rdx, str._n____Send__Total__d_:__d._d._d._d:_d_____d._d._d._d:_d____d_Bytes_n
mov dword [rsp + 0x20], eax
call sym.sprintf
mov r9, qword [sym.__acrt_iob_func]
mov ecx, 1
mov qword [rsp + 0x70], r9
call r9
lea rdx, [0x14000b0ac]
mov r8, r15
mov rcx, rax
call sym.fprintf
mov r9, qword [rsp + 0x70]
mov ecx, 1
call r9
mov rcx, rax
call sym.fflush
mov rcx, qword [0x14000f048]
test rcx, rcx
je 0x1400017df
lea rdx, [0x14000b0ac]
mov r8, r15
call sym.fprintf
mov rcx, qword [0x14000f048]
call sym.fflush
mov rcx, qword [0x14000f038]
test rcx, rcx
je 0x14000181d
lea rdx, str._n_s_n
mov r8, r15
call sym.fprintf
mov rcx, rsi
movsxd r8, r14d
mov edx, 1
mov r9, qword [0x14000f038]
call sym.fwrite
mov rcx, qword [0x14000f038]
call sym.fflush
mov rcx, qword [0x14000f040]
test rcx, rcx
je 0x140001686
lea rdx, [0x14000b0b4]
mov r8, r15
xor r15d, r15d
call sym.fprintf
jmp 0x140001869
movzx r8d, byte [rsi + r15]
lea rdx, str._02X
add r15, 1
mov rcx, qword [0x14000f040]
call sym.fprintf
cmp r14, r15
je 0x140001888
test r15b, 0xf
jne 0x140001848
mov rcx, qword [0x14000f040]
lea rdx, [0x14000b0b8]
call sym.fprintf
jmp 0x140001848
mov rcx, qword [0x14000f040]
call sym.fflush
jmp 0x140001686
lea rsi, str._n____Get_Remote_Host_Failed_n
mov ecx, 1
call qword [sym.__acrt_iob_func]
mov rdx, rsi
mov rcx, rax
call sym.fprintf
mov rcx, qword [0x14000f048]
test rcx, rcx
je 0x1400018dd
mov rdx, rsi
call sym.fprintf
mov rcx, qword [0x14000f048]
call sym.fflush
mov rcx, rbx
mov rbx, qword [sym.imp.WS2_32.dll_closesocket]
call rbx
mov rcx, rdi
call rbx
nop
movaps xmm6, xmmword [rsp + 0x2350]
xor eax, eax
add rsp, 0x2368
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov ebp, dword [0x14000f030]
mov ecx, 1
mov rbx, rdi
mov rdi, r12
mov rsi, qword [sym.__acrt_iob_func]
call rsi
mov r15d, dword [rsp + 0x7c]
mov rcx, rax
mov r8d, ebp
lea rbp, str._n____Connection__Total__d__Cutdown__Total_:__d_Bytes_n_n
mov r9d, r15d
mov rdx, rbp
call sym.fprintf
mov ecx, 1
call rsi
mov rcx, rax
call sym.fflush
mov rcx, qword [0x14000f048]
test rcx, rcx
je 0x140001980
mov r8d, dword [0x14000f030]
mov r9d, r15d
mov rdx, rbp
call sym.fprintf
mov rcx, qword [0x14000f048]
call sym.fflush
sub dword [0x14000f030], 1
jmp 0x1400018dd
sub dword [0x14000f030], 1
mov rbx, rdi
mov rdi, r12
jmp 0x1400018dd