Function at 0x14021ba30
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 rdi, rcx
mov r9, rdx
mov rbp, r8
test rdx, rdx
jne 0x14021bd18
sub rax, 2
mov r12, 0xffffffffffffffff
mov r8d, 2
mov r15d, 2
mov r9d, 1
mov qword [rsp + 0x30], rax
mov esi, 1
mov qword [rsp + 0x50], r8
mov rdx, rsi
mov qword [rsp + 0x58], r12
mov qword [rsp + 0xb8], r9
nop dword [rax]
mov rax, qword [rsp + 0x58]
mov esi, 1
mov qword [rsp + 0x28], r15
mov rcx, qword [rsp + 0xb8]
mov qword [rsp + 0x48], rdx
add rax, rdx
sub rcx, rdx
cmp qword [rsp + 0xb8], rdx
cmovl rcx, rax
mov eax, 1
xor r14d, r14d
shl rax, cl
shl esi, cl
mov qword [rsp + 0x38], rax
movsxd rax, esi
mov qword [rsp + 0x40], rax
mov rsi, qword [rsp + 0x40]
mov rax, r14
mov rcx, qword [rdi]
lea rdx, [r14 + rsi]
sub rax, rsi
test qword [rsp + 0x38], r14
mov rsi, qword [rsp + 0x30]
cmove rax, rdx
mov rdx, qword [rdi + 0x10]
xor r8d, r8d
xor ebx, ebx
add rax, rsi
not rdx
and rdx, rax
shl edx, 5
call sym.fseek
mov ecx, 0x20
call sym.malloc
mov r9, qword [rdi]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r15, rax
call sym.fread
mov rdx, qword [rbp]
mov rcx, qword [rdi]
cmp rax, 0x20
mov rax, qword [rsp + 0x28]
cmovne r15, rbx
xor r8d, r8d
sub rdx, rax
mov rax, qword [rdi + 0x10]
not rax
and rdx, rax
shl edx, 5
call sym.fseek
mov ecx, 0x20
call sym.malloc
mov r9, qword [rdi]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r12, rax
call sym.fread
mov edx, 1
mov ecx, 0x20
cmp rax, 0x20
cmovne r12, rbx
call sym.calloc
mov rdx, qword [rbp]
mov rbx, rax
lea rax, [rdx + rdx]
sar rdx, 0x3f
xor rax, rdx
cmp rax, 0x7f
jbe 0x14021bd10
xor edx, edx
nop dword [rax]
mov r8d, eax
mov ecx, edx
shr rax, 7
add edx, 1
or r8d, 0xffffff80
mov byte [rbx + rcx], r8b
cmp rax, 0x7f
ja 0x14021bbc8
add rdx, rbx
mov byte [rdx], al
mov ecx, pe_nt_image_headers64
add r14, 1
call sym.malloc
vmovdqu xmm2, xmmword [rbx]
vmovdqu xmm3, xmmword [rbx + 0x10]
mov ecx, 0x20
mov rsi, rax
mov rax, qword [rdi + 0x18]
vmovdqu xmm4, xmmword [r15]
vmovdqu xmm5, xmmword [r15 + 0x10]
vmovdqu xmm0, xmmword [rax]
vmovdqu xmmword [rsi], xmm0
vmovdqu xmm1, xmmword [rax + 0x10]
vmovdqu xmm0, xmmword [r12]
vmovdqu xmmword [rsi + 0x20], xmm2
vmovdqu xmmword [rsi + 0x10], xmm1
vmovdqu xmm1, xmmword [r12 + 0x10]
vmovdqu xmmword [rsi + 0x30], xmm3
vmovdqu xmmword [rsi + 0x40], xmm4
vmovdqu xmmword [rsi + 0x50], xmm5
vmovdqu xmmword [rsi + 0x60], xmm0
vmovdqu xmmword [rsi + 0x70], xmm1
call sym.malloc
mov r9d, 0x20
mov edx, pe_nt_image_headers64
mov rcx, rsi
mov r8, rax
mov r13, rax
call sym.sha3
mov rdx, qword [rdi + 0x10]
mov rcx, qword [rdi]
xor r8d, r8d
not rdx
and rdx, qword [rbp]
shl edx, 5
call sym.fseek
mov r9, qword [rdi]
mov edx, 1
mov rcx, r13
mov r8d, 0x20
call sym.fwrite
add qword [rbp], 1
mov rcx, r13
call sym.free
mov rcx, rsi
call sym.free
mov rcx, r15
call sym.free
mov rcx, r12
call sym.free
mov rcx, rbx
call sym.free
cmp qword [rsp + 0x28], r14
jne 0x14021bae0
mov rdx, qword [rsp + 0x48]
mov rax, qword [rsp + 0x50]
mov r15, qword [rsp + 0x28]
add qword [rsp + 0x30], r15
add rdx, 1
cmp rdx, rax
jl 0x14021ba98
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rdx, rbx
jmp 0x14021bbe5
lea r8, [rdx + rdx]
cmp r8, 1
jle 0x14021bcf8
mov edx, 1
mov ecx, r9d
shl edx, cl
movsxd r15, edx
test r15, r15
jle 0x14021bcf8
mov rdx, r8
sub rax, r15
sar rdx, 1
neg rdx
mov r12, rdx
jmp 0x14021ba72