Function at 0x180041620
Capabilities:
Get file size
Parse pe header
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x30
mov qword [rcx + 8], rdx
mov rbx, rcx
mov rcx, qword [rcx + 0x30]
mov r14, r8
movabs r8, 0x6db6db6db6db6db7
mov r15, r9
mov dil, 1
mov rax, qword [rbx + 0x50]
sub rax, qword [rbx + 0x40]
movzx edx, word [rcx + 6]
sar rax, 3
imul rax, r8
cmp rdx, rax
jbe 0x18004167a
lea rcx, [rbx + 0x40]
call fcn.180041910
mov rcx, qword [rbx + 0x30]
xor r12d, r12d
movzx ebp, r12w
cmp r12w, word [rcx + 6]
jae 0x1800416e0
nop dword [rax + rax]
mov rcx, qword [rbx + 0x40]
mov r9b, 1
movzx eax, bp
imul r8, rax, 0x38
mov edx, dword [rcx + r8 + 0xc]
mov eax, dword [r8 + rcx + 8]
add rdx, qword [rbx + 8]
mov dword [r8 + rcx + 0x34], eax
mov rcx, rbx
add r8, qword [rbx + 0x40]
call fcn.1800406b0
mov rcx, qword [rbx + 0x30]
test al, al
movzx edi, dil
cmove edi, r12d
inc bp
cmp bp, word [rcx + 6]
jb 0x180041690
test dil, dil
jne 0x1800416e0
xor al, al
jmp 0x18004187d
mov rax, qword [rbx + 0x18]
mov edi, 0x5a4d
mov edx, 0x10b
test rax, rax
je 0x180041714
cmp word [rax], di
jne 0x180041714
test rcx, rcx
je 0x180041714
cmp dword [rcx], 0x4550
jne 0x180041714
cmp word [rcx + 0x18], dx
jne 0x180041714
mov dword [rcx + 0x3c], 0x200
jmp 0x18004171f
mov rax, qword [rbx + 0x38]
mov dword [rax + 0x3c], 0x200
sub r14d, dword [rbx + 8]
mov rcx, qword [rbx + 0x18]
test rcx, rcx
je 0x180041771
cmp word [rcx], di
jne 0x180041771
mov rax, qword [rbx + 0x30]
test rax, rax
je 0x180041748
cmp dword [rax], 0x4550
jne 0x180041748
cmp word [rax + 0x18], dx
je 0x18004176d
cmp word [rcx], di
jne 0x180041771
mov rax, qword [rbx + 0x30]
test rax, rax
je 0x180041771
cmp dword [rax], 0x4550
jne 0x180041771
mov ecx, 0x20b
cmp word [rax + 0x18], cx
jne 0x180041771
mov rax, qword [rbx + 0x38]
mov dword [rax + 0x28], r14d
mov rcx, rbx
call fcn.180041490
mov rcx, rbx
call fcn.180041120
mov rcx, qword [rbx]
test rcx, rcx
je 0x180041872
mov rax, qword [rbx + 0x18]
test rax, rax
je 0x180041872
cmp word [rax], di
jne 0x180041872
mov rax, qword [rbx + 0x30]
test rax, rax
je 0x180041872
cmp dword [rax], 0x4550
jne 0x180041872
call fcn.180044a40
mov rcx, rbx
mov rdi, rax
call fcn.180040560
cmp edi, eax
jbe 0x180041872
mov rcx, rbx
call fcn.180040640
test al, al
je 0x180041872
mov rcx, rbx
call fcn.180040560
mov rcx, qword [rbx + 0x78]
mov edi, eax
xor eax, eax
mov qword [rsp + 0x68], rax
lea rdx, [rcx - 1]
cmp rdx, 0xfffffffffffffffd
ja 0x18004181b
lea rdx, [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov rcx, qword [rsp + 0x68]
test eax, eax
cmove rcx, r12
jmp 0x18004181e
mov rcx, r12
sub ecx, edi
mov dword [rbx + 0x60], ecx
call fcn.18004a4dc
mov rcx, qword [rbx + 0x78]
xor r9d, r9d
xor r8d, r8d
mov qword [rbx + 0x58], rax
mov edx, edi
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov r8d, dword [rbx + 0x60]
lea r9, [rsp + 0x60]
mov rdx, qword [rbx + 0x58]
mov rcx, qword [rbx + 0x78]
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, qword [rbx + 0x78]
cmp rcx, 0xffffffffffffffff
je 0x180041872
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x78], 0xffffffffffffffff
mov rdx, r15
mov rcx, rbx
call fcn.180040900
mov rbx, qword [rsp + 0x70]
mov rbp, qword [rsp + 0x78]
add rsp, 0x30
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret