Function at 0x1800018a0
Capabilities:
Parse pe header

Disassembly:
push r12
sub rsp, 0x30
mov eax, 0x5a4d
mov r12, rcx
cmp word [rcx], ax
je 0x1800018c7
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x30
pop r12
ret
mov qword [rsp + 0x50], rsi
movsxd rsi, dword [rcx + 0x3c]
add rsi, rcx
cmp dword [rsi], 0x4550
jne 0x1800018e6
mov eax, 0x14c
cmp word [rsi + 4], ax
jne 0x1800018ff
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rsi, qword [rsp + 0x50]
xor eax, eax
add rsp, 0x30
pop r12
ret
mov edx, dword [rsi + 0x50]
mov rcx, qword [rsi + 0x30]
mov r9d, 4
mov r8d, 0x3000
mov qword [rsp + 0x48], rbp
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
jne 0x18000195e
mov edx, dword [rsi + 0x50]
lea r9d, [rax + 4]
xor ecx, ecx
mov r8d, 0x3000
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
jne 0x18000195e
lea ecx, [rax + 0xe]
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
xor eax, eax
add rsp, 0x30
pop r12
ret
mov qword [rsp + 0x28], rdi
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
xor edx, edx
lea r8d, [rdx + 0x50]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
jne 0x1800019a1
lea ecx, [rax + 0xe]
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x180001aed
mov qword [rax + 8], rbp
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x20], r13
xor r13d, r13d
mov r8d, 0x1000
mov rcx, rbp
mov qword [rax + 0x10], r13
mov qword [rax + 0x18], r13
movzx eax, word [rsi + 0x16]
shr eax, 0xd
mov qword [rdi + 0x40], r13
lea r9d, [r13 + 4]
and eax, 1
mov dword [rdi + 0x20], eax
lea rax, [0x180001870]
mov qword [rdi + 0x28], rax
lea rax, [0x180001880]
mov qword [rdi + 0x30], rax
lea rax, [0x180001890]
mov qword [rdi + 0x38], rax
mov edx, dword [rsi + 0x54]
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r8d, dword [rsi + 0x54]
mov rdx, r12
mov rcx, rax
mov rbx, rax
call fcn.1800020a0
movsxd rax, dword [r12 + 0x3c]
mov r8, rdi
add rax, rbx
mov rdx, rsi
mov rcx, r12
mov qword [rdi], rax
mov qword [rax + 0x30], rbp
call fcn.180001350
mov rdx, rbp
sub rdx, qword [rsi + 0x30]
je 0x180001a47
mov rcx, rdi
call fcn.180001550
mov dword [rdi + 0x24], eax
jmp 0x180001a4e
mov dword [rdi + 0x24], 1
mov rcx, rdi
call fcn.180001610
test eax, eax
je 0x180001ad9
mov rcx, rdi
call fcn.180001440
mov rax, qword [rdi]
mov rsi, qword [rdi + 8]
mov ecx, dword [rax + 0xd0]
test ecx, ecx
je 0x180001aa9
mov rbx, qword [rcx + rsi + 0x18]
test rbx, rbx
je 0x180001aa9
mov rax, qword [rbx]
test rax, rax
je 0x180001aa9
nop word [rax + rax]
xor r8d, r8d
mov rcx, rsi
lea edx, [r8 + 1]
call rax
mov rax, qword [rbx + 8]
add rbx, 8
test rax, rax
jne 0x180001a90
mov rax, qword [rdi]
mov ecx, dword [rax + 0x28]
test ecx, ecx
je 0x180001b18
lea rax, [rbp + rcx]
cmp dword [rdi + 0x20], r13d
je 0x180001b0f
xor r8d, r8d
mov rcx, rbp
lea edx, [r8 + 1]
call rax
test eax, eax
jne 0x180001b03
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rdi
call fcn.1800017b0
xor eax, eax
mov rbx, qword [rsp + 0x40]
mov r13, qword [rsp + 0x20]
mov rdi, qword [rsp + 0x28]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x30
pop r12
ret
mov dword [rdi + 0x1c], 1
mov rax, rdi
jmp 0x180001ae3
mov qword [rdi + 0x48], rax
mov rax, rdi
jmp 0x180001ae3
mov qword [rdi + 0x48], r13
mov rax, rdi
jmp 0x180001ae3