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

Disassembly:
mov r11, rsp
mov qword [r11 + 8], rsi
mov qword [r11 + 0x20], r9
mov qword [r11 + 0x18], r8
mov qword [r11 + 0x10], rdx
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x70
xor r14d, r14d
mov qword [r11 - 0x40], r14
xor edi, edi
mov qword [r11 - 0x38], rdi
or r13, 0xffffffffffffffff
mov qword [r11 - 0x50], r13
and dword [rsp + 0x50], edi
xor eax, eax
mov dword [rsp + 0x54], eax
xor r15d, r15d
mov dword [r11 - 0x58], r15d
xor esi, esi
and qword [r11 - 0x68], rsi
mov dword [rsp + 0x28], 0x4000000
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x80000000
lea r8d, [r14 + 7]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r12, rax
mov qword [rsp + 0x48], rax
cmp rax, r13
jne 0x100004700
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x1000048dc
lea rdx, [rsp + 0x50]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x10000471f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x1000048dc
mov r15d, dword [rsp + 0x50]
mov eax, 0x400000
cmp r15d, eax
cmova r15d, eax
mov ecx, r15d
call qword [sym.imp.msvcrt.dll_malloc]
mov r14, rax
mov qword [rsp + 0x58], rax
test rax, rax
jne 0x100004753
lea esi, [rax + 8]
mov r15d, dword [rsp + 0x40]
jmp 0x1000048dc
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x44]
mov r8d, r15d
mov rdx, rax
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x100004783
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov r15d, dword [rsp + 0x40]
jmp 0x1000048dc
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r12, r13
mov qword [rsp + 0x48], r13
mov rcx, qword [rsp + 0xb8]
call qword [sym.imp.ADVAPI32.dll_ImpersonateNamedPipeClient]
mov dword [rsp + 0x40], eax
test eax, eax
jne 0x1000047bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov r15d, dword [rsp + 0x40]
jmp 0x1000048dc
xor eax, eax
mov rcx, r13
mov rdi, qword [rsp + 0xa8]
repne scasw ax, word [rdi]
not rcx
lea rdx, [rcx - 1]
mov rcx, r13
mov rdi, qword [rsp + 0xb0]
repne scasw ax, word [rdi]
not rcx
lea rax, [rdx + rcx + 5]
mov qword [rsp + 0x68], rax
lea rcx, [rax + rax]
call qword [sym.imp.msvcrt.dll_malloc]
mov rdi, rax
mov qword [rsp + 0x60], rax
test rax, rax
jne 0x100004812
lea esi, [rax + 8]
mov r15d, dword [rsp + 0x40]
jmp 0x1000048dc
mov rax, qword [rsp + 0xb0]
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0x30], rax
lea rax, [0x1000019a8]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x800
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [rsp + 0x68]
mov rcx, rdi
call fcn.1000042c8
test eax, eax
jns 0x100004863
mov esi, 0xa1
mov r15d, dword [rsp + 0x40]
jmp 0x1000048dc
and qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [r9 + 7]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r12, rax
mov qword [rsp + 0x48], rax
cmp rax, r13
jne 0x1000048aa
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov r15d, dword [rsp + 0x40]
jmp 0x1000048dc
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x44]
mov r8d, r15d
mov rdx, r14
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1000048d7
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov r15d, dword [rsp + 0x40]
jmp 0x1000048dc
mov r15d, dword [rsp + 0x40]
test r15d, r15d
je 0x1000048e7
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
cmp r12, r13
je 0x1000048f5
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r14, r14
je 0x100004903
mov rcx, r14
call qword [sym.imp.msvcrt.dll_free]
test rdi, rdi
je 0x100004911
mov rcx, rdi
call qword [sym.imp.msvcrt.dll_free]
mov eax, esi
mov rsi, qword [rsp + 0xa0]
add rsp, 0x70
pop r15
pop r14
pop r13
pop r12
pop rdi
ret