Function at 0x1401393f0
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0xa0
mov qword [rbp - 0x31], 0xfffffffffffffffe
mov qword [rsp + 0xe8], rbx
mov rax, qword [0x14027e238]
xor rax, rsp
mov qword [rbp + 0x1f], rax
mov r14, r9
movzx r12d, r8b
mov r15, rdx
mov rdi, rcx
lea rax, [rbp - 0x21]
mov qword [rbp - 0x29], rax
mov qword [rbp - 9], 7
xor esi, esi
mov qword [rbp - 0x11], rsi
mov word [rbp - 0x21], si
or rbx, 0xffffffffffffffff
mov r9, rbx
xor r8d, r8d
mov rdx, rcx
lea rcx, [rbp - 0x21]
call fcn.1400be8c0
nop
call fcn.140137500
mov rcx, rax
lea rdx, [rbp - 0x21]
call fcn.140137580
cmp qword [rdi + 0x18], 8
jb 0x14013947f
mov rdi, qword [rdi]
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x20], 3
xor r9d, r9d
lea edx, [r9 + 1]
lea r8d, [r9 + 7]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r13, rax
cmp rax, 0xffffffffffffffff
je 0x140139881
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp eax, 0xffffffff
je 0x140139876
lea ecx, [rax + 2]
call fcn.1401aa2b0
mov rdi, rax
test rax, rax
je 0x140139876
xor eax, eax
mov dword [rbp - 0x39], eax
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x39]
mov r8d, esi
mov rdx, rdi
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x14013986e
mov eax, dword [rbp - 0x39]
cmp eax, esi
jne 0x14013986e
mov byte [rax + rdi], 0
mov eax, dword [rbp - 0x39]
mov byte [rax + rdi + 1], 0
mov eax, dword [r15]
test eax, eax
je 0x1401396c9
cmp eax, 2
jne 0x1401395a4
cmp word [rdi], 0
jne 0x140139534
xor esi, esi
mov r8d, esi
jmp 0x14013954d
mov r8, rbx
nop word [rax + rax]
inc r8
cmp word [rdi + r8*2], 0
jne 0x140139540
xor esi, esi
mov rdx, rdi
mov rcx, r14
call fcn.1400be520
test r12b, r12b
je 0x14013986c
mov r9, rbx
mov r8d, 1
lea rdx, [rbp - 1]
mov rcx, r14
call fcn.1400c9080
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp + 0x17]
cmp r8, 8
jb 0x14013986c
inc r8
mov rdx, qword [rbp - 1]
lea rcx, [rbp - 1]
call fcn.1400be810
jmp 0x14013986c
cmp eax, 1
jne 0x140139636
lea rdx, [rdi + 3]
mov qword [rbp + 0x17], reloc.OLEAUT32.dll_SafeArrayDestroy
xor esi, esi
mov qword [rbp + 0xf], rsi
mov byte [rbp - 1], sil
cmp byte [rdx], sil
jne 0x1401395d0
mov ebx, esi
jmp 0x1401395d9
inc rbx
cmp byte [rdx + rbx], sil
jne 0x1401395d0
mov r8, rbx
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013e8a0
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x140139618
inc r8
mov rdx, qword [rbp - 0x21]
lea rcx, [rbp - 0x21]
call fcn.1400be810
mov qword [rbp - 9], 7
mov qword [rbp - 0x11], rsi
mov word [rbp - 0x21], si
lea rcx, [rbp - 1]
call fcn.1400cb8c0
jmp 0x14013986c
cmp eax, 3
jne 0x14013986e
mov qword [rbp + 0x17], reloc.OLEAUT32.dll_SafeArrayDestroy
xor esi, esi
mov qword [rbp + 0xf], rsi
mov byte [rbp - 1], sil
cmp byte [rdi], sil
jne 0x140139660
mov ebx, esi
jmp 0x140139669
inc rbx
cmp byte [rdi + rbx], sil
jne 0x140139660
mov r8, rbx
mov rdx, rdi
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013e8a0
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x1401396ab
inc r8
mov rdx, qword [rbp - 0x21]
lea rcx, [rbp - 0x21]
call fcn.1400be810
mov qword [rbp - 9], 7
mov qword [rbp - 0x11], rsi
mov word [rbp - 0x21], si
lea rcx, [rbp - 1]
call fcn.1400cb8c0
jmp 0x14013986c
movzx eax, byte [rdi]
cmp al, 0xff
jne 0x140139749
cmp byte [rdi + 1], 0xfe
jne 0x140139749
cmp word [rdi], 0
jne 0x1401396e3
xor esi, esi
mov r8d, esi
jmp 0x1401396fb
mov r8, rbx
nop word [rax + rax]
inc r8
cmp word [rdi + r8*2], 0
jne 0x1401396f0
mov rdx, rdi
mov rcx, r14
call fcn.1400be520
mov r9, rbx
mov r8d, 1
lea rdx, [rbp - 1]
mov rcx, r14
call fcn.1400c9080
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp + 0x17]
cmp r8, 8
jb 0x14013986a
inc r8
mov rdx, qword [rbp - 1]
lea rcx, [rbp - 1]
call fcn.1400be810
jmp 0x14013986a
cmp al, 0xef
jne 0x1401397ea
cmp byte [rdi + 1], 0xbb
jne 0x1401397ea
cmp byte [rdi + 2], 0xbf
jne 0x1401397ea
lea rdx, [rdi + 3]
mov qword [rbp + 0x17], reloc.OLEAUT32.dll_SafeArrayDestroy
xor esi, esi
mov qword [rbp + 0xf], rsi
mov byte [rbp - 1], sil
cmp byte [rdx], sil
jne 0x140139784
mov ebx, esi
jmp 0x14013978d
inc rbx
cmp byte [rdx + rbx], sil
jne 0x140139784
mov r8, rbx
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013e8a0
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x1401397cc
inc r8
mov rdx, qword [rbp - 0x21]
lea rcx, [rbp - 0x21]
call fcn.1400be810
mov qword [rbp - 9], 7
mov qword [rbp - 0x11], rsi
mov word [rbp - 0x21], si
lea rcx, [rbp - 1]
call fcn.1400cb8c0
jmp 0x14013986c
mov qword [rbp + 0x17], reloc.OLEAUT32.dll_SafeArrayDestroy
xor esi, esi
mov qword [rbp + 0xf], rsi
mov byte [rbp - 1], sil
test al, al
jne 0x140139804
mov ebx, esi
jmp 0x14013980d
inc rbx
cmp byte [rdi + rbx], sil
jne 0x140139804
mov r8, rbx
mov rdx, rdi
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013e8a0
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x14013984f
inc r8
mov rdx, qword [rbp - 0x21]
lea rcx, [rbp - 0x21]
call fcn.1400be810
mov qword [rbp - 9], 7
mov qword [rbp - 0x11], rsi
mov word [rbp - 0x21], si
lea rcx, [rbp - 1]
call fcn.1400cb8c0
jmp 0x14013986c
xor esi, esi
mov ebx, esi
mov rcx, rdi
call fcn.1401aa290
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1401398a4
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jb 0x1401398a4
cmp eax, 3
jbe 0x14013989d
cmp eax, 5
jne 0x1401398a4
mov eax, 0xffffffea
jmp 0x1401398a6
mov eax, 0xffffffe4
jmp 0x1401398a6
mov eax, ebx
mov rcx, qword [rbp + 0x1f]
xor rcx, rsp
call fcn.1401646e0
mov rbx, qword [rsp + 0xe8]
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret