Function at 0x140051530
Capabilities:
Parse pe header

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov r15, rcx
mov eax, 0x5a4d
cmp word [0x1400c0090], ax
jne 0x140051805
movsxd rdi, dword [0x1400c00cc]
lea rsi, [0x1400c0090]
add rdi, rsi
cmp dword [rdi], 0x4550
jne 0x140051805
mov eax, 0x20b
cmp word [rdi + 0x18], ax
jne 0x140051805
mov ebx, dword [rdi + 0x50]
mov edx, ebx
xor ecx, ecx
lea r9d, [rcx + 4]
mov r8d, 0x3000
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbp, rax
test rax, rax
je 0x140051805
movzx ecx, word [rdi + 0x14]
mov r12d, dword [rcx + rdi + 0x24]
sub ebx, r12d
mov r13d, ebx
je 0x1400517f4
mov edx, 4
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
xor ebx, ebx
mov eax, dword [rdx + rcx]
cmp dword [0x1400c4ff4], eax
jle 0x140051695
lea rcx, [0x1400c4ff4]
call fcn.1400538c8
cmp dword [0x1400c4ff4], 0xffffffff
jne 0x140051695
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x48], rbx
mov qword [rsp + 0x50], 0xf
mov byte [rsp + 0x38], bl
lea r8d, [rbx + 0x15]
lea rdx, [0x1400b50b0]
lea rcx, [rsp + 0x38]
call fcn.14002ffe0
nop
lea r8, [rsp + 0x38]
mov rdx, qword [0x1400c4c10]
mov rcx, r15
call fcn.14004db20
mov qword [0x1400c5058], rax
mov rdx, qword [rsp + 0x50]
cmp rdx, 0x10
jb 0x140051689
inc rdx
mov rcx, qword [rsp + 0x38]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140051683
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140051683
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140053fd8
nop
lea rcx, [0x1400c4ff4]
call fcn.140053868
cmp qword [0x1400c5058], 0
je 0x1400517f4
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x20], r13
lea rdx, [rsp + 0x30]
mov rcx, r15
call fcn.140050390
test al, al
je 0x1400517f4
mov r14, qword [rsp + 0x30]
test r14, r14
je 0x1400517f4
mov r8d, dword [rdi + 0x54]
mov rdx, rsi
mov rcx, rbp
call sub.VCRUNTIME140.dll_memcpy
movzx ebx, word [rdi + 0x14]
add rbx, 0x28
xor eax, eax
mov esi, eax
cmp ax, word [rdi + 6]
jae 0x140051730
add rbx, rdi
lea r14, [0x1400c0090]
nop dword [rax + rax]
test dword [rbx + 0x14], 0x80
ja 0x14005171d
mov r8d, dword [rbx]
mov edx, dword [rbx + 4]
add rdx, r14
mov ecx, dword [rbx - 4]
add rcx, rbp
call sub.VCRUNTIME140.dll_memcpy
inc esi
add rbx, 0x28
movzx eax, word [rdi + 6]
cmp esi, eax
jl 0x140051700
mov r14, qword [rsp + 0x30]
mov rsi, r14
sub rsi, r12
mov rbx, rsi
sub rbx, qword [rdi + 0x30]
mov rdx, rbp
lea rcx, [rsp + 0x38]
call fcn.1400529c0
mov rdx, rbx
mov rcx, rax
call fcn.140051830
mov rdx, rsi
mov rcx, rbp
call fcn.140051930
test al, al
je 0x140051805
mov rdx, rbp
lea rcx, [rsp + 0x38]
call fcn.140052b10
mov rdx, rax
mov rcx, r15
call fcn.1400519e0
test al, al
je 0x1400517d6
lea r8, [r12 + rbp]
mov r9, r13
mov rdx, r14
mov rcx, r15
call fcn.14004d7e0
test al, al
je 0x1400517d6
mov r8d, dword [rdi + 0x28]
add r8, rsi
xor eax, eax
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x20], rax
xor r9d, r9d
lea rdx, [rsp + 0x30]
mov rcx, r15
call fcn.140051d40
test al, al
je 0x1400517d6
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rax, r14
jmp 0x140051807
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rdx, r14
mov rcx, r15
call fcn.14004da00
jmp 0x140051805
xor edx, edx
mov r8d, 0x8000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret