Function at 0x140046490
Capabilities:
Parse pe header

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r13
sub rsp, 0xa0
lea rcx, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_GetStartupInfoW]
nop
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
xor edx, edx
mov r8d, 0x94
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbx, rax
test rax, rax
jne 0x1400464fd
cmp dword [0x1400970b0], 1
jne 0x1400464df
call fcn.14004c080
mov ecx, 0x12
call fcn.14004be40
mov ecx, 0xff
call fcn.140049b20
mov eax, 0xff
jmp 0x14004672b
mov dword [rax], 0x94
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
jne 0x14004652e
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rbx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, 0xff
jmp 0x14004672b
mov r13d, dword [rbx + 0x10]
mov esi, dword [rbx + 4]
mov r12d, dword [rbx + 8]
mov edi, dword [rbx + 0xc]
and edi, 0x7fff
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rbx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp r13d, 2
je 0x140046560
bts edi, 0xf
mov eax, esi
shl eax, 8
add eax, r12d
mov dword [0x1400970cc], r13d
mov dword [0x1400970d4], eax
mov dword [0x1400970d8], esi
mov dword [0x1400970dc], r12d
mov dword [0x1400970d0], edi
cmp word [0x140000000], 0x5a4d
jne 0x1400465f2
movsxd rax, dword [0x14000003c]
lea rdi, [0x140000000]
add rax, rdi
cmp dword [rax], 0x4550
je 0x1400465b7
xor ebx, ebx
mov dword [rsp + 0xc0], ebx
jmp 0x140046602
cmp word [rax + 0x18], 0x20b
je 0x1400465ca
xor ebx, ebx
mov dword [rsp + 0xc0], ebx
jmp 0x140046602
cmp dword [rax + 0x84], 0xe
ja 0x1400465de
xor ebx, ebx
mov dword [rsp + 0xc0], ebx
jmp 0x140046602
xor ebx, ebx
cmp dword [rax + 0xf8], ebx
setne bl
mov dword [rsp + 0xc0], ebx
jmp 0x140046602
xor ebx, ebx
mov dword [rsp + 0xc0], ebx
lea rdi, [0x140000000]
mov ecx, 1
call fcn.14004d830
test eax, eax
jne 0x140046632
cmp dword [0x1400970b0], 1
jne 0x14004661e
call fcn.14004c080
mov ecx, 0x1c
call fcn.14004be40
mov ecx, 0xff
call fcn.140049b20
call fcn.14004d710
test eax, eax
jne 0x14004665d
cmp dword [0x1400970b0], 1
jne 0x140046649
call fcn.14004c080
mov ecx, reloc.OLEAUT32.dll_SafeArrayGetDim
call fcn.14004be40
mov ecx, 0xff
call fcn.140049b20
call fcn.14004cfd0
nop
call fcn.14004cca0
test eax, eax
jns 0x140046676
mov ecx, 0x1b
call fcn.140049af0
call fcn.14004cb80
mov qword [0x1400995c8], rax
call fcn.14004c980
mov qword [0x1400970a8], rax
call fcn.14004c710
test eax, eax
jns 0x1400466a1
mov ecx, 8
call fcn.140049af0
call fcn.14004c3e0
test eax, eax
jns 0x1400466b4
mov ecx, 9
call fcn.140049af0
mov ecx, 1
call fcn.140049c60
test eax, eax
je 0x1400466c9
mov ecx, eax
call fcn.140049af0
call fcn.14004c380
test byte [rsp + 0x6c], 1
je 0x1400466dd
movzx r9d, word [rsp + 0x70]
jmp 0x1400466e3
mov r9d, 0xa
mov r8, rax
xor edx, edx
mov rcx, rdi
call fcn.14006b04c
mov edi, eax
mov dword [rsp + 0x20], eax
test ebx, ebx
jne 0x140046701
mov ecx, eax
call fcn.140049e70
call fcn.140049e90
jmp 0x140046722
mov eax, edi
jmp 0x14004672b
lea r11, [rsp + 0xa0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r13
pop r12
pop rdi
ret
sub rsp, 0x28
call fcn.14004d890
add rsp, 0x28
jmp 0x140046490