Function at 0x140002988
Capabilities:
Parse pe header

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r14
sub rsp, 0x50
mov eax, 0x5a4d
mov r12, rcx
cmp word [rcx], ax
je 0x1400029bd
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140002c0d
movsxd rsi, dword [rcx + 0x3c]
add rsi, rcx
cmp dword [rsi], 0x4550
jne 0x1400029ad
mov eax, 0x8664
cmp word [rsi + 4], ax
jne 0x1400029ad
mov r14d, 1
test byte [rsi + 0x38], r14b
jne 0x1400029ad
mov edx, dword [rsi + 0x50]
mov rcx, qword [rsi + 0x30]
mov ebx, 0x3000
lea r9d, [r14 + 3]
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
jne 0x140002a25
mov edx, dword [rsi + 0x50]
lea r9d, [r14 + 3]
mov r8d, ebx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
jne 0x140002a25
mov ecx, 0xe
jmp 0x1400029b2
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
lea r8d, [rdx + 0x50]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
jne 0x140002a58
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x140002a1e
mov qword [rax + 8], rbp
movzx eax, word [rsi + 0x16]
lea rcx, str.kernel32.dll
shr eax, 0xd
and eax, r14d
mov dword [rdi + 0x20], eax
lea rax, [0x140001410]
mov qword [rdi + 0x28], rax
lea rax, [0x1400013d0]
mov qword [rdi + 0x30], rax
lea rax, [0x1400013d8]
mov qword [rdi + 0x38], rax
mov rax, qword [rsp + 0x90]
mov qword [rdi + 0x40], rax
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
test rax, rax
je 0x140002abf
lea rdx, str.GetNativeSystemInfo
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rcx, [rsp + 0x20]
call rax
mov eax, dword [rsp + 0x24]
mov r9d, 4
mov r8d, 0x1000
mov dword [rdi + 0x50], eax
mov edx, dword [rsi + 0x54]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r8d, dword [rsi + 0x54]
mov rdx, r12
mov rcx, rax
mov rbx, rax
call fcn.140005ef0
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.14000240c
test eax, eax
je 0x140002c05
mov rdx, rbp
sub rdx, qword [rsi + 0x30]
je 0x140002b2b
mov rcx, rdi
call fcn.14000275c
mov dword [rdi + 0x24], eax
jmp 0x140002b2f
mov dword [rdi + 0x24], r14d
mov rcx, rdi
call fcn.14000281c
test eax, eax
je 0x140002c05
mov rax, qword [rdi]
mov r8, qword [rdi + 8]
cmp dword [rax + 0xa4], 0
je 0x140002b89
cmp dword [rax + 0xa0], 0
je 0x140002b89
mov ecx, dword [rax + 0xa0]
add rcx, r8
je 0x140002b91
mov edx, dword [rax + 0xa4]
movabs rax, 0xaaaaaaaaaaaaaaab
mul rdx
shr rdx, 3
sub edx, r14d
call qword [sym.imp.KERNEL32.dll_RtlAddFunctionTable]
movzx r11d, al
jmp 0x140002b8c
mov r11d, r14d
test r11d, r11d
je 0x140002c05
mov rcx, rdi
call fcn.1400025cc
test eax, eax
je 0x140002c05
mov rax, qword [rdi]
mov rsi, qword [rdi + 8]
cmp dword [rax + 0xd0], 0
je 0x140002bd6
mov eax, dword [rax + 0xd0]
mov rbx, qword [rax + rsi + 0x18]
test rbx, rbx
je 0x140002bd6
jmp 0x140002bce
xor r8d, r8d
mov edx, r14d
mov rcx, rsi
call rax
add rbx, 8
mov rax, qword [rbx]
test rax, rax
jne 0x140002bbf
mov rax, qword [rdi]
mov ecx, dword [rax + 0x28]
test ecx, ecx
je 0x140002c35
cmp dword [rdi + 0x20], 0
lea rax, [rbp + rcx]
je 0x140002c2f
xor r8d, r8d
mov edx, r14d
mov rcx, rbp
call rax
test eax, eax
jne 0x140002c29
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rdi
call fcn.140002d24
xor eax, eax
lea r11, [rsp + 0x50]
mov rbx, qword [r11 + 0x20]
mov rbp, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r14
pop r12
pop rdi
ret
mov dword [rdi + 0x1c], r14d
jmp 0x140002c3a
mov qword [rdi + 0x48], rax
jmp 0x140002c3a
and qword [rdi + 0x48], 0
mov rax, rdi
jmp 0x140002c0f