Function at 0x5d9e90
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xe8
mov rbx, qword [rcx + 0x70]
mov rsi, qword [rbx + 0xc8]
mov r14, r8
mov r8d, dword [rbx + 0xbc]
mov r13, rcx
mov rbp, rdx
mov rdi, r9
test r8d, r8d
jne 0x5da128
cmp rsi, 0xffffffffffffffff
je 0x5da090
test rdx, rdx
je 0x5da090
lea rax, [rsi + 0x10]
cmp r9, rax
jne 0x5da320
lea rax, [rbx + 0x20]
mov dword [rbx + 0x20], 0
lea r15, [rsp + 0x40]
mov qword [rsp + 0x20], rax
lea r12, [rbx + 0xd0]
cmp rsi, 0x40
ja 0x5da368
mov r9, rbx
mov r8d, pe_nt_image_headers64
lea rdx, [0x008d8160]
mov rcx, r15
call sym.ChaCha20_ctr32
mov rcx, r12
mov rdx, r15
call sym.Poly1305_Init
mov dword [rbx + 0x70], 0
movdqu xmm5, xmmword [rbx + 0x94]
mov ecx, dword [r13 + 0x10]
movups xmmword [rsp + 0x70], xmm5
mov qword [rbx + 0xa8], 0xd
mov qword [rbx + 0xb0], rsi
test ecx, ecx
jne 0x5da560
test rsi, rsi
je 0x5daaec
lea rax, [rbp + 0xf]
sub rax, r14
cmp rax, 0x1e
jbe 0x5dab04
lea rax, [rsi - 1]
cmp rax, 0xe
jbe 0x5dab04
movdqu xmm0, xmmword [r14]
mov rax, rsi
movdqu xmm1, xmmword [rsp + 0x80]
shr rax, 4
pxor xmm1, xmm0
movups xmmword [rsp + 0x80], xmm0
movups xmmword [rbp], xmm1
cmp rax, 1
je 0x5da8b0
movdqu xmm1, xmmword [rsp + 0x90]
movdqu xmm0, xmmword [r14 + 0x10]
pxor xmm1, xmm0
movups xmmword [rsp + 0x90], xmm0
movups xmmword [rbp + 0x10], xmm1
cmp rax, 2
je 0x5da8b0
movdqu xmm1, xmmword [rsp + 0xa0]
movdqu xmm0, xmmword [r14 + 0x20]
pxor xmm1, xmm0
movups xmmword [rsp + 0xa0], xmm0
movups xmmword [rbp + 0x20], xmm1
cmp rax, 4
jne 0x5da8b0
movdqu xmm0, xmmword [r14 + 0x30]
lea rax, [rsp + 0x80]
movdqu xmm1, xmmword [rsp + 0xb0]
pxor xmm1, xmm0
movups xmmword [rsp + 0xb0], xmm0
movups xmmword [rbp + 0x30], xmm1
nop dword [rax]
mov rdx, rsi
lea r9, [rax + rsi]
add r14, rsi
add rbp, rsi
neg rdx
and edx, 0xf
lea r8, [rsi + rdx]
add rax, r8
add r8, 0x20
mov ecx, edx
xor r11d, r11d
cmp edx, 8
jae 0x5da660
and edx, 4
jne 0x5dab61
test ecx, ecx
je 0x5da07e
mov byte [r9], 0
test cl, 2
jne 0x5dab78
lea rsi, [rsp + 0x70]
mov r9d, pe_nt_image_headers64
jmp 0x5da43a
lea rax, [rbx + 0x20]
lea r12, [rbx + 0x30]
mov r9, rbx
mov r8d, 0x40
mov dword [rbx + 0x20], 0
lea rdx, [0x008d8160]
mov rcx, r12
lea r15, [rbx + 0xd0]
mov qword [rsp + 0x20], rax
call sym.ChaCha20_ctr32
mov rdx, r12
mov rcx, r15
call sym.Poly1305_Init
pxor xmm0, xmm0
mov dword [rbx + 0x20], 1
mov dword [rbx + 0x70], 0
mov dword [rbx + 0xbc], 1
movups xmmword [rbx + 0xa8], xmm0
cmp rsi, 0xffffffffffffffff
je 0x5da128
lea rdx, [rbx + 0x94]
mov r8d, 0xd
mov rcx, r15
call sym.Poly1305_Update
mov qword [rbx + 0xa8], 0xd
mov dword [rbx + 0xb8], 1
nop dword [rax]
test r14, r14
je 0x5da2a8
test rbp, rbp
je 0x5da500
mov r10d, dword [rbx + 0xb8]
test r10d, r10d
je 0x5da160
mov rax, qword [rbx + 0xa8]
and eax, 0xf
jne 0x5da340
mov dword [rbx + 0xb8], 0
mov qword [rbx + 0xc8], 0xffffffffffffffff
cmp rsi, 0xffffffffffffffff
je 0x5da330
lea rax, [rsi + 0x10]
cmp rax, rdi
jne 0x5da320
mov r9d, dword [r13 + 0x10]
lea r12, [rbx + 0xd0]
test r9d, r9d
je 0x5da1d8
mov r9, rsi
mov r8, r14
mov rdx, rbp
mov rcx, r13
call sym.chacha_cipher
mov r8, rsi
mov rdx, rbp
mov rcx, r12
call sym.Poly1305_Update
add qword [rbx + 0xb0], rsi
cmp rsi, rdi
jne 0x5da203
mov eax, edi
add rsp, 0xe8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r8, rsi
mov rdx, r14
mov rcx, r12
call sym.Poly1305_Update
mov r9, rsi
mov r8, r14
mov rdx, rbp
mov rcx, r13
call sym.chacha_cipher
add qword [rbx + 0xb0], rsi
cmp rsi, rdi
je 0x5da1bd
mov r8d, dword [rbx + 0xb8]
add r14, rsi
add rbp, rsi
mov r15d, 1
test r8d, r8d
je 0x5da235
mov rax, qword [rbx + 0xa8]
and eax, 0xf
jne 0x5da4e0
mov dword [rbx + 0xb8], 0
mov rax, qword [rbx + 0xb0]
and eax, 0xf
jne 0x5da2d2
lea rdx, [rbx + 0xa8]
mov rcx, r12
mov r8d, 0x10
call sym.Poly1305_Update
mov ecx, dword [r13 + 0x10]
lea rdx, [rsp + 0x40]
test ecx, ecx
je 0x5da26e
lea rdx, [rbx + 0x84]
mov rcx, r12
call sym.Poly1305_Final
mov dword [rbx + 0xbc], 0
test r15b, r15b
je 0x5da2f0
mov edx, dword [r13 + 0x10]
test edx, edx
je 0x5da4b0
movdqu xmm3, xmmword [rbx + 0x84]
movups xmmword [rbp], xmm3
jmp 0x5da1bd
mov r8d, dword [rbx + 0xb8]
lea r12, [rbx + 0xd0]
xor r15d, r15d
test r8d, r8d
jne 0x5da21b
mov rax, qword [rbx + 0xb0]
and eax, 0xf
je 0x5da245
mov r8d, 0x10
lea rdx, [0x008d8160]
mov rcx, r12
sub r8, rax
call sym.Poly1305_Update
jmp 0x5da245
mov eax, dword [r13 + 0x10]
test eax, eax
jne 0x5da1bd
movsxd r8, dword [rbx + 0xc0]
lea rdx, [rbx + 0x84]
lea rcx, [rsp + 0x40]
call sym.CRYPTO_memcmp
test eax, eax
je 0x5da1bd
nop dword [rax]
mov eax, 0xffffffff
jmp 0x5da1bf
mov rsi, rdi
jmp 0x5da182
mov r8d, 0x10
lea rcx, [rbx + 0xd0]
lea rdx, [0x008d8160]
sub r8, rax
call sym.Poly1305_Update
jmp 0x5da156
mov r9, rbx
mov r8d, 0x40
mov rcx, r15
mov qword [rsp + 0x38], rax
lea rdx, [0x008d8160]
call sym.ChaCha20_ctr32
mov rdx, r15
mov rcx, r12
call sym.Poly1305_Init
mov dword [rbx + 0x20], 1
mov rcx, r12
lea rdx, [rbx + 0x94]
mov dword [rbx + 0x70], 0
mov r8d, 0x10
call sym.Poly1305_Update
mov eax, dword [r13 + 0x10]
mov qword [rbx + 0xb0], rsi
mov qword [rbx + 0xa8], 0xd
test eax, eax
mov rax, qword [rsp + 0x38]
jne 0x5da530
mov r8, rsi
mov rdx, r14
mov rcx, r12
mov qword [rsp + 0x38], rax
call sym.Poly1305_Update
mov rax, qword [rsp + 0x38]
mov r9, rbx
mov r8, rsi
mov rdx, r14
mov rcx, rbp
mov qword [rsp + 0x20], rax
call sym.ChaCha20_ctr32
add r14, rsi
add rbp, rsi
neg rsi
mov rcx, r12
mov r8, rsi
lea rdx, [0x008d8160]
and r8d, 0xf
call sym.Poly1305_Update
lea rax, [rsp + 0x80]
mov r8d, 0x10
mov r9d, 0x40
mov rsi, rax
movdqu xmm2, xmmword [rbx + 0xa8]
mov rdx, rsi
mov rcx, r12
mov qword [rsp + 0x38], r9
movups xmmword [rax], xmm2
call sym.Poly1305_Update
mov r9, qword [rsp + 0x38]
mov rcx, r15
mov rdx, r9
call sym.OPENSSL_cleanse
mov r15d, dword [r13 + 0x10]
mov rdx, rsi
test r15d, r15d
je 0x5da478
lea rdx, [rbx + 0x84]
mov rcx, r12
call sym.Poly1305_Final
mov r11d, dword [r13 + 0x10]
mov qword [rbx + 0xc8], 0xffffffffffffffff
test r11d, r11d
je 0x5da628
movdqu xmm4, xmmword [rbx + 0x84]
movups xmmword [rbp], xmm4
jmp 0x5da1bd
lea rcx, [rsp + 0x40]
mov r8d, 0x10
mov rdx, r14
call sym.CRYPTO_memcmp
test eax, eax
je 0x5da1bd
mov rcx, rbp
mov r8, rsi
xor edx, edx
sub rcx, rsi
call sym.memset
jmp 0x5da320
mov r8d, 0x10
lea rdx, [0x008d8160]
mov rcx, r12
sub r8, rax
call sym.Poly1305_Update
jmp 0x5da22b
lea rcx, [rbx + 0xd0]
mov r8, rdi
mov rdx, r14
call sym.Poly1305_Update
add qword [rbx + 0xa8], rdi
mov eax, edi
mov dword [rbx + 0xb8], 1
jmp 0x5da1bf
mov qword [rsp + 0x20], rax
mov r8, rsi
mov rdx, r14
mov rcx, rbp
mov r9, rbx
call sym.ChaCha20_ctr32
mov r8, rsi
mov rdx, rbp
mov rcx, r12
call sym.Poly1305_Update
jmp 0x5da404
test rsi, rsi
je 0x5daaec
lea rax, [rbp + 0xf]
sub rax, r14
cmp rax, 0x1e
jbe 0x5dab36
lea rax, [rsi - 1]
cmp rax, 0xe
jbe 0x5dab36
movdqu xmm0, xmmword [r14]
mov rax, rsi
pxor xmm0, xmmword [rsp + 0x80]
shr rax, 4
movups xmmword [rsp + 0x80], xmm0
movups xmmword [rbp], xmm0
cmp rax, 1
je 0x5da6a8
movdqu xmm0, xmmword [r14 + 0x10]
pxor xmm0, xmmword [rsp + 0x90]
movups xmmword [rsp + 0x90], xmm0
movups xmmword [rbp + 0x10], xmm0
cmp rax, 2
je 0x5da6a8
movdqu xmm0, xmmword [r14 + 0x20]
pxor xmm0, xmmword [rsp + 0xa0]
movups xmmword [rsp + 0xa0], xmm0
movups xmmword [rbp + 0x20], xmm0
cmp rax, 4
jne 0x5da6a8
movdqu xmm0, xmmword [r14 + 0x30]
lea rax, [rsp + 0x80]
pxor xmm0, xmmword [rsp + 0xb0]
movups xmmword [rsp + 0xb0], xmm0
movups xmmword [rbp + 0x30], xmm0
jmp 0x5da038
mov r8d, 0x10
mov rdx, r14
mov rcx, rsi
call sym.CRYPTO_memcmp
test eax, eax
je 0x5da1bd
sub rbp, rdi
lea r8, [rdi - 0x10]
xor edx, edx
lea rcx, [rbp + 0x10]
call sym.memset
or eax, 0xffffffff
jmp 0x5da1bf
lea r10, [r9 + 8]
mov qword [r9], 0
mov qword [r9 + rdx - 8], 0
and r10, 0xfffffffffffffff8
sub r9, r10
lea ecx, [rdx + r9]
and ecx, 0xfffffff8
cmp ecx, 8
jb 0x5da07e
and ecx, 0xfffffff8
xor edx, edx
mov r9d, edx
add edx, 8
mov qword [r10 + r9], r11
cmp edx, ecx
jb 0x5da690
jmp 0x5da07e
mov rdx, rsi
lea rax, [rsp + 0x80]
and rdx, 0xfffffffffffffff0
test sil, 0xf
je 0x5da038
lea r8, [rax + rdx]
movzx ecx, byte [r14 + rdx]
xor cl, byte [r8]
mov byte [r8], cl
mov byte [rbp + rdx], cl
lea rcx, [rdx + 1]
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 1]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 2]
mov byte [rbp + rdx + 1], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 2]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 3]
mov byte [rbp + rdx + 2], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 3]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 4]
mov byte [rbp + rdx + 3], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 4]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 5]
mov byte [rbp + rdx + 4], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 5]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 6]
mov byte [rbp + rdx + 5], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 6]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 7]
mov byte [rbp + rdx + 6], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 7]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 8]
mov byte [rbp + rdx + 7], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 8]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 9]
mov byte [rbp + rdx + 8], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 9]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xa]
mov byte [rbp + rdx + 9], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xa]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xb]
mov byte [rbp + rdx + 0xa], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xb]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xc]
mov byte [rbp + rdx + 0xb], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xc]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xd]
mov byte [rbp + rdx + 0xc], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xd]
xor r8b, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xe]
mov byte [rbp + rdx + 0xd], r8b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xe]
xor r8b, byte [rcx]
mov byte [rcx], r8b
mov byte [rbp + rdx + 0xe], r8b
jmp 0x5da038
mov rdx, rsi
and rdx, 0xfffffffffffffff0
test sil, 0xf
je 0x5dab85
lea rax, [rsp + 0x80]
movzx r8d, byte [r14 + rdx]
lea rcx, [rax + rdx]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 1]
xor r9d, r8d
mov byte [rbp + rdx], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 1]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 2]
xor r9d, r8d
mov byte [rbp + rdx + 1], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 2]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 3]
xor r9d, r8d
mov byte [rbp + rdx + 2], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 3]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 4]
xor r9d, r8d
mov byte [rbp + rdx + 3], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 4]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 5]
xor r9d, r8d
mov byte [rbp + rdx + 4], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 5]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 6]
xor r9d, r8d
mov byte [rbp + rdx + 5], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 6]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 7]
xor r9d, r8d
mov byte [rbp + rdx + 6], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 7]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 8]
xor r9d, r8d
mov byte [rbp + rdx + 7], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 8]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 9]
xor r9d, r8d
mov byte [rbp + rdx + 8], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 9]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xa]
xor r9d, r8d
mov byte [rbp + rdx + 9], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xa]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xb]
xor r9d, r8d
mov byte [rbp + rdx + 0xa], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xb]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xc]
xor r9d, r8d
mov byte [rbp + rdx + 0xb], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xc]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xd]
xor r9d, r8d
mov byte [rbp + rdx + 0xc], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xd]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
lea rcx, [rdx + 0xe]
xor r9d, r8d
mov byte [rbp + rdx + 0xd], r9b
cmp rsi, rcx
jbe 0x5da038
add rcx, rax
movzx r8d, byte [r14 + rdx + 0xe]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
xor r9d, r8d
mov byte [rbp + rdx + 0xe], r9b
jmp 0x5da038
lea rax, [rsp + 0x80]
xor edx, edx
mov r8d, 0x20
mov r9, rax
jmp 0x5da056
xor edx, edx
lea rax, [rsp + 0x80]
nop
lea rcx, [rax + rdx]
movzx r8d, byte [r14 + rdx]
movzx r9d, byte [rcx]
mov byte [rcx], r8b
xor r9d, r8d
mov byte [rbp + rdx], r9b
add rdx, 1
cmp rsi, rdx
jne 0x5dab10
jmp 0x5da038
xor edx, edx
lea rax, [rsp + 0x80]
lea r8, [rax + rdx]
movzx ecx, byte [r14 + rdx]
xor cl, byte [r8]
mov byte [rbp + rdx], cl
add rdx, 1
mov byte [r8], cl
cmp rsi, rdx
jne 0x5dab40
jmp 0x5da038
mov edx, ecx
mov dword [r9], 0
mov dword [r9 + rdx - 4], 0
jmp 0x5da07e
xor edx, edx
mov word [r9 + rcx - 2], dx
jmp 0x5da07e
lea rax, [rsp + 0x80]
jmp 0x5da038