Function at 0x140001650
Capabilities:
Get file size
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
push r14
push r15
mov rbp, rsp
sub rsp, 0x60
xor edi, edi
xor r9d, r9d
cmp byte [0x140007700], r9b
mov ebx, r8d
mov rsi, rdx
mov qword [rsp + 0x30], rdi
mov r15, rcx
mov edx, 0x80000000
lea r8d, [rdi + 1]
jne 0x140001710
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov r14, rax
cmp rax, 0xffffffffffffffff
je 0x140001709
test ebx, ebx
jg 0x1400016c6
lea rdx, [rbp - 0x18]
mov qword [rbp - 0x18], rdi
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov r15d, dword [rbp - 0x18]
jmp 0x1400016c9
mov r15d, ebx
lea r9, [rbp + 0x48]
mov qword [rsp + 0x20], rdi
mov r8d, r15d
mov rdx, rsi
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [rbp + 0x48], ebx
je 0x1400016fb
test ebx, ebx
jle 0x1400016fb
mov r8d, r15d
lea rcx, str.Failed_to_read__d_bytes__read_only__d_n
mov edx, ebx
call fcn.140001320
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 1
mov eax, edi
jmp 0x1400018f3
mov dword [rsp + 0x28], 0x20000080
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov r14, rax
cmp rax, 0xffffffffffffffff
jne 0x1400017e1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8, r15
lea rcx, str.CreateFile_failed__error__d___s_n
mov edx, eax
call fcn.140001320
mov qword [rsp + 0x30], rdi
lea r8d, [r14 + 2]
mov dword [rsp + 0x28], 0x80
xor r9d, r9d
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov r15, rax
cmp rax, r14
je 0x140001709
test ebx, ebx
jg 0x140001797
lea rdx, [rbp - 0x18]
mov qword [rbp - 0x18], rdi
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov r14d, dword [rbp - 0x18]
jmp 0x14000179a
mov r14d, ebx
lea r9, [rbp + 0x48]
mov qword [rsp + 0x20], rdi
mov r8d, r14d
mov rdx, rsi
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [rbp + 0x48], ebx
je 0x1400017cc
test ebx, ebx
jle 0x1400017cc
mov r8d, r14d
lea rcx, str.Failed_to_read__d_bytes__read_only__d_n
mov edx, ebx
call fcn.140001320
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 1
mov eax, edi
jmp 0x1400018f3
test ebx, ebx
jg 0x140001898
lea rdx, [rbp - 0x10]
mov qword [rbp - 0x10], rdi
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x140001895
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8, r15
lea rcx, str.GetFileSizeEx_failed__error__d___s_n
mov edx, eax
call fcn.140001320
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor r9d, r9d
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov edx, 0x80000000
mov rcx, r15
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x140001709
lea rdx, [rbp - 0x18]
mov qword [rbp - 0x18], rdi
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov r8d, dword [rbp - 0x18]
lea r9, [rbp + 0x48]
mov rdx, rsi
mov qword [rsp + 0x20], rdi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 1
mov eax, edi
jmp 0x1400018f3
mov ebx, dword [rbp - 0x10]
mov qword [rsp + 0x90], r12
test ebx, ebx
je 0x1400018dd
mov r12d, 0x4000000
nop word [rax + rax]
mov r8d, ebx
mov qword [rsp + 0x20], rdi
cmp ebx, r12d
lea r9, [rbp - 0x20]
mov rdx, rsi
mov rcx, r14
cmovge r8d, r12d
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140001907
mov ecx, dword [rbp - 0x20]
add rsi, rcx
sub ebx, ecx
jne 0x1400018b0
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
mov r12, qword [rsp + 0x90]
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8, r15
lea rcx, str.ReadFile_failed__error__d___s_n
mov edx, eax
call fcn.140001320
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor r9d, r9d
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov edx, 0x80000000
mov rcx, r15
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov r15, rax
cmp rax, 0xffffffffffffffff
je 0x1400019b8
test ebx, ebx
jg 0x140001975
lea rdx, [rbp - 0x10]
mov qword [rbp - 0x10], rdi
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov r14d, dword [rbp - 0x10]
jmp 0x140001978
mov r14d, ebx
lea r9, [rbp + 0x48]
mov qword [rsp + 0x20], rdi
mov r8d, r14d
mov rdx, rsi
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [rbp + 0x48], ebx
je 0x1400019aa
test ebx, ebx
jle 0x1400019aa
mov r8d, r14d
lea rcx, str.Failed_to_read__d_bytes__read_only__d_n
mov edx, ebx
call fcn.140001320
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 1
mov eax, edi
jmp 0x1400018eb