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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
mov rax, qword [r8]
mov rbx, rcx
mov qword [rsp + 0xb8], rdx
mov rsi, r8
test rdx, rdx
je 0x5c247b
movzx ecx, byte [rsp + 0xb8]
mov rdi, rdx
mov edx, 1
add rdi, rdi
mov qword [rsp + 0x50], rdi
shlx edx, edx, ecx
movsxd rcx, edx
mov qword [rsp + 0x28], rcx
sub rax, rcx
cmp rdi, 1
jle 0x5c246a
mov rdx, rdi
sar rdx, 1
neg rdx
cmp qword [rsp + 0x28], 0
mov qword [rsp + 0x58], rdx
jg 0x5c24a6
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
sub rax, 2
mov qword [rsp + 0x58], 0xffffffffffffffff
mov qword [rsp + 0xb8], 1
mov qword [rsp + 0x50], 2
mov qword [rsp + 0x28], 2
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x48], 1
nop word cs:[rax + rax]
nop
mov rdi, qword [rsp + 0x48]
mov rax, qword [rsp + 0xb8]
mov rdx, qword [rsp + 0x58]
sub rax, rdi
add rdx, rdi
cmp qword [rsp + 0xb8], rdi
mov edi, 1
cmovl rax, rdx
xor ebp, ebp
shlx rdi, rdi, rax
mov qword [rsp + 0x38], rdi
mov edi, 1
shlx eax, edi, eax
mov rdi, rbp
cdqe
mov qword [rsp + 0x40], rax
nop dword [rax]
mov rcx, qword [rsp + 0x40]
mov rax, rdi
mov ebp, 0
sub rax, rcx
test qword [rsp + 0x38], rdi
lea rdx, [rdi + rcx]
mov rcx, qword [rbx]
cmove rax, rdx
add rax, qword [rsp + 0x30]
mov rdx, qword [rbx + 0x10]
xor r8d, r8d
andn rdx, rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbx]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r15, rax
call sub.msvcrt.dll_fread
mov rdx, qword [rbx + 0x10]
cmp rax, 0x20
mov rax, qword [rsi]
mov rcx, qword [rbx]
cmovne r15, rbp
sub rax, qword [rsp + 0x28]
xor r8d, r8d
andn rdx, rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbx]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r14, rax
call sub.msvcrt.dll_fread
mov edx, 1
mov ecx, 0x20
cmp rax, 0x20
cmovne r14, rbp
call sub.msvcrt.dll_calloc
mov rdx, qword [rsi]
mov r12, rax
lea rax, [rdx + rdx]
test rdx, rdx
mov rcx, rax
not rcx
cmovs rax, rcx
cmp rax, 0x7f
jbe 0x5c2730
xor edx, edx
mov r8d, eax
mov ecx, edx
shr rax, 7
inc edx
or r8d, 0xffffff80
mov byte [r12 + rcx], r8b
cmp rax, 0x7f
ja 0x5c25f0
add rdx, r12
mov byte [rdx], al
mov ecx, pe_nt_image_headers64
inc rdi
call sub.msvcrt.dll_malloc
mov ecx, 0x20
mov r13, rax
mov rax, qword [rbx + 0x18]
vmovdqu xmm2, xmmword [r12]
vmovdqu xmm3, xmmword [r12 + 0x10]
vmovdqu xmm4, xmmword [r15]
vmovdqu xmm5, xmmword [r15 + 0x10]
vmovdqu xmm0, xmmword [rax]
vmovdqu xmmword [r13], xmm0
vmovdqu xmm1, xmmword [rax + 0x10]
vmovdqu xmm0, xmmword [r14]
vmovdqu xmmword [r13 + 0x20], xmm2
vmovdqu xmmword [r13 + 0x30], xmm3
vmovdqu xmmword [r13 + 0x40], xmm4
vmovdqu xmmword [r13 + 0x50], xmm5
vmovdqu xmmword [r13 + 0x10], xmm1
vmovdqu xmm1, xmmword [r14 + 0x10]
vmovdqu xmmword [r13 + 0x60], xmm0
vmovdqu xmmword [r13 + 0x70], xmm1
call sub.msvcrt.dll_malloc
mov r9d, 0x20
mov edx, pe_nt_image_headers64
mov r8, rax
mov rcx, r13
mov rbp, rax
call fcn.005c4c50
mov rdx, qword [rbx + 0x10]
xor r8d, r8d
mov rcx, qword [rbx]
andn rdx, rdx, qword [rsi]
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbx]
mov r8d, 0x20
mov edx, 1
mov rcx, rbp
call sub.msvcrt.dll_fwrite
inc qword [rsi]
mov rcx, rbp
call sub.msvcrt.dll_free
mov rcx, r13
call sub.msvcrt.dll_free
mov rcx, r15
call sub.msvcrt.dll_free
mov rcx, r14
call sub.msvcrt.dll_free
mov rcx, r12
call sub.msvcrt.dll_free
cmp qword [rsp + 0x28], rdi
jne 0x5c2510
inc qword [rsp + 0x48]
mov rcx, qword [rsp + 0x28]
mov rax, qword [rsp + 0x48]
add qword [rsp + 0x30], rcx
cmp rax, qword [rsp + 0x50]
jl 0x5c24c0
jmp 0x5c246a
mov rdx, r12
jmp 0x5c260c