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

Disassembly:
push rbx
push rdi
push r12
push r13
push r14
sub rsp, 0x90
mov rax, qword [0x180185680]
xor rax, rsp
mov qword [rsp + 0x60], rax
mov r12, qword [rsp + 0xe0]
mov r13, r8
mov qword [rsp + 0x48], r12
mov r14, rcx
mov edi, r9d
test r9d, r9d
jne 0x180019288
xor ebx, ebx
mov dword [r12], ebx
lea eax, [rbx + 1]
jmp 0x1800194eb
mov r8, qword [rcx + 0xc6]
cmp rdx, r8
jb 0x1800192ac
xor ebx, ebx
mov ecx, 0x44c
mov dword [r12], ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x1800194eb
mov rcx, r8
mov qword [rsp + 0x88], rbp
sub r8d, edx
mov qword [rsp + 0x80], rsi
sub rcx, rdx
mov qword [rsp + 0x78], r15
mov r15d, dword [r14 + 0xc2]
cmp rcx, rdi
mov rcx, qword [r14]
mov eax, r15d
cmovb edi, r8d
mov dword [rsp + 0x38], r15d
neg eax
lea r8, [rsp + 0x5c]
mov dword [rsp + 0x34], eax
lea ebp, [r15 - 1]
mov eax, ebp
xor r9d, r9d
and eax, edx
sub rdx, rax
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x58], rdx
mov qword [rsp + 0x40], rax
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x180019323
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x180019510
xor ebx, ebx
mov esi, ebx
cmp dword [rsp + 0x30], ebx
je 0x1800193f5
mov rcx, r15
lea rdx, [0x1801423a8]
call fcn.18010fb14
mov r12, rax
test rax, rax
je 0x180019510
mov rcx, qword [r14]
lea r9, [rsp + 0x50]
mov r8d, r15d
mov qword [rsp + 0x20], rbx
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1800193e6
mov ecx, r15d
mov rdx, r13
sub ecx, dword [rsp + 0x30]
cmp ecx, edi
cmovae ecx, edi
mov esi, ecx
mov rcx, qword [rsp + 0x40]
mov r8d, esi
add rcx, r12
call fcn.180112cb0
mov edx, dword [rsp + 0x34]
lea r9d, [rbx + 1]
mov rcx, qword [r14]
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x1800193ad
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1800193e6
mov rcx, qword [r14]
lea r9, [rsp + 0x50]
mov r8d, r15d
mov qword [rsp + 0x20], rbx
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, r12
mov r15d, eax
call sym.SafeBase64.dll_SafeBase_free
test r15d, r15d
je 0x180019510
mov r12, qword [rsp + 0x48]
add r13, rsi
sub edi, esi
jmp 0x1800193fa
mov rcx, r12
call sym.SafeBase64.dll_SafeBase_free
xor eax, eax
jmp 0x1800194d6
mov r15d, dword [rsp + 0x38]
not ebp
and ebp, edi
je 0x18001942d
mov rcx, qword [r14]
lea r9, [rsp + 0x50]
mov r8d, ebp
mov qword [rsp + 0x20], rbx
mov rdx, r13
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r15d, eax
test eax, eax
je 0x180019510
mov eax, ebp
sub edi, ebp
add r13, rax
add esi, ebp
test edi, edi
je 0x1800194cf
mov r15d, dword [rsp + 0x38]
lea rdx, [0x1801423a8]
mov ecx, r15d
call fcn.18010fb14
mov rbp, rax
test rax, rax
je 0x180019510
mov rcx, qword [r14]
lea r9, [rsp + 0x50]
mov r8d, r15d
mov qword [rsp + 0x20], rbx
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180019508
mov r8d, edi
mov rdx, r13
mov rcx, rbp
call fcn.180112cb0
mov edx, dword [rsp + 0x34]
mov r9d, 1
mov rcx, qword [r14]
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x1800194a9
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x180019508
mov rcx, qword [r14]
lea r9, [rsp + 0x50]
mov r8d, r15d
mov qword [rsp + 0x20], rbx
mov rdx, rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbp
mov r15d, eax
call sym.SafeBase64.dll_SafeBase_free
add esi, edi
mov dword [r12], esi
mov eax, r15d
mov rsi, qword [rsp + 0x80]
mov rbp, qword [rsp + 0x88]
mov r15, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.18010faf0
add rsp, 0x90
pop r14
pop r13
pop r12
pop rdi
pop rbx
ret
mov rcx, rbp
call sym.SafeBase64.dll_SafeBase_free
xor eax, eax
jmp 0x1800194d6