Function at 0x140038540
Capabilities:
Access pe header
Allocate or change rwx memory
Delete file
Execute shellcode via indirect call
Write file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x50]
sub rsp, 0x150
xor esi, esi
mov r12, r8
mov r14d, esi
mov r15d, esi
mov rbx, rdx
call qword [sym.imp.ntoskrnl.exe_PsGetProcessWow64Process]
lea r13d, [rsi + 0x58]
mov r8d, 0x656e6f4e
test rax, rax
lea ecx, [rsi + 1]
mov edx, r13d
mov rdi, rax
setne byte [rsp + 0x60]
call qword [sym.imp.ntoskrnl.exe_ExAllocatePoolWithTag]
mov r8d, r13d
xor edx, edx
mov rcx, rax
mov rsi, rax
call fcn.140009540
lea r13, [rsi + 0x30]
mov rdx, rbx
mov rcx, r13
call fcn.14003ad80
lea rdx, [rsi + 0x20]
mov rcx, r13
call fcn.14003af00
mov eax, dword [rbp + 0xb8]
lea rdx, [rsi + 0x20]
mov rcx, qword [rbp + 0xc0]
mov dword [rsi + 0x4c], eax
xor eax, eax
mov r8d, eax
test rdi, rdi
sete r8b
add rcx, 0x20
mov dword [rsi + 0x48], r8d
call fcn.1400391a0
mov rbx, rax
test rax, rax
je 0x140038668
mov rcx, r13
call qword [sym.imp.ntoskrnl.exe_RtlFreeUnicodeString]
mov edx, 0x656e6f4e
mov rcx, rsi
call qword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov rax, qword [rbp + 0xc8]
movups xmm0, xmmword [rbx]
movups xmmword [rax], xmm0
movups xmm1, xmmword [rbx + 0x10]
movups xmmword [rax + 0x10], xmm1
movups xmm0, xmmword [rbx + 0x20]
movups xmmword [rax + 0x20], xmm0
movups xmm1, xmmword [rbx + 0x30]
movups xmmword [rax + 0x30], xmm1
movups xmm0, xmmword [rbx + 0x40]
movups xmmword [rax + 0x40], xmm0
movsd xmm1, qword [rbx + 0x50]
movsd qword [rax + 0x50], xmm1
xor eax, eax
mov rbx, qword [rsp + 0x1a0]
add rsp, 0x150
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
xor edx, edx
mov qword [rsp + 0x20], r13
lea r9, [0x14003b720]
lea r8, [0x14003b740]
lea ecx, [rdx + 0x4d]
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
mov rbx, qword [rbp + 0x98]
lea r13, [rsi + 0x18]
test r12, r12
jne 0x14003884f
mov rdx, r13
mov rcx, rbx
call fcn.140038f20
xor r9d, r9d
mov r14d, eax
test eax, eax
jns 0x140038853
mov eax, dword ds:[rbp + 0xb8]
and eax, 0x8000
test r14d, r14d
js 0x140038ae0
test eax, eax
jne 0x1400388d8
lfence
mov rcx, qword [r13]
lea r8, [rsp + 0x64]
lea rdx, [rsp + 0x78]
mov dword [rsp + 0x64], r9d
mov qword [rsp + 0x78], r9
call fcn.140038dc0
xor r9d, r9d
mov r14, rax
test rax, rax
je 0x1400388d8
mov edi, dword [rsp + 0x64]
test edi, edi
je 0x1400388d8
test r12, r12
je 0x1400388bc
xorps xmm0, xmm0
mov qword [rsp + 0x70], r9
xorps xmm1, xmm1
mov dword [rbp + 0x14], r9d
mov ebx, 0x200
mov dword [rbp + 0x2c], r9d
mov edx, ebx
lea rcx, [rbp - 0x78]
movups xmmword [rbp - 0x30], xmm0
movups xmmword [rbp - 0x78], xmm1
movups xmmword [rbp - 0x20], xmm0
call fcn.14003acc0
lea rdx, [0x14003b760]
lea rcx, [rbp - 0x30]
call qword [sym.imp.ntoskrnl.exe_RtlInitUnicodeString]
xor r12d, r12d
mov dword [rbp + 0x10], 0x30
mov dword [rsp + 0x50], r12d
lea rax, [rbp - 0x30]
mov qword [rsp + 0x48], r12
lea r9, [rbp - 0x20]
mov dword [rsp + 0x40], 0x20
lea r8, [rbp + 0x10]
mov dword [rsp + 0x38], r12d
lea rcx, [rsp + 0x70]
mov dword [rsp + 0x30], 1
xorps xmm0, xmm0
mov dword [rsp + 0x28], 0x80
mov edx, 0x110002
mov qword [rsp + 0x20], r12
mov qword [rbp + 0x18], r12
mov dword [rbp + 0x28], ebx
mov qword [rbp + 0x20], rax
movdqu xmmword [rbp + 0x30], xmm0
call qword [sym.imp.ntoskrnl.exe_ZwCreateFile]
mov ebx, eax
test eax, eax
js 0x140038885
mov eax, dword ds:[rsp + 0x78]
xor r9d, r9d
mov rcx, qword [rsp + 0x70]
xor r8d, r8d
mov qword [rsp + 0x40], r12
xor edx, edx
mov qword [rsp + 0x38], r12
mov dword [rsp + 0x30], eax
lea rax, [rbp - 0x20]
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rax
call qword [sym.imp.ntoskrnl.exe_ZwWriteFile]
mov rcx, qword [rsp + 0x70]
mov ebx, eax
call qword [sym.imp.ntoskrnl.exe_ZwClose]
test ebx, ebx
js 0x140038885
lea r9, [0x14003b7b0]
movabs r8, 0xfffff78000000030
lea rdx, [0x14003b7e0]
lea rcx, [rbp - 0x78]
call fcn.140004b80
mov r9, qword [rbp + 0xc0]
lea rcx, [rbp - 0x78]
mov r8d, edi
xor edx, edx
call fcn.140039240
jmp 0x1400388a6
mov qword [r13], r12
lfence
mov rcx, qword [r13]
call qword [sym.imp.ntoskrnl.exe_RtlImageNtHeader]
xor r9d, r9d
mov r15, rax
test rax, rax
jne 0x1400386b3
mov r14d, 0xc000007b
jmp 0x140038ae0
lfence
xor edx, edx
mov dword [rsp + 0x20], ebx
lea r9, [0x14003b720]
lea r8, [0x14003b7f0]
lea ecx, [rdx + 0x4d]
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
lea rcx, [rbp + 0x10]
call qword [sym.imp.ntoskrnl.exe_ZwDeleteFile]
lea rcx, [rbp - 0x78]
call qword [sym.imp.ntoskrnl.exe_RtlFreeUnicodeString]
jmp 0x1400388d5
lfence
mov r9, qword [rbp + 0xc0]
mov dl, 1
mov r8d, dword [rsp + 0x64]
mov rcx, rbx
call fcn.140039240
xor r9d, r9d
mov r12d, dword ds:[rbp + 0xb8]
test r12b, 0x10
je 0x140038965
mov rdi, qword [rbp + 0x90]
xorps xmm0, xmm0
mov rcx, rdi
mov qword [rbp - 0x68], r9
mov dword [rbp - 0x50], r9d
mov word [rbp - 0x4a], r9w
movups xmmword [rbp - 0x40], xmm0
call qword [sym.imp.ntoskrnl.exe_PsGetProcessId]
lea r8, [rbp - 0x40]
mov word [rbp - 0x4c], 0x101
mov dword [rbp - 0x58], eax
lea rdx, [rbp - 0x68]
mov eax, dword [r15 + 0x50]
mov rcx, rdi
mov qword [rbp - 0x60], rax
mov dword [rbp - 0x54], 0x40
call fcn.14003a6e0
xor r9d, r9d
mov r14d, eax
test eax, eax
js 0x140038aee
mov rcx, qword ds:[rbp - 0x40]
lea rbx, [rsi + 0x10]
mov qword [rbx], rcx
mov rcx, qword [rbp - 0x38]
mov qword [rsi + 0x40], rcx
jmp 0x1400389fb
lfence
mov eax, 0x20b
cmp word [r15 + 0x18], ax
jne 0x14003897a
mov rax, qword [r15 + 0x30]
jmp 0x14003897e
mov eax, dword [r15 + 0x34]
lea rbx, [rsi + 0x10]
mov dword [rsp + 0x28], 0x40
mov qword [rbx], rax
lea rdi, [rsi + 0x40]
mov eax, dword [r15 + 0x50]
mov r9, rdi
xor r8d, r8d
mov qword [rdi], rax
mov rdx, rbx
mov dword [rsp + 0x20], 0x1000
or rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwAllocateVirtualMemory]
mov r14d, eax
xor eax, eax
test r14d, r14d
jns 0x1400389fb
lfence
mov qword [rbx], rax
mov r9, rdi
mov eax, dword [r15 + 0x50]
xor r8d, r8d
mov dword [rsp + 0x28], 0x40
mov rdx, rbx
or rcx, 0xffffffffffffffff
mov qword [rdi], rax
mov dword [rsp + 0x20], 0x1000
call qword [sym.imp.ntoskrnl.exe_ZwAllocateVirtualMemory]
xor r9d, r9d
mov r14d, eax
test eax, eax
js 0x140038ae7
lfence
mov r8d, dword [r15 + 0x54]
mov rdx, qword [r13]
mov rcx, qword [rbx]
call fcn.140009280
mov eax, 0x10b
lea r12, [r15 + 0x108]
cmp word [r15 + 0x18], ax
jne 0x140038a2e
lea r12, [r15 + 0xf8]
movzx eax, word ds:[r15 + 6]
lea rcx, [rax + rax*4]
lea rax, [r12 + rcx*8]
cmp r12, rax
jae 0x140038a88
lea rdi, [r12 + 0x10]
test dword [rdi + 0x14], 0xe0000000
je 0x140038a6e
mov eax, dword [rdi]
test eax, eax
je 0x140038a6e
mov edx, dword [rdi + 4]
mov r8d, eax
mov ecx, dword [rdi - 4]
add rdx, qword [r13]
add rcx, qword [rbx]
call fcn.140009280
movzx eax, word [r15 + 6]
add rdi, 0x28
lea rcx, [rax + rax*4]
lea rdx, [r12 + rcx*8]
lea rax, [rdi - 0x10]
cmp rax, rdx
jb 0x140038a4a
xor r9d, r9d
test r14d, r14d
js 0x140038ae0
lfence
mov rcx, qword [rbx]
mov r9d, 0xc000007b
xor edx, edx
lea r8d, [r9 - 0x63]
call fcn.14000437c
xor r9d, r9d
mov r14d, eax
test eax, eax
jns 0x140038ae0
lfence
mov dword [rsp + 0x28], eax
lea r9, [0x14003b720]
mov rax, qword [rbp + 0x98]
lea r8, [0x14003b570]
xor edx, edx
mov qword [rsp + 0x20], rax
lea ecx, [rdx + 0x4d]
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
xor r9d, r9d
mov r12d, dword [rbp + 0xb8]
mov rdi, qword [rbp + 0x90]
mov r8, qword ds:[rbp + 0xc0]
lea rdx, [r8 + 0x20]
mov rcx, qword [rdx]
cmp qword [rcx + 8], rdx
jne 0x140038db4
mov rax, qword [rdx + 8]
cmp qword [rax], rdx
jne 0x140038db4
mov qword [rsi], rcx
lea rbx, [rsi + 0x10]
mov qword [rsi + 8], rdx
mov qword [rcx + 8], rsi
mov qword [rdx], rsi
test r14d, r14d
js 0x140038c80
lfence
mov rcx, qword [rbx]
mov eax, 0x10b
cmp word [r15 + 0x18], ax
mov dword [rsp + 0x28], r12d
sete r9b
mov qword [rsp + 0x20], r8
xor edx, edx
mov r8, rdi
call fcn.140039aa0
xor r9d, r9d
mov r14d, eax
test eax, eax
js 0x140038c79
lfence
test r12b, 0x10
je 0x140038b87
mov rdx, qword [rbx]
xor r8d, r8d
mov rcx, rdi
call fcn.14003b110
mov r14d, eax
jmp 0x140038c63
mov eax, dword [r15 + 0x54]
lea r8, [rsp + 0x68]
mov qword [rsp + 0x20], r9
mov rdx, rbx
mov r9d, 2
mov qword [rsp + 0x68], rax
or rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwProtectVirtualMemory]
mov r14d, eax
lea r12, [r15 + 0x108]
mov eax, 0x10b
cmp word [r15 + 0x18], ax
jne 0x140038bce
lea r12, [r15 + 0xf8]
movzx eax, word ds:[r15 + 6]
lea rcx, [rax + rax*4]
lea rax, [r12 + rcx*8]
cmp r12, rax
jae 0x140038c5c
lea rdi, [r12 + 0xc]
mov ecx, dword [rdi + 0x18]
xor edx, edx
call fcn.1400382a0
mov ecx, dword [rdi]
lea r8, [rsp + 0x68]
add rcx, qword [rbx]
lea rdx, [rbp - 0x80]
mov qword [rbp - 0x80], rcx
mov ecx, dword [rdi - 4]
mov qword [rsp + 0x68], rcx
or rcx, 0xffffffffffffffff
cmp eax, 1
je 0x140038c2f
and qword [rsp + 0x20], 0
mov r9d, eax
call qword [sym.imp.ntoskrnl.exe_ZwProtectVirtualMemory]
or r14d, eax
jmp 0x140038c3b
mov r9d, 0x4000
call qword [sym.imp.ntoskrnl.exe_ZwFreeVirtualMemory]
movzx eax, word [r15 + 6]
add rdi, 0x28
lea rcx, [rax + rax*4]
lea rdx, [r12 + rcx*8]
lea rax, [rdi - 0xc]
cmp rax, rdx
jb 0x140038bee
mov rdi, qword [rbp + 0x90]
mov r12d, dword [rbp + 0xb8]
xor r9d, r9d
test r14d, r14d
js 0x140038c79
lfence
mov rcx, qword [rbx]
call fcn.140038300
xor r9d, r9d
mov r8, qword [rbp + 0xc0]
bt r12d, 0xc
jb 0x140038ca5
test r14d, r14d
js 0x140038ca5
cmp byte [rsp + 0x60], r9b
jne 0x140038ca5
lfence
mov rdx, qword [rbx]
mov rcx, r8
call fcn.1400383c0
mov rcx, qword [r13]
xor r15d, r15d
test rcx, rcx
je 0x140038cc0
mov edx, 0x656e6f4e
call qword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov qword [r13], r15
test r14d, r14d
js 0x140038d0a
mov rax, qword [rbp + 0xc8]
test rax, rax
je 0x140038dac
movups xmm0, xmmword [rsi]
movups xmmword [rax], xmm0
movups xmm1, xmmword [rsi + 0x10]
movups xmmword [rax + 0x10], xmm1
movups xmm0, xmmword [rsi + 0x20]
movups xmmword [rax + 0x20], xmm0
movups xmm1, xmmword [rsi + 0x30]
movups xmmword [rax + 0x30], xmm1
movups xmm0, xmmword [rsi + 0x40]
movups xmmword [rax + 0x40], xmm0
movsd xmm1, qword [rsi + 0x50]
movsd qword [rax + 0x50], xmm1
jmp 0x140038dac
lfence
mov rax, qword [rsi]
cmp qword [rax + 8], rsi
jne 0x140038db4
mov rcx, qword ds:[rsi + 8]
cmp qword [rcx], rsi
jne 0x140038db4
lfence
mov qword [rcx], rax
mov qword [rax + 8], rcx
cmp qword [rbx], r15
je 0x140038d94
lfence
test r12b, 0x10
je 0x140038d79
xorps xmm0, xmm0
mov rcx, rdi
movups xmmword [rbp - 0x10], xmm0
movups xmmword [rbp], xmm0
movups xmmword [rbp + 0x40], xmm0
call qword [sym.imp.ntoskrnl.exe_PsGetProcessId]
lea r8, [rbp + 0x40]
mov word [rbp + 0xc], 0x100
lea rdx, [rbp - 0x10]
mov dword [rbp], eax
mov rcx, rdi
call fcn.14003a6e0
jmp 0x140038d94
mov r9d, 0x8000
mov qword [rbp - 0x48], r15
lea r8, [rbp - 0x48]
mov rdx, rbx
or rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwFreeVirtualMemory]
lea rcx, [rsi + 0x30]
call qword [sym.imp.ntoskrnl.exe_RtlFreeUnicodeString]
mov edx, 0x656e6f4e
mov rcx, rsi
call qword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov eax, r14d
jmp 0x14003864d
mov ecx, 3
int 0x29
int3