Function at 0x140039be0
Capabilities:
Parse pe header

Disassembly:
push rbp
push rbx
push rsi
push r12
push r13
push r15
lea rbp, [rsp - 0xd8]
sub rsp, 0x1d8
mov r15, r8
mov r12, rdx
mov rsi, rcx
test rdx, rdx
je 0x140039fb4
xorps xmm0, xmm0
lea rcx, [rbp - 0x40]
xor edx, edx
mov r8d, pe_nt_image_headers64
movups xmmword [rbp - 0x80], xmm0
movups xmmword [rbp - 0x70], xmm0
movups xmmword [rbp - 0x60], xmm0
movups xmmword [rbp - 0x50], xmm0
call sub.VCRUNTIME140.dll_memset
xor r13d, r13d
mov qword [rsp + 0x40], 0x33
mov qword [rsp + 0x38], r13
lea rax, [rbp - 0x80]
mov qword [rsp + 0x58], rax
lea r8, [rsp + 0x40]
lea rax, [rbp + 0x118]
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x30], rax
lea r9d, [r13 + 0x28]
mov dword [rsp + 0x28], r13d
mov edx, 0x80862007
mov rcx, rsi
mov qword [rsp + 0x20], r13
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x60], 0x40
mov dword [rbp + 0x118], r13d
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140039fb4
mov eax, 0x5a4d
cmp word [rbp - 0x80], ax
jne 0x140039fb4
movsxd rax, dword [rbp - 0x44]
add rax, r12
je 0x140039fb4
mov qword [rsp + 0x50], rax
lea r9d, [r13 + 0x28]
mov qword [rsp + 0x38], r13
lea rax, [rbp - 0x40]
mov qword [rsp + 0x58], rax
lea r8, [rsp + 0x40]
lea rax, [rbp + 0x118]
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x30], rax
mov edx, 0x80862007
mov dword [rsp + 0x28], r13d
mov rcx, rsi
mov qword [rsp + 0x20], r13
mov qword [rsp + 0x40], 0x33
mov qword [rsp + 0x60], pe_nt_image_headers64
mov dword [rbp + 0x118], r13d
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140039fb4
cmp dword [rbp - 0x40], 0x4550
jne 0x140039fb4
mov ebx, dword [rbp + 0x48]
test ebx, ebx
je 0x140039fb4
mov eax, dword [rbp + 0x4c]
test eax, eax
je 0x140039fb4
mov qword [rsp + 0x210], rdi
lea r9d, [r13 + 4]
mov qword [rsp + 0x1d0], r14
mov r8d, 0x3000
mov edx, eax
mov qword [rsp + 0x70], rax
xor ecx, ecx
mov r14d, eax
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rdi, rax
mov qword [rsp + 0x68], rbx
lea rax, [rbx + r12]
test rdi, rdi
je 0x140039ed3
test rax, rax
je 0x140039ed3
test r14, r14
je 0x140039ed3
mov qword [rsp + 0x38], r13
lea r9d, [r13 + 0x28]
mov qword [rsp + 0x50], rax
lea r8, [rsp + 0x40]
lea rax, [rbp + 0x118]
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x30], rax
mov edx, 0x80862007
mov dword [rsp + 0x28], r13d
mov rcx, rsi
mov qword [rsp + 0x20], r13
mov qword [rsp + 0x40], 0x33
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x60], r14
mov dword [rbp + 0x118], r13d
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140039ed3
mov eax, dword [rdi + 0x24]
mov r14, rdi
mov r13d, dword [rdi + 0x20]
sub r14, rbx
add rax, r14
add r13, r14
mov qword [rbp + 0x118], rax
mov eax, dword [rdi + 0x1c]
add rax, r14
mov qword [rbp + 0x128], rax
xor eax, eax
mov ebx, eax
cmp dword [rdi + 0x18], eax
jbe 0x140039ed3
mov esi, ebx
mov r8, 0xffffffffffffffff
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x58], 0xf
mov edx, dword [r13 + rsi*4]
add rdx, r14
inc r8
cmp byte [rdx + r8], 0
jne 0x140039e46
lea rcx, [rsp + 0x40]
call fcn.140003f70
cmp qword [r15 + 0x18], 0x10
mov rdx, r15
jb 0x140039e67
mov rdx, qword [r15]
cmp qword [rsp + 0x58], 0x10
lea rcx, [rsp + 0x40]
cmovae rcx, qword [rsp + 0x40]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
test eax, eax
je 0x140039f07
mov rdx, qword [rsp + 0x58]
cmp rdx, 0x10
jb 0x140039ec3
mov rcx, qword [rsp + 0x40]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140039ebe
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140039f8d
call fcn.1400539ec
inc ebx
mov eax, 0
cmp ebx, dword [rdi + 0x18]
jb 0x140039e22
xor edx, edx
mov r8d, 0x8000
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
mov rdi, qword [rsp + 0x210]
mov r14, qword [rsp + 0x1d0]
add rsp, 0x1d8
pop r15
pop r13
pop r12
pop rsi
pop rbx
pop rbp
ret
mov rax, qword [rbp + 0x118]
mov rcx, qword [rbp + 0x128]
movzx eax, word [rax + rsi*2]
mov ecx, dword [rcx + rax*4]
cmp ecx, 0x1000
jbe 0x140039f57
lea rbx, [r12 + rcx]
mov rcx, qword [rsp + 0x68]
lea rax, [rcx + r12]
cmp rbx, rax
jb 0x140039f94
mov rax, qword [rsp + 0x70]
add rax, rcx
add rax, r12
cmp rbx, rax
ja 0x140039f94
xor edx, edx
mov r8d, 0x8000
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor ebx, ebx
mov rdx, qword [rsp + 0x58]
cmp rdx, 0x10
jb 0x140039fac
mov rcx, qword [rsp + 0x40]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140039fa7
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140039fa7
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
xor edx, edx
mov r8d, 0x8000
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x140039f59
call fcn.1400539ec
mov rax, rbx
jmp 0x140039ee6
xor eax, eax
add rsp, 0x1d8
pop r15
pop r13
pop r12
pop rsi
pop rbx
pop rbp
ret