Function at 0x401878
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Query environment variable
Read file via mapping

Disassembly:
push rbp
sub rsp, 0x1c0
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x150], rcx
mov qword [rbp + 0x120], 0
mov qword [rbp + 0x138], 0
mov qword [rbp + 0x130], 0
mov qword [rbp + 0xd0], 0
mov qword [rbp + 0x118], 0
mov qword [rbp + 0x110], 0
lea rax, [rbp - 0x40]
mov r8d, 0x104
mov rdx, rax
lea rcx, str._SystemRoot__system32NTDLL.dll
mov rax, qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
call rax
lea rax, [rbp - 0x40]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 3
mov r9d, 0
mov r8d, 1
mov edx, 0x80000000
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbp + 0x120], rax
cmp qword [rbp + 0x120], 0xffffffffffffffff
je 0x401be2
mov rax, qword [rbp + 0x120]
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
mov r9d, 0
mov r8d, 2
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileMappingA]
call rax
mov qword [rbp + 0x138], rax
cmp qword [rbp + 0x138], 0
je 0x401be5
mov rax, qword [rbp + 0x138]
mov qword [rsp + 0x20], 0
mov r9d, 0
mov r8d, 0
mov edx, 4
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_MapViewOfFile]
call rax
mov qword [rbp + 0x130], rax
cmp qword [rbp + 0x130], 0
je 0x401be8
mov rax, qword [rbp + 0x130]
mov rdx, qword [rbp + 0x150]
mov rcx, rax
call sym.GetProcAddress2_unsigned_char__char_const_
mov qword [rbp + 0x108], rax
cmp qword [rbp + 0x108], 0
je 0x401beb
mov rax, qword [rbp + 0x130]
mov qword [rbp + 0x100], rax
mov rax, qword [rbp + 0x100]
mov eax, dword [rax + 0x3c]
cdqe
mov rdx, qword [rbp + 0x130]
add rax, rdx
mov qword [rbp + 0xf8], rax
mov rax, qword [rbp + 0xf8]
add rax, 0x88
mov qword [rbp + 0xf0], rax
mov rax, qword [rbp + 0xf0]
add rax, 0x18
mov eax, dword [rax]
mov dword [rbp + 0xec], eax
cmp dword [rbp + 0xec], 0
je 0x401bee
mov edx, dword [rbp + 0xec]
mov rax, qword [rbp + 0xf8]
mov rcx, rax
call sym.rva2ofs__IMAGE_NT_HEADERS64__unsigned_long_
mov qword [rbp + 0xe0], rax
cmp qword [rbp + 0xe0], 0xffffffffffffffff
je 0x401bf1
mov rdx, qword [rbp + 0x130]
mov rax, qword [rbp + 0xe0]
add rax, rdx
mov qword [rbp + 0xd8], rax
mov dword [rbp + 0x12c], 0
mov edx, dword [rbp + 0x12c]
mov rax, rdx
add rax, rax
add rax, rdx
shl rax, 2
mov rdx, rax
mov rax, qword [rbp + 0xd8]
add rax, rdx
mov eax, dword [rax]
test eax, eax
je 0x401bf4
mov edx, dword [rbp + 0x12c]
mov rax, rdx
add rax, rax
add rax, rdx
shl rax, 2
mov rdx, rax
mov rax, qword [rbp + 0xd8]
add rax, rdx
mov edx, dword [rax]
mov rax, qword [rbp + 0xf8]
mov rcx, rax
call sym.rva2ofs__IMAGE_NT_HEADERS64__unsigned_long_
mov rdx, rax
mov rax, qword [rbp + 0x130]
add rax, rdx
mov qword [rbp + 0x118], rax
mov rax, qword [rbp + 0x118]
cmp rax, qword [rbp + 0x108]
jne 0x401bd6
mov edx, dword [rbp + 0x12c]
mov rax, rdx
add rax, rax
add rax, rdx
shl rax, 2
mov rdx, rax
mov rax, qword [rbp + 0xd8]
add rax, rdx
mov edx, dword [rax + 4]
mov rax, qword [rbp + 0xf8]
mov rcx, rax
call sym.rva2ofs__IMAGE_NT_HEADERS64__unsigned_long_
mov rdx, rax
mov rax, qword [rbp + 0x130]
add rax, rdx
mov qword [rbp + 0x110], rax
mov rax, qword [rbp + 0x110]
sub rax, qword [rbp + 0x118]
mov qword [rbp + 0xc8], rax
mov rax, qword [rbp + 0xc8]
mov r9d, 0x40
mov r8d, 0x3000
mov rdx, rax
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_VirtualAlloc]
call rax
mov qword [rbp + 0xd0], rax
mov rax, qword [rbp + 0xd0]
test rax, rax
je 0x401bf7
mov rcx, qword [rbp + 0xc8]
mov rdx, qword [rbp + 0x118]
mov rax, qword [rbp + 0xd0]
mov r8, rcx
mov rcx, rax
call sym.memcpy
jmp 0x401bf7
add dword [rbp + 0x12c], 1
jmp 0x401a9f
nop
jmp 0x401bf8
nop
jmp 0x401bf8
nop
jmp 0x401bf8
nop
jmp 0x401bf8
nop
jmp 0x401bf8
nop
jmp 0x401bf8
nop
jmp 0x401bf8
nop
cmp qword [rbp + 0x130], 0
je 0x401c15
mov rax, qword [rbp + 0x130]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
call rax
cmp qword [rbp + 0x138], 0
je 0x401c32
mov rax, qword [rbp + 0x138]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
cmp qword [rbp + 0x120], 0
je 0x401c4f
mov rax, qword [rbp + 0x120]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov rax, qword [rbp + 0xd0]
add rsp, 0x1c0
pop rbp
ret