Function at 0x1401cca98
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 [0x1403f04b0]
xor rax, rsp
mov qword [rbp + 0x130], rax
mov rsi, rdx
mov r14, rcx
mov rdx, qword [rdx]
lea rcx, [rsp + 0x58]
mov rbx, qword [rdx + 0x128]
add rdx, 0xe0
call fcn.14005517c
mov rax, qword [rsi]
xor edi, edi
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 0x1401cce05
cmp qword [rsp + 0x68], rdi
je 0x1401cce05
xor edx, edx
lea r8d, [rdi + 0x20]
lea rcx, [rsp + 0x38]
call sub.api_ms_win_crt_private_l1_1_0.dll__o_memset
mov rcx, qword [r14]
lea rax, [rsp + 0x38]
lea r9, [rsp + 0x30]
mov qword [rsp + 0x20], rax
lea r8d, [rdi + 0x40]
lea rdx, [rbp - 0x80]
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
lea r15, [0x1402cb810]
mov ebx, eax
test eax, eax
je 0x1401ccb65
cmp eax, 0x3e5
jne 0x1401ccd43
mov rcx, qword [r14]
lea r8, [rsp + 0x30]
or r9d, 0xffffffff
mov dword [rsp + 0x20], edi
lea rdx, [rsp + 0x38]
call qword [sym.imp.api_ms_win_core_io_l1_1_1.dll_GetOverlappedResultEx]
test eax, eax
je 0x1401ccd3b
cmp dword [rsp + 0x30], 0x40
jne 0x1401ccd3b
mov eax, 0x5a4d
cmp word [rbp - 0x80], ax
jne 0x1401cce05
mov ebx, 0x108
lea rcx, [rbp - 0x40]
mov r8d, ebx
xor edx, edx
call sub.api_ms_win_crt_private_l1_1_0.dll__o_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.api_ms_win_core_file_l1_1_0.dll_ReadFile]
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test eax, eax
je 0x1401ccbf2
cmp eax, 0x3e5
jne 0x1401ccd43
mov rcx, qword [r14]
lea r8, [rsp + 0x30]
or r9d, 0xffffffff
mov dword [rsp + 0x20], edi
lea rdx, [rsp + 0x38]
call qword [sym.imp.api_ms_win_core_io_l1_1_1.dll_GetOverlappedResultEx]
test eax, eax
je 0x1401ccc5f
mov eax, dword [rsp + 0x30]
add eax, 0xffffff08
test eax, 0xffffffef
jne 0x1401ccc5f
cmp dword [rbp - 0x40], 0x4550
mov eax, 0x14c
jne 0x1401cce05
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 0x1401cce07
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
call fcn.140048a14
mov rsi, qword [rax + 8]
cmp dword [rsi], 3
jbe 0x1401ccd43
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], 0x8c
cmovae rax, qword [rsp + 0x58]
mov rcx, rdi
test rax, rax
je 0x1401cccbe
mov rdx, rax
or rcx, 0xffffffffffffffff
inc rcx
cmp word [rax + rcx*2], di
jne 0x1401cccb5
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, [0x14034e6d3]
xor r8d, r8d
mov dword [rsp + 0x20], 6
mov rcx, rsi
call fcn.140001078
jmp 0x1401ccd43
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test ebx, ebx
je 0x1401cce0a
call fcn.140048a14
mov rbx, qword [rax + 8]
cmp dword [rbx], 3
jbe 0x1401cce0a
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 0x1401ccd9f
mov r15, rcx
or rax, 0xffffffffffffffff
inc rax
cmp word [rcx + rax*2], di
jne 0x1401ccd96
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, [0x14034e5e9]
xor r8d, r8d
mov dword [rsp + 0x20], 5
mov rcx, rbx
call fcn.140001078
jmp 0x1401cce0a
mov al, 2
mov dil, al
lea rcx, [rsp + 0x58]
call fcn.1400492c0
mov al, dil
mov rcx, qword [rbp + 0x130]
xor rcx, rsp
call fcn.14027a710
mov rbx, qword [rsp + 0x280]
add rsp, 0x240
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret