Function at 0x140040690
Capabilities:
Access pe header

Disassembly:
mov byte [rsp + 0x10], dl
mov qword [rsp + 8], rcx
push rsi
push rdi
sub rsp, 0xc8
mov rax, qword [0x14002a380]
xor rax, rsp
mov qword [rsp + 0xb0], rax
mov rax, qword [rsp + 0xe0]
mov rax, qword [rax + 0x20]
mov qword [rsp + 0x68], rax
jmp 0x1400406d4
mov rax, qword [rsp + 0x68]
mov rax, qword [rax]
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0xe0]
add rax, 0x20
cmp qword [rsp + 0x68], rax
je 0x140040af9
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x40]
movzx eax, byte [rax + 0x51]
test eax, eax
je 0x140040704
jmp 0x1400406c7
lea rax, [rsp + 0x80]
mov rcx, qword [rsp + 0x40]
mov rdi, rax
lea rsi, [rcx + 0x20]
mov ecx, 0x10
rep movsb byte [rdi], byte [rsi]
lea rax, [rsp + 0x80]
mov qword [rsp + 0x20], rax
lea r9, [0x140047720]
lea r8, [0x140047740]
xor edx, edx
mov ecx, 0x4d
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
mov rax, qword [rsp + 0x40]
mov rcx, qword [rax + 0x10]
call qword [sym.imp.ntoskrnl.exe_RtlImageNtHeader]
mov qword [rsp + 0x48], rax
movzx eax, byte [rsp + 0xe8]
test eax, eax
jne 0x14004077d
mov rax, qword [rsp + 0x40]
mov rdx, qword [rax + 0x10]
mov rcx, qword [rsp + 0xe0]
call fcn.140018b80
mov dword [rsp + 0x60], 0
mov rax, qword [rsp + 0x48]
movzx eax, word [rax + 0x18]
cmp eax, 0x20b
jne 0x1400407a3
mov rax, qword [rsp + 0x48]
mov eax, dword [rax + 0x28]
mov dword [rsp + 0x58], eax
jmp 0x1400407af
mov rax, qword [rsp + 0x48]
mov eax, dword [rax + 0x28]
mov dword [rsp + 0x58], eax
cmp dword [rsp + 0x58], 0
je 0x140040830
mov rax, qword [rsp + 0x48]
movzx eax, word [rax + 0x18]
cmp eax, 0x20b
jne 0x1400407d4
mov rax, qword [rsp + 0x48]
mov eax, dword [rax + 0x28]
mov dword [rsp + 0x5c], eax
jmp 0x1400407e0
mov rax, qword [rsp + 0x48]
mov eax, dword [rax + 0x28]
mov dword [rsp + 0x5c], eax
mov eax, dword [rsp + 0x5c]
mov rcx, qword [rsp + 0x40]
add rax, qword [rcx + 0x10]
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 1
mov rax, qword [rsp + 0x40]
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x20], rax
mov r9d, 3
mov r8, qword [rsp + 0x78]
mov rdx, qword [rsp + 0xe0]
xor ecx, ecx
call fcn.140040b20
mov dword [rsp + 0x60], eax
cmp dword [rsp + 0x60], 0
je 0x140040871
call qword [sym.imp.ntoskrnl.exe_IoGetCurrentProcess]
mov rcx, rax
call fcn.140017eb0
movzx eax, al
test eax, eax
je 0x140040871
lea r9, [0x140047720]
lea r8, [0x140047770]
xor edx, edx
mov ecx, 0x4d
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
mov eax, 0xc000010a
jmp 0x140040afb
mov rax, qword [rsp + 0x48]
add rax, 0x108
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x48]
movzx eax, word [rax + 0x18]
cmp eax, 0x10b
jne 0x1400408a1
mov rax, qword [rsp + 0x48]
add rax, 0xf8
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x50], rax
jmp 0x1400408bb
mov rax, qword [rsp + 0x50]
add rax, 0x28
mov qword [rsp + 0x50], rax
mov rax, qword [rsp + 0x48]
movzx eax, word [rax + 6]
imul rax, rax, 0x28
mov rcx, qword [rsp + 0x70]
add rcx, rax
mov rax, rcx
cmp qword [rsp + 0x50], rax
jae 0x1400409da
mov rax, qword [rsp + 0x50]
mov eax, dword [rax + 0x24]
and eax, 0x2000000
test eax, eax
jne 0x1400408f1
jmp 0x1400408ad
mov rax, qword [rsp + 0x50]
mov eax, dword [rax + 0xc]
mov rcx, qword [rsp + 0x40]
add rax, qword [rcx + 0x10]
mov qword [rsp + 0x90], rax
mov rax, qword [rsp + 0x50]
mov eax, dword [rax + 8]
mov qword [rsp + 0xa0], rax
mov rax, qword [rsp + 0x40]
mov eax, dword [rax + 0x4c]
and eax, 0x10
test eax, eax
je 0x140040942
mov rdi, qword [rsp + 0x90]
xor eax, eax
mov rcx, qword [rsp + 0xa0]
rep stosb byte [rdi], al
jmp 0x1400409d5
mov qword [rsp + 0x20], 0
mov r9d, 4
lea r8, [rsp + 0xa0]
lea rdx, [rsp + 0x90]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwProtectVirtualMemory]
test eax, eax
jl 0x140040986
mov rdi, qword [rsp + 0x90]
xor eax, eax
mov rcx, qword [rsp + 0xa0]
rep stosb byte [rdi], al
mov qword [rsp + 0x20], 0
mov r9d, 1
lea r8, [rsp + 0xa0]
lea rdx, [rsp + 0x90]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwProtectVirtualMemory]
mov r9d, 0x4000
lea r8, [rsp + 0xa0]
lea rdx, [rsp + 0x90]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwFreeVirtualMemory]
jmp 0x1400408ad
mov rax, qword [rsp + 0x40]
mov eax, dword [rax + 0x4c]
and eax, 4
test eax, eax
je 0x140040aeb
mov rax, qword [rsp + 0x48]
movzx eax, word [rax + 0x18]
cmp eax, 0x20b
jne 0x140040a0b
mov rax, qword [rsp + 0x48]
mov eax, dword [rax + 0x54]
mov dword [rsp + 0x64], eax
jmp 0x140040a17
mov rax, qword [rsp + 0x48]
mov eax, dword [rax + 0x54]
mov dword [rsp + 0x64], eax
mov eax, dword [rsp + 0x64]
mov qword [rsp + 0xa8], rax
mov rax, qword [rsp + 0x40]
mov eax, dword [rax + 0x4c]
and eax, 0x10
test eax, eax
je 0x140040a4c
mov rax, qword [rsp + 0x40]
mov rdi, qword [rax + 0x10]
xor eax, eax
mov rcx, qword [rsp + 0xa8]
rep stosb byte [rdi], al
jmp 0x140040aeb
mov rax, qword [rsp + 0x40]
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x98], rax
mov qword [rsp + 0x20], 0
mov r9d, 4
lea r8, [rsp + 0xa8]
lea rdx, [rsp + 0x98]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwProtectVirtualMemory]
test eax, eax
jl 0x140040ad0
mov rax, qword [rsp + 0x40]
mov rdi, qword [rax + 0x10]
xor eax, eax
mov rcx, qword [rsp + 0xa8]
rep stosb byte [rdi], al
mov qword [rsp + 0x20], 0
mov r9d, 2
lea r8, [rsp + 0xa8]
lea rdx, [rsp + 0x98]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwProtectVirtualMemory]
jmp 0x140040aeb
lea r9, [0x140047720]
lea r8, [0x1400477b0]
xor edx, edx
mov ecx, 0x4d
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
mov rax, qword [rsp + 0x40]
mov byte [rax + 0x51], 1
jmp 0x1400406c7
xor eax, eax
mov rcx, qword [rsp + 0xb0]
xor rcx, rsp
call fcn.140021990
add rsp, 0xc8
pop rdi
pop rsi
ret