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

Disassembly:
push rbx
push rsi
push r13
push r14
push r15
sub rsp, 0x50
mov r14, rdx
xor r13d, r13d
mov r15, r8
mov qword [rsp + 0x30], r13
lea r8d, [r13 + 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 rbx, rax
jne 0x140055b7e
mov rbx, r13
jmp 0x140055bb3
xor eax, eax
lea rdx, [rsp + 0x40]
mov rcx, rbx
mov qword [rsp + 0x40], rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x140055ba5
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, r13
jmp 0x140055bb3
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, qword [rsp + 0x40]
xor r9d, r9d
mov qword [rsp + 0x30], r13
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 rsi, rax
jne 0x140055bf5
xor eax, eax
add rsp, 0x50
pop r15
pop r14
pop r13
pop rsi
pop rbx
ret
xor r9d, r9d
mov qword [rsp + 0x30], r13
mov edx, 0x40000000
lea r8d, [r9 + 3]
mov rcx, r15
mov dword [rsp + 0x28], 0x80
mov qword [rsp + 0x80], rbp
mov dword [rsp + 0x20], 4
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
mov rbp, rax
jne 0x140055c37
xor eax, eax
jmp 0x140055d8c
mov qword [rsp + 0x88], rdi
mov ecx, 0x400000
mov qword [rsp + 0x90], r12
mov r12d, r13d
call sub.MFC80U.DLL_Ordinal_774
lea r9, [rsp + 0x98]
mov r8d, 0x400000
mov rcx, rsi
mov rdx, rax
mov rdi, rax
mov dword [rsp + 0x98], r13d
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140055ce3
mov r8d, dword [rsp + 0x98]
test r8d, r8d
je 0x140055ce3
lea r9, [rsp + 0x40]
mov rdx, rdi
mov rcx, rbp
add r13, r8
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140055cd1
lea r9, [rsp + 0x98]
mov r8d, 0x400000
mov rdx, rdi
mov rcx, rsi
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140055c82
jmp 0x140055ce3
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
mov eax, 1
cmove r12d, eax
mov rcx, rdi
call sub.MFC80U.DLL_Ordinal_776
test r12d, r12d
jne 0x140055d51
cmp rbx, r13
jle 0x140055d51
sub ebx, r13d
movsxd rcx, ebx
call sub.MFC80U.DLL_Ordinal_774
lea r9, [rsp + 0x98]
xor r12d, r12d
mov r8d, ebx
mov rcx, rsi
mov rdx, rax
mov rdi, rax
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140055d49
cmp dword [rsp + 0x98], r12d
jbe 0x140055d49
lea r9, [rsp + 0x40]
mov r8d, ebx
mov rdx, rdi
mov rcx, rbp
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rdi
call sub.MFC80U.DLL_Ordinal_776
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rbp
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 r12, qword [rsp + 0x90]
mov rdi, qword [rsp + 0x88]
mov eax, 1
mov rbp, qword [rsp + 0x80]
add rsp, 0x50
pop r15
pop r14
pop r13
pop rsi
pop rbx
ret