Function at 0x1400065b0
Capabilities:
Allocate or change rwx memory

Disassembly:
push rdi
sub rsp, 0x90
mov dword [rsp + 0x48], 0
mov rax, qword [sym.imp.ntoskrnl.exe_PsInitialSystemProcess]
mov rax, qword [rax]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x60], 0
mov qword [rsp + 0x70], 0x1000
mov byte [rsp + 0x30], 0
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x68], 0
lea rax, [rsp + 0x80]
mov rdi, rax
xor eax, eax
mov ecx, 0x10
rep stosb byte [rdi], al
cmp dword [0x14003d60c], 0
jne 0x140006a99
lea rdx, [0x140010ef0]
lea rcx, [rsp + 0x80]
call qword [sym.imp.ntoskrnl.exe_RtlInitUnicodeString]
lea rcx, [rsp + 0x80]
call qword [sym.imp.ntoskrnl.exe_MmGetSystemRoutineAddress]
mov qword [rsp + 0x78], rax
cmp qword [rsp + 0x78], 0
jne 0x14000666f
movzx eax, byte [rsp + 0x30]
jmp 0x140006aa3
mov rax, qword [0x14003d590]
movzx eax, word [rax + 0x2a8]
xor edx, edx
mov ecx, 4
div rcx
mov rcx, qword [rsp + 0x40]
lea rax, [rcx + rax*4]
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0x58]
cmp qword [rsp + 0x38], rax
jbe 0x140006790
mov rax, qword [rsp + 0x38]
mov rax, qword [rax]
mov qword [rsp + 0x50], rax
mov rax, qword [sym.imp.ntoskrnl.exe_MmSystemRangeStart]
mov rax, qword [rax]
cmp qword [rsp + 0x50], rax
jbe 0x140006708
mov rax, qword [rsp + 0x50]
and rax, 7
test rax, rax
jne 0x140006708
mov rax, qword [rsp + 0x50]
sub rax, 0x30
mov edx, 0x38
mov rcx, rax
call fcn.140004380
movzx eax, al
test eax, eax
je 0x140006708
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ntoskrnl.exe_ObGetObjectType]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
je 0x140006774
mov rax, qword [rsp + 0x78]
mov rax, qword [rax]
cmp qword [rsp + 0x68], rax
jne 0x140006774
mov rax, qword [rsp + 0x38]
mov rax, qword [rax - 4]
cmp qword [rsp + 0x50], rax
jne 0x140006742
mov rax, qword [rsp + 0x38]
sub rax, 8
mov qword [rsp + 0x38], rax
jmp 0x14000669f
mov rax, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x38]
sub rcx, rax
mov rax, rcx
sub eax, 4
mov dword [0x14003d610], eax
mov eax, dword [0x14003d610]
sub rax, 4
mov dword [0x14003d60c], eax
mov byte [rsp + 0x30], 1
jmp 0x140006790
mov qword [rsp + 0x68], 0
mov rax, qword [rsp + 0x38]
sub rax, 4
mov qword [rsp + 0x38], rax
jmp 0x14000669f
movzx eax, byte [rsp + 0x30]
test eax, eax
jne 0x14000691e
mov rax, qword [0x14003d590]
movzx eax, word [rax + 0x2a8]
xor edx, edx
mov ecx, 4
div rcx
mov rcx, qword [rsp + 0x40]
lea rax, [rcx + rax*4]
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0x58]
cmp qword [rsp + 0x38], rax
jbe 0x14000691e
mov rax, qword [rsp + 0x38]
mov eax, dword [rax - 4]
and eax, 0x40000000
test eax, eax
je 0x14000690b
mov qword [rsp + 0x50], 0
mov rax, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x38]
sub rcx, rax
mov rax, rcx
mov dword [0x14003d610], eax
mov eax, dword [0x14003d610]
sub rax, 4
mov dword [0x14003d60c], eax
mov eax, dword [0x14003d60c]
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx + rax]
and eax, 0x100
test eax, eax
jne 0x140006861
mov qword [rsp + 0x50], 1
mov eax, dword [0x14003d60c]
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx + rax]
bts eax, 8
mov ecx, dword [0x14003d60c]
mov rdx, qword [rsp + 0x40]
mov dword [rdx + rcx], eax
mov dword [rsp + 0x28], 0x40
mov dword [rsp + 0x20], 0x1000
lea r9, [rsp + 0x70]
xor r8d, r8d
lea rdx, [rsp + 0x60]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwAllocateVirtualMemory]
mov dword [rsp + 0x48], eax
cmp qword [rsp + 0x50], 1
jne 0x1400068b7
mov eax, dword [0x14003d60c]
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx + rax]
btr eax, 8
mov ecx, dword [0x14003d60c]
mov rdx, qword [rsp + 0x40]
mov dword [rdx + rcx], eax
cmp dword [rsp + 0x48], 0
jl 0x1400068fa
mov r9d, 0x8000
lea r8, [rsp + 0x70]
lea rdx, [rsp + 0x60]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwFreeVirtualMemory]
mov qword [rsp + 0x60], 0
mov dword [0x14003d610], 0
mov dword [0x14003d60c], 0
jmp 0x14000690b
cmp dword [rsp + 0x48], 0xc0000604
jne 0x14000690b
mov byte [rsp + 0x30], 1
jmp 0x14000691e
mov rax, qword [rsp + 0x38]
sub rax, 4
mov qword [rsp + 0x38], rax
jmp 0x1400067cd
movzx eax, byte [rsp + 0x30]
test eax, eax
jne 0x140006a97
mov rax, qword [0x14003d590]
movzx eax, word [rax + 0x2a8]
xor edx, edx
mov ecx, 4
div rcx
mov rcx, qword [rsp + 0x40]
lea rax, [rcx + rax*4]
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0x58]
cmp qword [rsp + 0x38], rax
jbe 0x140006a97
mov qword [rsp + 0x50], 0
mov rax, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x38]
sub rcx, rax
mov rax, rcx
mov dword [0x14003d610], eax
mov eax, dword [0x14003d610]
sub rax, 4
mov dword [0x14003d60c], eax
mov eax, dword [0x14003d60c]
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx + rax]
and eax, 0x100
test eax, eax
jne 0x1400069da
mov qword [rsp + 0x50], 1
mov eax, dword [0x14003d60c]
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx + rax]
bts eax, 8
mov ecx, dword [0x14003d60c]
mov rdx, qword [rsp + 0x40]
mov dword [rdx + rcx], eax
mov dword [rsp + 0x28], 0x40
mov dword [rsp + 0x20], 0x1000
lea r9, [rsp + 0x70]
xor r8d, r8d
lea rdx, [rsp + 0x60]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwAllocateVirtualMemory]
mov dword [rsp + 0x48], eax
cmp qword [rsp + 0x50], 1
jne 0x140006a30
mov eax, dword [0x14003d60c]
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx + rax]
btr eax, 8
mov ecx, dword [0x14003d60c]
mov rdx, qword [rsp + 0x40]
mov dword [rdx + rcx], eax
cmp dword [rsp + 0x48], 0
jl 0x140006a73
mov r9d, 0x8000
lea r8, [rsp + 0x70]
lea rdx, [rsp + 0x60]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwFreeVirtualMemory]
mov qword [rsp + 0x60], 0
mov dword [0x14003d610], 0
mov dword [0x14003d60c], 0
jmp 0x140006a84
cmp dword [rsp + 0x48], 0xc0000604
jne 0x140006a84
mov byte [rsp + 0x30], 1
jmp 0x140006a97
mov rax, qword [rsp + 0x38]
sub rax, 4
mov qword [rsp + 0x38], rax
jmp 0x14000695b
jmp 0x140006a9e
mov byte [rsp + 0x30], 1
movzx eax, byte [rsp + 0x30]
add rsp, 0x90
pop rdi
ret