Function at 0x1004010f0
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, 0x2238
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.100402ce0
sub rsp, rax
mov r12d, dword [rcx]
mov eax, dword [rcx + 4]
mov ecx, r12d
lea rbx, [rsp + 0x80]
lea rdx, [rsp + 0xa0]
mov dword [rsp + 0x7c], eax
mov r8, rbx
mov dword [rsp + 0x88], r12d
mov dword [rsp + 0x8c], eax
mov dword [rsp + 0x80], 0x10
call sym.getpeername
cmp eax, 0xffffffff
je 0x1004014f8
mov ecx, dword [rsp + 0x7c]
lea rdx, [rsp + 0xb0]
mov r8, rbx
call sym.getpeername
cmp eax, 0xffffffff
je 0x1004014f8
lea rax, [rsp + 0xa4]
lea rdx, [rsp + 0x130]
mov ecx, 0x10
mov dword [rsp + 0x78], 0
mov rdi, rdx
mov qword [rsp + 0x90], rax
lea rax, [rsp + 0xb4]
mov edx, 1
mov qword [rsp + 0x98], rax
movzx eax, word [rsp + 0xa2]
lea r15, [rsp + 0x1b0]
xchg ah, al
mov word [rsp + 0x84], ax
movzx eax, word [rsp + 0xb2]
xchg ah, al
mov word [rsp + 0x86], ax
xor eax, eax
test r12d, r12d
rep stosq qword [rdi], rax
lea eax, [r12 + 0x3f]
mov rdi, rdx
mov ecx, r12d
cmovns eax, r12d
shl rdi, cl
mov dword [rsp + 0x74], r12d
sar eax, 6
cdqe
mov qword [rsp + rax*8 + 0x130], rdi
mov edi, dword [rsp + 0x7c]
test edi, edi
lea eax, [rdi + 0x3f]
mov ecx, edi
cmovns eax, edi
shl rdx, cl
add dword [section..bss], 1
sar eax, 6
cdqe
or qword [rsp + rax*8 + 0x130], rdx
nop dword [rax + rax]
movdqa xmm0, xmmword [rsp + 0x130]
xor r9d, r9d
movdqa xmm1, xmmword [rsp + 0x140]
mov qword [rsp + 0x20], 0
movdqa xmm2, xmmword [rsp + 0x150]
xor r8d, r8d
movdqa xmm3, xmmword [rsp + 0x160]
mov rdx, r15
movdqa xmm4, xmmword [rsp + 0x170]
movaps xmmword [rsp + 0x1b0], xmm0
movdqa xmm5, xmmword [rsp + 0x180]
mov ecx, 0x400
movdqa xmm0, xmmword [rsp + 0x190]
movaps xmmword [rsp + 0x1c0], xmm1
movdqa xmm1, xmmword [rsp + 0x1a0]
movaps xmmword [rsp + 0x1d0], xmm2
movaps xmmword [rsp + 0x1e0], xmm3
movaps xmmword [rsp + 0x1f0], xmm4
movaps xmmword [rsp + 0x200], xmm5
movaps xmmword [rsp + 0x210], xmm0
movaps xmmword [rsp + 0x220], xmm1
call sym.select
test eax, eax
jle 0x1004015e8
mov ecx, dword [rsp + 0x74]
xor ebx, ebx
lea rbp, str._02X
test ecx, ecx
lea eax, [rcx + 0x3f]
mov esi, ebx
cmovns eax, ecx
sar eax, 6
cdqe
mov rax, qword [rsp + rax*8 + 0x1b0]
bt rax, rcx
jb 0x100401320
cmp rbx, 1
je 0x100401230
mov ecx, dword [rsp + 0x8c]
mov ebx, 1
jmp 0x1004012e9
lea rdi, [rsp + 0x230]
xor r9d, r9d
mov r8d, 0x2000
mov rdx, rdi
call sym.recv
mov r12, rax
test eax, eax
jle 0x100401570
xor esi, 1
movsxd r13, eax
xor r9d, r9d
mov rdx, rdi
movsxd rsi, esi
mov r8, r13
mov ecx, dword [rsp + rsi*4 + 0x88]
call sym.send
test rax, rax
jle 0x100401570
mov rax, qword [rsp + rbx*8 + 0x90]
mov rdx, qword [rsp + rsi*8 + 0x90]
lea r14, [rsp + 0xc0]
mov r8d, dword [section..bss]
add dword [rsp + 0x78], r12d
movzx r9d, byte [rax]
mov dword [rsp + 0x68], r12d
movzx ecx, word [rsp + rsi*2 + 0x84]
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, r14
mov dword [rsp + 0x40], edx
movzx edx, word [rsp + rbx*2 + 0x84]
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
call sym.__getreent
mov rcx, r14
mov rdx, qword [rax + 0x10]
call sym.fputs
call sym.__getreent
mov rcx, qword [rax + 0x10]
call sym.fflush
mov rdx, qword [0x100409018]
test rdx, rdx
je 0x100401435
mov rcx, r14
call sym.fputs
mov rcx, qword [0x100409018]
call sym.fflush
mov rcx, qword [0x100409008]
test rcx, rcx
je 0x100401473
mov r8, r14
lea rdx, str._n_s_n
call sym.fprintf
mov rcx, rdi
mov r8, r13
mov edx, 1
mov r9, qword [0x100409008]
call sym.fwrite
mov rcx, qword [0x100409008]
call sym.fflush
mov rcx, qword [0x100409010]
test rcx, rcx
je 0x100401306
mov r8, r14
lea rdx, [0x1004050b1]
sub r12d, 1
xor esi, esi
call sym.fprintf
jmp 0x1004014c0
movzx r8d, byte [rdi + rsi]
mov rcx, qword [0x100409010]
mov rdx, rbp
call sym.fprintf
lea rax, [rsi + 1]
cmp r12, rsi
je 0x1004014e0
mov rsi, rax
test sil, 0xf
jne 0x1004014a0
mov rdx, qword [0x100409010]
mov ecx, 0xa
call sym.fputc
jmp 0x1004014a0
mov rcx, qword [0x100409010]
call sym.fflush
jmp 0x100401306
call sym.__getreent
mov r8d, 0x1c
mov edx, 1
lea r13, str._n____Get_Remote_Host_Failed_n
mov r9, qword [rax + 0x10]
mov rcx, r13
call sym.fwrite
mov r9, qword [0x100409018]
test r9, r9
je 0x100401546
mov rcx, r13
mov r8d, 0x1c
mov edx, 1
call sym.fwrite
mov rcx, qword [0x100409018]
call sym.fflush
mov ecx, r12d
call sym.close
mov ecx, dword [rsp + 0x7c]
call sym.close
xor eax, eax
add rsp, 0x2238
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov ebx, dword [section..bss]
mov r12d, dword [rsp + 0x74]
lea r13, str._n____Connection__Total__d__Cutdown__Total_:__d_Bytes_n_n
call sym.__getreent
mov edi, dword [rsp + 0x78]
mov rdx, r13
mov rcx, qword [rax + 0x10]
mov r8d, ebx
mov r9d, edi
call sym.fprintf
call sym.__getreent
mov rcx, qword [rax + 0x10]
call sym.fflush
mov rcx, qword [0x100409018]
test rcx, rcx
je 0x1004015d5
mov r8d, dword [section..bss]
mov r9d, edi
mov rdx, r13
call sym.fprintf
mov rcx, qword [0x100409018]
call sym.fflush
sub dword [section..bss], 1
jmp 0x100401546
sub dword [section..bss], 1
mov r12d, dword [rsp + 0x74]
jmp 0x100401546