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

Disassembly:
mov qword [rsp + 0x20], rbx
mov qword [rsp + 0x18], r8
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
cmp qword [rdx + 8], 0
mov rsi, r9
mov rcx, qword [rdx]
mov rdi, r8
mov qword [rsp + 0x38], rcx
mov rbx, rdx
je 0x14005a250
cmp r9, 0xffffffffffffffff
jne 0x140059fa4
mov rsi, qword [rdx + 0x30]
mov rax, qword [rsp + 0xb8]
xor ebp, ebp
test rax, rax
je 0x140059fb5
mov dword [rax], ebp
mov r12d, dword [rsp + 0xb0]
test r12d, r12d
je 0x14005a2ca
nop word [rax + rax]
mov rax, qword [rbx + 0x20]
test rax, rax
je 0x14005a148
mov rcx, qword [rbx + 0x18]
cmp rsi, rcx
jb 0x14005a143
add rax, rcx
cmp rsi, rax
jae 0x14005a143
mov r15d, dword [rbx + 0x20]
mov rdx, rdi
mov r14, qword [rbx + 8]
sub r15d, esi
add r15d, ecx
cmp r15d, r12d
cmova r15d, r12d
sub r14, rcx
add r14, rsi
mov r8d, r15d
mov rcx, r14
call fcn.1400b4ef0
mov eax, dword [rbx + 0x14]
mov dword [rsp + 0x98], ebp
lea ecx, [rax - 1]
mov r13d, ecx
not ecx
and r13d, esi
lea edi, [rax + r13]
mov eax, r13d
sub r14, rax
dec edi
mov qword [rsp + 0x40], r14
add edi, r15d
and edi, ecx
mov r14, rsi
sub r14, rax
mov dword [rsp + 0x34], edi
cmp r14, 0xffffffffffffffff
je 0x14005a072
mov rcx, qword [rsp + 0x38]
xor r9d, r9d
xor r8d, r8d
mov rdx, r14
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x14005a0ad
mov rdx, qword [rsp + 0x40]
lea r9, [rsp + 0x98]
mov rcx, qword [rsp + 0x38]
mov r8d, edi
mov qword [rsp + 0x20], rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14005a0ad
mov ecx, dword [rsp + 0x98]
mov edi, ebp
cmp ecx, dword [rsp + 0x34]
mov eax, 0x1d
cmovne edi, eax
jmp 0x14005a0bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rsp + 0x98]
mov edi, eax
mov eax, ecx
add r14, rax
cmp ecx, r13d
jbe 0x14005a0e8
mov rax, qword [rsp + 0xb8]
sub ecx, r13d
cmp ecx, r15d
cmova ecx, r15d
test rax, rax
je 0x14005a0df
add dword [rax], ecx
mov eax, ecx
add rax, rsi
mov qword [rbx + 0x30], rax
mov rax, qword [rbx + 0x30]
cmp rax, qword [rbx + 0x28]
jbe 0x14005a0f6
mov qword [rbx + 0x28], rax
mov r8, qword [rbx + 0x28]
cmp r14, r8
jbe 0x14005a11a
mov rcx, qword [rsp + 0x90]
mov rdx, rbx
mov rax, qword [rcx]
call qword [rax + 0x28]
test edi, edi
jne 0x14005a23a
mov edi, eax
test edi, edi
jne 0x14005a23a
mov rdi, qword [rsp + 0xa0]
mov eax, r15d
add rdi, rax
add rsi, rax
mov qword [rsp + 0xa0], rdi
sub r12d, r15d
jmp 0x14005a227
mov rcx, qword [rsp + 0x38]
mov r15d, dword [rbx + 0x14]
mov rdx, rsi
mov edi, dword [rbx + 0x10]
lea r14d, [r15 - 1]
and r14d, esi
sub edi, r14d
mov eax, r14d
sub rdx, rax
cmp edi, r12d
mov qword [rbx + 0x18], rdx
cmova edi, r12d
test r14d, r14d
jne 0x14005a17b
cmp edi, r15d
jae 0x14005a200
cmp rdx, qword [rbx + 0x28]
jb 0x14005a18a
mov rcx, qword [rbx + 8]
mov r8, r15
jmp 0x14005a1f9
mov r13, qword [rbx + 8]
mov dword [rsp + 0x30], ebp
cmp rdx, 0xffffffffffffffff
je 0x14005a1a8
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x14005a1c7
mov rcx, qword [rsp + 0x38]
lea r9, [rsp + 0x30]
mov r8d, r15d
mov qword [rsp + 0x20], rbp
mov rdx, r13
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x14005a1d1
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x14005a245
mov edx, dword [rsp + 0x30]
mov r8d, dword [rbx + 0x14]
cmp edx, r8d
je 0x14005a200
mov rcx, qword [rbx + 0x28]
sub rcx, qword [rbx + 0x18]
cmp rdx, rcx
jne 0x14005a245
cmp edx, r8d
jae 0x14005a200
sub r8d, edx
mov ecx, edx
add rcx, qword [rbx + 8]
xor edx, edx
call fcn.1400b5f30
mov eax, dword [rbx + 0x14]
lea edx, [r14 + rdi]
mov rdi, qword [rsp + 0xa0]
cmp edx, eax
jbe 0x14005a223
lea ecx, [rax - 1]
mov eax, edx
not ecx
and rcx, rax
mov qword [rbx + 0x20], rcx
jmp 0x14005a227
mov qword [rbx + 0x20], rax
test r12d, r12d
je 0x14005a2ca
mov rcx, qword [rsp + 0x38]
jmp 0x140059fd0
mov qword [rbx + 0x20], rbp
mov eax, edi
jmp 0x14005a2cc
mov qword [rbx + 0x20], rbp
mov eax, 0x1d
jmp 0x14005a2cc
xor ebp, ebp
mov dword [rsp + 0x98], ebp
cmp r9, 0xffffffffffffffff
je 0x14005a277
xor r9d, r9d
xor r8d, r8d
mov rdx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x14005a2ac
mov rcx, qword [rsp + 0x38]
mov ebx, dword [rsp + 0xb0]
lea r9, [rsp + 0x98]
mov r8d, ebx
mov qword [rsp + 0x20], rbp
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14005a2ac
cmp dword [rsp + 0x98], ebx
mov eax, 0x1d
cmovne ebp, eax
jmp 0x14005a2b4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov rcx, qword [rsp + 0xb8]
test rcx, rcx
je 0x14005a2ca
mov eax, dword [rsp + 0x98]
mov dword [rcx], eax
mov eax, ebp
mov rbx, qword [rsp + 0xa8]
add rsp, 0x50
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret