Function at 0x140021840
Capabilities:
Load ntoskrnl
Parse pe header

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x140
mov rax, qword [0x140040040]
xor rax, rsp
mov qword [rsp + 0x138], rax
mov eax, 4
mov eax, eax
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx]
mov eax, dword [rax + rcx]
cmp dword [0x140040bf8], eax
jle 0x1400218bf
lea rcx, [0x140040bf8]
call fcn.140034d68
cmp dword [0x140040bf8], 0xffffffff
jne 0x1400218bf
mov r8d, 1
xor edx, edx
lea rcx, [0x140037c38]
call qword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov qword [0x140040bf0], rax
lea rcx, [0x140040bf8]
call fcn.140034cfc
mov eax, 4
mov eax, eax
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx]
mov eax, dword [rax + rcx]
cmp dword [0x140040c18], eax
jle 0x14002190c
lea rcx, [0x140040c18]
call fcn.140034d68
cmp dword [0x140040c18], 0xffffffff
jne 0x14002190c
mov rax, qword [0x140040bf0]
mov qword [0x140040c68], rax
lea rcx, [0x140040c18]
call fcn.140034cfc
mov rax, qword [0x140040c68]
movzx eax, word [rax]
cmp eax, 0x5a4d
je 0x140021924
xor eax, eax
jmp 0x140021e10
mov eax, 4
mov eax, eax
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx]
mov eax, dword [rax + rcx]
cmp dword [0x140040c2c], eax
jle 0x140021982
lea rcx, [0x140040c2c]
call fcn.140034d68
cmp dword [0x140040c2c], 0xffffffff
jne 0x140021982
mov rax, qword [0x140040c68]
movsxd rax, dword [rax + 0x3c]
mov rcx, qword [0x140040bf0]
add rcx, rax
mov rax, rcx
mov qword [0x140040c88], rax
lea rcx, [0x140040c2c]
call fcn.140034cfc
mov rax, qword [0x140040c88]
cmp dword [rax], 0x4550
je 0x140021998
xor eax, eax
jmp 0x140021e10
mov eax, 4
mov eax, eax
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx]
mov eax, dword [rax + rcx]
cmp dword [0x140040c1c], eax
jle 0x1400219eb
lea rcx, [0x140040c1c]
call fcn.140034d68
cmp dword [0x140040c1c], 0xffffffff
jne 0x1400219eb
mov rax, qword [0x140040c88]
add rax, 0x108
mov qword [0x140040cf0], rax
lea rcx, [0x140040c1c]
call fcn.140034cfc
mov eax, 4
mov eax, eax
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx]
mov eax, dword [rax + rcx]
cmp dword [0x140040cc8], eax
jle 0x140021a38
lea rcx, [0x140040cc8]
call fcn.140034d68
cmp dword [0x140040cc8], 0xffffffff
jne 0x140021a38
mov rax, qword [0x140040cf0]
mov qword [0x140040bd8], rax
lea rcx, [0x140040cc8]
call fcn.140034cfc
mov eax, 4
mov eax, eax
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx]
mov eax, dword [rax + rcx]
cmp dword [0x140040cdc], eax
jle 0x140021a89
lea rcx, [0x140040cdc]
call fcn.140034d68
cmp dword [0x140040cdc], 0xffffffff
jne 0x140021a89
mov rax, qword [0x140040c88]
movzx eax, word [rax + 6]
mov word [0x140040be8], ax
lea rcx, [0x140040cdc]
call fcn.140034cfc
mov r8d, 5
mov dl, 1
lea rcx, [0x140040c28]
call fcn.14001ead0
movzx eax, al
test eax, eax
jne 0x140021b11
jmp 0x140021ab8
mov rax, qword [0x140040cf0]
add rax, 0x28
mov qword [0x140040cf0], rax
movzx eax, word [0x140040be8]
imul rax, rax, 0x28
mov rcx, qword [0x140040bd8]
add rcx, rax
mov rax, rcx
cmp qword [0x140040cf0], rax
jae 0x140021b11
mov rax, qword [0x140040cf0]
mov rax, qword [0x140040cf0]
lea rcx, str.PAGE
sub rcx, rax
movzx edx, byte [rax]
cmp dl, byte [rax + rcx]
jne 0x140021b04
inc rax
test dl, dl
jne 0x140021af1
xor eax, eax
jmp 0x140021b09
sbb eax, eax
or eax, 1
test eax, eax
jne 0x140021b0f
jmp 0x140021b11
jmp 0x140021aa6
mov eax, 4
mov eax, eax
mov rcx, qword gs:[0x58]
mov rcx, qword [rcx]
mov eax, dword [rax + rcx]
cmp dword [0x140040ba8], eax
jle 0x140021b6e
lea rcx, [0x140040ba8]
call fcn.140034d68
cmp dword [0x140040ba8], 0xffffffff
jne 0x140021b6e
mov rax, qword [0x140040cf0]
mov eax, dword [rax + 0xc]
mov rcx, qword [0x140040bf0]
add rcx, rax
mov rax, rcx
mov qword [0x140040cb0], rax
lea rcx, [0x140040ba8]
call fcn.140034cfc
mov edx, 0x10
lea rcx, [rsp + 0xf8]
call fcn.14001b210
mov rax, qword [0x140040cf0]
mov eax, dword [rax + 0x10]
mov r8d, eax
mov rdx, qword [0x140040cb0]
lea rcx, [rsp + 0xf8]
call fcn.14001f100
mov edx, 0x17
lea rcx, [rsp + 0x108]
call fcn.140024220
mov qword [rsp + 0x38], 0
jmp 0x140021bcb
mov rax, qword [rsp + 0x38]
inc rax
mov qword [rsp + 0x38], rax
cmp qword [rsp + 0x38], 0x17
jae 0x140021c2a
mov rax, qword [rsp + 0x38]
mov rcx, qword [rsp + 0x150]
add rcx, rax
mov rax, rcx
mov rcx, qword [rsp + 0x38]
mov rdx, qword [rsp + 0x158]
add rdx, rcx
mov rcx, rdx
mov r8, rcx
mov rdx, rax
lea rcx, [rsp + 0x35]
call fcn.140024270
mov rdx, qword [rsp + 0x38]
lea rcx, [rsp + 0x108]
call fcn.140023870
lea rdx, [rsp + 0x35]
mov rcx, rax
call fcn.1400241f0
jmp 0x140021bbe
mov edx, 8
lea rcx, [rsp + 0xf0]
call fcn.14001b210
lea rax, [rsp + 0x30]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
movzx eax, byte [rsp + 0x30]
mov byte [rsp + 0x31], al
movzx eax, byte [rsp + 0x31]
mov byte [rsp + 0x32], al
movzx eax, byte [rsp + 0x32]
mov byte [rsp + 0x33], al
movzx eax, byte [rsp + 0x33]
mov byte [rsp + 0x34], al
lea rdx, [rsp + 0xc8]
lea rcx, [rsp + 0x108]
call fcn.140023890
mov rax, qword [rax]
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0x48]
mov qword [rsp + 0x50], rax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0xa8], rax
lea rdx, [rsp + 0xd0]
lea rcx, [rsp + 0x108]
call fcn.1400238c0
mov rax, qword [rax]
mov qword [rsp + 0x60], rax
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0xb0], rax
lea rdx, [rsp + 0xd8]
lea rcx, [rsp + 0xf8]
call fcn.140023cb0
mov rax, qword [rax]
mov qword [rsp + 0x78], rax
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x80], rax
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x88], rax
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0xb8], rax
lea rdx, [rsp + 0xe0]
lea rcx, [rsp + 0xf8]
call fcn.140023ce0
mov rax, qword [rax]
mov qword [rsp + 0x90], rax
mov rax, qword [rsp + 0x90]
mov qword [rsp + 0x98], rax
mov rax, qword [rsp + 0x98]
mov qword [rsp + 0xa0], rax
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0xc0], rax
movzx eax, byte [rsp + 0x34]
mov byte [rsp + 0x28], al
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0x20], rax
mov r9, qword [rsp + 0xb0]
mov r8, qword [rsp + 0xb8]
mov rdx, qword [rsp + 0xc0]
lea rcx, [rsp + 0xf0]
call fcn.1400242b0
lea rdx, [rsp + 0xe8]
lea rcx, [rsp + 0xf8]
call fcn.140023cb0
mov rdx, rax
lea rcx, [rsp + 0xf0]
call fcn.140020190
movzx eax, al
test eax, eax
je 0x140021df9
mov qword [rsp + 0x40], 0
jmp 0x140021e0b
lea rcx, [rsp + 0xf0]
call fcn.14001c0a0
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x40]
mov rcx, qword [rsp + 0x138]
xor rcx, rsp
call fcn.140034c30
add rsp, 0x140
pop rdi
ret