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

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x40
xor edi, edi
or r14, 0xffffffffffffffff
and dword [rbp + 0x40], edi
mov rbx, rdx
mov rsi, rcx
test rcx, rcx
je 0x140016648
test rdx, rdx
je 0x140016648
xor edx, edx
mov r8d, 0xc18
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
and qword [rsp + 0x30], rdi
lea r12d, [rdi + 1]
mov r8d, r12d
mov dword [rsp + 0x28], 0x80
xor r9d, r9d
mov dword [rsp + 0x20], 3
mov edx, 0x80000000
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CreateFileW]
nop dword [rax + rax]
mov r14, rax
cmp rax, 0xffffffffffffffff
jne 0x14001643b
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
lea edx, [r12 + 1]
mov r8, rbx
mov r9d, eax
mov edi, eax
lea ecx, [rdx + 0x66]
call fcn.140019b7c
jmp 0x140016666
lea rdx, [rbp + 0x40]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetFileSize]
nop dword [rax + rax]
mov r9d, 0x4000000
mov r15d, eax
cmp dword [rbp + 0x40], edi
ja 0x140016631
cmp eax, r9d
ja 0x140016631
lea ecx, [rax + 0x1fff]
and ecx, 0xffffe000
cmp ecx, eax
cmovb ecx, eax
mov r13d, ecx
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8d, r13d
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
nop dword [rax + rax]
mov qword [rsi], rax
test rax, rax
jne 0x1400164c3
lea edx, [rax + 2]
mov r8d, 0x180
lea ecx, [rax + 0x66]
call fcn.140019b7c
mov edi, 0xe
jmp 0x14001664d
and qword [rsp + 0x20], rdi
lea r9, [rbp + 0x40]
mov r8d, r15d
mov rdx, rax
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
nop dword [rax + rax]
test eax, eax
jne 0x14001650b
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov edx, 2
mov r8, rbx
mov r9d, eax
mov edi, eax
lea ecx, [rdx + 0x68]
call fcn.140019b7c
jmp 0x14001664d
mov edx, dword [rbp + 0x40]
lea r8, [rbp + 0x50]
mov rcx, qword [rsi]
mov dword [rbp + 0x50], 0x1000
call qword [sym.imp.ADVAPI32.dll_IsTextUnicode]
nop dword [rax + rax]
test eax, eax
jne 0x14001662c
mov r12, qword [rsi]
lea r15, [r13*2]
mov rax, r15
sar rax, 0x20
test eax, eax
je 0x140016566
and qword [rsi], rdi
mov edx, 2
mov r8d, 0x196
lea ecx, [rdx + 0x64]
call fcn.140019b7c
mov edi, 0x216
jmp 0x14001660a
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8d, r15d
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
nop dword [rax + rax]
mov qword [rsi], rax
test rax, rax
jne 0x1400165a9
lea edx, [rax + 2]
mov r8d, 0x19c
lea ecx, [rax + 0x66]
call fcn.140019b7c
mov edi, 0xe
jmp 0x14001660a
mov r9d, dword [rbp + 0x40]
mov r8, r12
shr r15d, 1
xor edx, edx
mov dword [rsp + 0x28], r15d
xor ecx, ecx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
nop dword [rax + rax]
mov dword [rbp + 0x40], eax
cmp eax, 0x459
jne 0x1400165de
mov edi, 0xd
jmp 0x1400165f4
test eax, eax
jne 0x14001660a
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov edi, eax
test eax, eax
je 0x14001660a
mov edx, 2
mov r9d, edi
mov r8d, 0x1a9
lea ecx, [rdx + 0x69]
call fcn.140019b7c
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
nop dword [rax + rax]
mov r8, r12
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
nop dword [rax + rax]
jmp 0x14001664d
shr dword [rbp + 0x40], 1
jmp 0x14001664d
mov r8, rbx
mov edx, r12d
mov ecx, 0x69
call fcn.140019b7c
mov edi, 0x216
jmp 0x14001664d
mov edi, 0x57
lea rax, [r14 - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140016666
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
test edi, edi
jne 0x140016682
mov rdx, qword [rsi]
mov eax, dword [rbp + 0x40]
mov qword [rsi + 0x18], rdx
mov qword [rsi + 0x28], rdx
lea rcx, [rdx + rax*2]
mov qword [rsi + 8], rcx
jmp 0x14001668a
mov rcx, rsi
call fcn.140016338
mov rbx, qword [rsp + 0x88]
mov eax, edi
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret