Function at 0x100045680
Capabilities:
Read file on windows
Write file on windows

Disassembly:
mov rax, rsp
sub rsp, 0x68
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax - 8], r12
mov qword [rax - 0x10], r13
mov rsi, rcx
mov qword [rax - 0x18], r14
mov r13d, 2
mov ecx, 0x10000
mov ebp, edx
mov r14d, r13d
call qword [sym.imp.msvcrt.dll_malloc]
test rax, rax
mov r12, rax
jne 0x1000456c5
lea eax, [r13 + 0xc]
jmp 0x1000458c1
mov r8d, dword [rsi + 8]
mov qword [rsp + 0x70], rbx
mov qword [rsp + 0x88], rdi
mov eax, r8d
mov edi, 0x200
mov ecx, ebp
cdq
mov qword [rsp + 0x48], r15
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, r8d
cmp ecx, edi
cdq
cmovl edi, ecx
and edx, 3
lea ebx, [rdx + rax]
sar ebx, 2
add ebx, ebx
sub ebx, edi
xor r15d, r15d
lea ebx, [rbx + rdi - 2]
lea ecx, [rdi + rbx]
cmp ecx, ebp
jle 0x100045722
cmp ebx, ebp
jge 0x1000457fb
mov edi, ebp
mov r14d, 1
sub edi, ebx
mov rcx, qword [rsi]
xor r9d, r9d
xor r8d, r8d
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [rsi]
lea r9, [rsp + 0x30]
mov r8d, edi
mov rdx, r12
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1000458a9
lea rdx, [0x100003260]
mov rcx, r12
call qword [sym.imp.msvcrt.dll_wcsstr]
add r14d, 0xffffffff
jne 0x100045705
test rax, rax
mov r14d, ebp
mov edi, r15d
cmove rax, r12
sub rax, r12
sar rax, 1
lea ebx, [rbx + rax*2 + 4]
sub r14d, ebx
shr r14d, 0x10
je 0x10004582b
nop
mov rcx, qword [rsi]
xor r9d, r9d
xor r8d, r8d
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [rsi]
lea r9, [rsp + 0x34]
mov r8d, 0x10000
mov rdx, r12
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100045805
mov rcx, qword [rsi]
xor r9d, r9d
xor r8d, r8d
mov edx, r13d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [rsi]
lea r9, [rsp + 0x38]
mov r8d, 0x10000
mov rdx, r12
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100045813
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x10004580b
mov eax, VariantTimeToDosDateTime
jmp 0x1000458af
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1000458af
inc edi
add ebx, 0x10000
add r13d, 0x10000
cmp edi, r14d
jb 0x100045790
mov rcx, qword [rsi]
xor r9d, r9d
xor r8d, r8d
mov edx, ebx
sub ebp, ebx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [rsi]
lea r9, [rsp + 0x38]
mov r8d, ebp
mov rdx, r12
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100045892
mov rcx, qword [rsi]
xor r9d, r9d
xor r8d, r8d
mov edx, r13d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [rsi]
lea r9, [rsp + 0x34]
mov r8d, ebp
mov rdx, r12
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10004589c
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x100045898
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1000458af
mov rcx, qword [rsi]
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
xor eax, eax
jmp 0x1000458af
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdi, qword [rsp + 0x88]
mov rbx, qword [rsp + 0x70]
mov r15, qword [rsp + 0x48]
mov r14, qword [rsp + 0x50]
mov r13, qword [rsp + 0x58]
mov r12, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x80]
mov rbp, qword [rsp + 0x78]
add rsp, 0x68
ret