Function at 0x140221b70
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push rbx
push rbp
push rdi
push r14
push r15
sub rsp, 0xc0
mov r14, rdx
xor ebx, ebx
mov r15, r8
mov qword [rsp + 0x30], rbx
lea r8d, [rbx + 3]
xor r9d, r9d
mov edx, 0x80000000
mov rcx, r14
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
mov rdi, rax
jne 0x140221bbf
mov rdi, rbx
jmp 0x140221bf4
xor eax, eax
lea rdx, [rsp + 0x60]
mov rcx, rdi
mov qword [rsp + 0x60], rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x140221be6
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdi, rbx
jmp 0x140221bf4
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdi, qword [rsp + 0x60]
xor r9d, r9d
mov qword [rsp + 0x30], rbx
mov edx, 0x80000000
lea r8d, [r9 + 3]
mov rcx, r14
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
mov rbp, rax
jne 0x140221c38
xor eax, eax
add rsp, 0xc0
pop r15
pop r14
pop rdi
pop rbp
pop rbx
ret
lea rcx, [rsp + 0x70]
mov rdx, r15
call qword [sym.imp.ntdll.dll_RtlInitUnicodeString]
mov dword [rsp + 0x50], ebx
mov qword [rsp + 0x48], rbx
mov dword [rsp + 0x40], 0x60
lea rax, [rsp + 0x70]
mov dword [rsp + 0x38], 5
mov qword [rsp + 0xa0], rax
mov eax, 1
lea r9, [rsp + 0x80]
mov dword [rsp + 0x30], eax
lea r8, [rsp + 0x90]
lea rcx, [rsp + 0x68]
mov edx, 0xc0100000
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x90], 0x30
mov qword [rsp + 0x20], rbx
mov qword [rsp + 0x98], rbx
mov dword [rsp + 0xa8], 0x40
mov qword [rsp + 0xb0], rbx
mov qword [rsp + 0xb8], rbx
mov qword [rsp + 0x68], rbx
call qword [sym.imp.ntdll.dll_ZwCreateFile]
test eax, eax
jne 0x140221c27
mov qword [rsp + 0xf0], rsi
mov qword [rsp + 0xf8], r12
mov ecx, 0x400000
mov qword [rsp + 0x100], r13
mov r12d, ebx
call sub.MFC80U.DLL_Ordinal_265
lea r9, [rsp + 0x108]
mov r8d, 0x400000
mov rcx, rbp
mov rdx, rax
mov rsi, rax
mov dword [rsp + 0x108], ebx
mov r13, rbx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140221d95
mov r8d, dword [rsp + 0x108]
test r8d, r8d
je 0x140221d95
mov rcx, qword [rsp + 0x68]
lea r9, [rsp + 0x60]
mov rdx, rsi
add r13, r8
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140221d83
lea r9, [rsp + 0x108]
mov r8d, 0x400000
mov rdx, rsi
mov rcx, rbp
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140221d32
jmp 0x140221d95
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
mov eax, 1
cmove r12d, eax
mov rcx, rsi
call sub.MFC80U.DLL_Ordinal_266
test r12d, r12d
jne 0x140221e01
cmp rdi, r13
jle 0x140221e01
sub edi, r13d
movsxd rcx, edi
call sub.MFC80U.DLL_Ordinal_265
lea r9, [rsp + 0x108]
mov r8d, edi
mov rcx, rbp
mov rdx, rax
mov qword [rsp + 0x20], rbx
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140221df9
cmp dword [rsp + 0x108], ebx
jbe 0x140221df9
mov rcx, qword [rsp + 0x68]
lea r9, [rsp + 0x60]
mov r8d, edi
mov rdx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rsi
call sub.MFC80U.DLL_Ordinal_266
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov rcx, r15
mov edx, eax
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov r13, qword [rsp + 0x100]
mov rsi, qword [rsp + 0xf0]
test r12d, r12d
mov r12, qword [rsp + 0xf8]
sete bl
mov eax, ebx
add rsp, 0xc0
pop r15
pop r14
pop rdi
pop rbp
pop rbx
ret