Function at 0x1401f79a4
Capabilities:
Parse pe header
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x140]
sub rsp, 0x240
mov rax, qword [0x14049e510]
xor rax, rsp
mov qword [rbp + 0x130], rax
mov rsi, rdx
xor edi, edi
mov rdx, qword [rdx]
mov r14, rcx
test rdx, rdx
jne 0x1401f79e8
call fcn.1402b9bb8
mov rdx, qword [rsi]
mov rbx, qword [rdx + 0x128]
lea rcx, [rsp + 0x58]
add rdx, 0xe0
call fcn.14004cf4c
mov rax, qword [rsi]
mov dword [rax + 0x150], edi
mov rax, qword [rsi]
mov dword [rax + 0x154], edi
mov rax, qword [rsi]
mov dword [rax + 0x15c], edi
cmp rbx, 0x40
jb 0x1401f7d20
cmp qword [rsp + 0x68], rdi
je 0x1401f7d20
xor edx, edx
lea rcx, [rsp + 0x38]
lea r8d, [rdx + 0x20]
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
mov rcx, qword [r14]
lea rax, [rsp + 0x38]
lea r9, [rsp + 0x30]
mov qword [rsp + 0x20], rax
mov r8d, 0x40
lea rdx, [rbp - 0x80]
call qword [sym.imp.KERNEL32.dll_ReadFile]
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
lea r15, [0x140344690]
mov ebx, eax
test eax, eax
je 0x1401f7a80
cmp eax, 0x3e5
jne 0x1401f7c5e
mov rcx, qword [r14]
lea r8, [rsp + 0x30]
or r9d, 0xffffffff
mov dword [rsp + 0x20], edi
lea rdx, [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_GetOverlappedResultEx]
test eax, eax
je 0x1401f7c56
cmp dword [rsp + 0x30], 0x40
jne 0x1401f7c56
mov eax, 0x5a4d
cmp word [rbp - 0x80], ax
jne 0x1401f7d20
mov ebx, 0x108
lea rcx, [rbp - 0x40]
mov r8d, ebx
xor edx, edx
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
mov eax, dword [rbp - 0x44]
lea r9, [rsp + 0x30]
mov rcx, qword [r14]
lea rdx, [rbp - 0x40]
mov dword [rsp + 0x48], eax
mov r8d, ebx
lea rax, [rsp + 0x38]
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test eax, eax
je 0x1401f7b0d
cmp eax, 0x3e5
jne 0x1401f7c5e
mov rcx, qword [r14]
lea r8, [rsp + 0x30]
or r9d, 0xffffffff
mov dword [rsp + 0x20], edi
lea rdx, [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_GetOverlappedResultEx]
test eax, eax
je 0x1401f7b7a
mov eax, dword [rsp + 0x30]
add eax, 0xffffff08
test eax, 0xffffffef
jne 0x1401f7b7a
cmp dword [rbp - 0x40], 0x4550
mov eax, 0x14c
jne 0x1401f7d20
mov eax, dword [rbp - 0x38]
mov rcx, qword [rsi]
mov dword [rcx + 0x150], eax
mov rcx, qword [rsi]
mov eax, dword [rbp + 0x18]
mov dword [rcx + 0x154], eax
mov rax, qword [rsi]
movzx ecx, word [rbp - 0x3c]
mov dword [rax + 0x15c], ecx
mov al, 1
jmp 0x1401f7d22
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
call fcn.14004d8a4
mov rsi, qword [rax + 8]
cmp dword [rsi], 3
jbe 0x1401f7c5e
cmp qword [rsp + 0x70], 8
lea rax, str.Failed_to_read_the_file_image_header._Cant_decide_if_the_file_is_PE.
mov qword [rbp + 0xf0], rax
mov rdx, r15
lea rax, [rsp + 0x58]
mov qword [rbp + 0xf8], DllRegisterServer
cmovae rax, qword [rsp + 0x58]
mov rcx, rdi
test rax, rax
je 0x1401f7bd9
mov rdx, rax
or rcx, 0xffffffffffffffff
inc rcx
cmp word [rax + rcx*2], di
jne 0x1401f7bd0
lea eax, [rcx*2 + 2]
mov qword [rbp + 0x100], rdx
mov dword [rbp + 0x108], eax
lea rax, [rsp + 0x30]
mov qword [rbp + 0x110], rax
mov dword [rbp + 0x10c], edi
mov qword [rbp + 0x118], 4
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x34], eax
lea rax, [rsp + 0x34]
mov qword [rbp + 0x120], rax
mov qword [rbp + 0x128], 4
lea rax, [rbp + 0xd0]
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea rdx, [0x1403dfe38]
xor r8d, r8d
mov dword [rsp + 0x20], 6
mov rcx, rsi
call fcn.140001158
jmp 0x1401f7c5e
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test ebx, ebx
je 0x1401f7d25
call fcn.14004d8a4
mov rbx, qword [rax + 8]
cmp dword [rbx], 3
jbe 0x1401f7d25
cmp qword [rsp + 0x70], 8
lea rax, str.Failed_to_read_the_file_header._Cant_decide_if_the_file_is_PE.
lea rcx, [rsp + 0x58]
mov qword [rbp + 0xf0], rax
cmovae rcx, qword [rsp + 0x58]
mov rax, rdi
mov qword [rbp + 0xf8], 0x80
test rcx, rcx
je 0x1401f7cba
mov r15, rcx
or rax, 0xffffffffffffffff
inc rax
cmp word [rcx + rax*2], di
jne 0x1401f7cb1
lea eax, [rax*2 + 2]
mov qword [rbp + 0x100], r15
mov dword [rbp + 0x108], eax
mov dword [rbp + 0x10c], edi
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x34], eax
lea rax, [rsp + 0x34]
mov qword [rbp + 0x110], rax
mov qword [rbp + 0x118], 4
lea rax, [rbp + 0xd0]
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea rdx, [0x1403e018c]
xor r8d, r8d
mov dword [rsp + 0x20], 5
mov rcx, rbx
call fcn.140001158
jmp 0x1401f7d25
mov al, 2
mov dil, al
lea rcx, [rsp + 0x58]
call fcn.14004e0f0
mov al, dil
mov rcx, qword [rbp + 0x130]
xor rcx, rsp
call fcn.1402dfdb0
mov rbx, qword [rsp + 0x280]
add rsp, 0x240
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret