Function at 0x140139bd0
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 [0x14027f238]
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.140137ce0
mov rcx, rax
lea rdx, [rbp - 0x21]
call fcn.140137d60
cmp qword [rdi + 0x18], 8
jb 0x140139c5f
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 0x14013a061
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp eax, 0xffffffff
je 0x14013a056
lea ecx, [rax + 2]
call fcn.1401aab10
mov rdi, rax
test rax, rax
je 0x14013a056
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 0x14013a04e
mov eax, dword [rbp - 0x39]
cmp eax, esi
jne 0x14013a04e
mov byte [rax + rdi], 0
mov eax, dword [rbp - 0x39]
mov byte [rax + rdi + 1], 0
mov eax, dword [r15]
test eax, eax
je 0x140139ea9
cmp eax, 2
jne 0x140139d84
cmp word [rdi], 0
jne 0x140139d14
xor esi, esi
mov r8d, esi
jmp 0x140139d2d
mov r8, rbx
nop word [rax + rax]
inc r8
cmp word [rdi + r8*2], 0
jne 0x140139d20
xor esi, esi
mov rdx, rdi
mov rcx, r14
call fcn.1400be520
test r12b, r12b
je 0x14013a04c
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 0x14013a04c
inc r8
mov rdx, qword [rbp - 1]
lea rcx, [rbp - 1]
call fcn.1400be810
jmp 0x14013a04c
cmp eax, 1
jne 0x140139e16
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 0x140139db0
mov ebx, esi
jmp 0x140139db9
inc rbx
cmp byte [rdx + rbx], sil
jne 0x140139db0
mov r8, rbx
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013f080
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x140139df8
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 0x14013a04c
cmp eax, 3
jne 0x14013a04e
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 0x140139e40
mov ebx, esi
jmp 0x140139e49
inc rbx
cmp byte [rdi + rbx], sil
jne 0x140139e40
mov r8, rbx
mov rdx, rdi
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013f080
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x140139e8b
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 0x14013a04c
movzx eax, byte [rdi]
cmp al, 0xff
jne 0x140139f29
cmp byte [rdi + 1], 0xfe
jne 0x140139f29
cmp word [rdi], 0
jne 0x140139ec3
xor esi, esi
mov r8d, esi
jmp 0x140139edb
mov r8, rbx
nop word [rax + rax]
inc r8
cmp word [rdi + r8*2], 0
jne 0x140139ed0
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 0x14013a04a
inc r8
mov rdx, qword [rbp - 1]
lea rcx, [rbp - 1]
call fcn.1400be810
jmp 0x14013a04a
cmp al, 0xef
jne 0x140139fca
cmp byte [rdi + 1], 0xbb
jne 0x140139fca
cmp byte [rdi + 2], 0xbf
jne 0x140139fca
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 0x140139f64
mov ebx, esi
jmp 0x140139f6d
inc rbx
cmp byte [rdx + rbx], sil
jne 0x140139f64
mov r8, rbx
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013f080
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x140139fac
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 0x14013a04c
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 0x140139fe4
mov ebx, esi
jmp 0x140139fed
inc rbx
cmp byte [rdi + rbx], sil
jne 0x140139fe4
mov r8, rbx
mov rdx, rdi
lea rcx, [rbp - 1]
call fcn.1400ccaa0
nop
lea rdx, [rbp - 1]
lea rcx, [rbp - 0x21]
call fcn.14013f080
mov rdx, rax
mov rcx, r14
call fcn.1400c44d0
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x14013a02f
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 0x14013a04c
xor esi, esi
mov ebx, esi
mov rcx, rdi
call fcn.1401aaaf0
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14013a084
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jb 0x14013a084
cmp eax, 3
jbe 0x14013a07d
cmp eax, 5
jne 0x14013a084
mov eax, 0xffffffea
jmp 0x14013a086
mov eax, 0xffffffe4
jmp 0x14013a086
mov eax, ebx
mov rcx, qword [rbp + 0x1f]
xor rcx, rsp
call fcn.140164ec0
mov rbx, qword [rsp + 0xe8]
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret