Function at 0x40e8a0
Capabilities:
Encode data using xor

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
test r8, r8
mov rsi, rcx
mov edi, edx
mov rbx, r8
je 0x40ebd3
test rcx, rcx
je 0x40ec05
test edx, edx
je 0x40ebec
cmp word [r8 + 0x44e8], 0
jne 0x40ea40
lea eax, [rdx - 1]
mov ecx, dword [r8 + 0xb4]
mov r10d, 0xcccccccd
lea r11, [rsi + rax + 1]
add rax, 1
and eax, 3
je 0x40e99b
cmp rax, 1
je 0x40e964
cmp rax, 2
je 0x40e935
mov r8d, ecx
movzx r9d, byte [rsi]
add ecx, 1
mov eax, r8d
mov dword [rbx + 0xb4], ecx
add rsi, 1
mul r10d
shr edx, 5
lea ebp, [rdx + rdx*4]
shl ebp, 3
sub r8d, ebp
xor byte [rbx + r8 + 0x8c], r9b
mov r9d, ecx
movzx edi, byte [rsi]
add ecx, 1
mov eax, r9d
mov dword [rbx + 0xb4], ecx
add rsi, 1
mul r10d
shr edx, 5
lea r8d, [rdx + rdx*4]
shl r8d, 3
sub r9d, r8d
xor byte [rbx + r9 + 0x8c], dil
add rsi, 1
movzx ebp, byte [rsi - 1]
mov r8d, ecx
add ecx, 1
mov eax, r8d
mov dword [rbx + 0xb4], ecx
mul r10d
shr edx, 5
lea edi, [rdx + rdx*4]
shl edi, 3
sub r8d, edi
xor byte [rbx + r8 + 0x8c], bpl
cmp rsi, r11
je 0x40ea30
mov eax, ecx
lea ebp, [rcx + 1]
movzx r9d, byte [rsi]
mul r10d
mov eax, ecx
add rsi, 4
mov dword [rbx + 0xb4], ebp
shr edx, 5
lea r8d, [rdx + rdx*4]
shl r8d, 3
sub eax, r8d
xor byte [rbx + rax + 0x8c], r9b
mov eax, ebp
lea r9d, [rcx + 2]
mul r10d
movzx r8d, byte [rsi - 3]
mov eax, r9d
mov dword [rbx + 0xb4], r9d
shr edx, 5
lea edi, [rdx + rdx*4]
mul r10d
shl edi, 3
sub ebp, edi
shr edx, 5
xor byte [rbx + rbp + 0x8c], r8b
lea r8d, [rcx + 3]
lea edi, [rdx + rdx*4]
movzx ebp, byte [rsi - 2]
add ecx, 4
mov dword [rbx + 0xb4], r8d
shl edi, 3
sub r9d, edi
xor byte [rbx + r9 + 0x8c], bpl
movzx ebp, byte [rsi - 1]
jmp 0x40e972
xor eax, eax
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
ret
lea rbp, [rsp + 0x30]
mov r8d, 0x28
mov rcx, rbx
mov rdx, rbp
call fcn.0040f730
test eax, eax
jne 0x40ea32
lea r10d, [rdi - 1]
xor ecx, ecx
mov r11d, 0xcccccccd
add r10, 1
mov r8, r10
and r8d, 3
je 0x40ead2
cmp r8, 1
je 0x40eaa6
cmp r8, 2
jne 0x40ebc0
mov eax, ecx
movzx r9d, byte [rsi + rcx]
mul r11d
mov eax, ecx
add rcx, 1
shr edx, 5
lea r8d, [rdx + rdx*4]
shl r8d, 3
sub eax, r8d
xor byte [rsp + rax + 0x30], r9b
mov eax, ecx
movzx r9d, byte [rsi + rcx]
mul r11d
mov eax, ecx
add rcx, 1
shr edx, 5
lea r8d, [rdx + rdx*4]
shl r8d, 3
sub eax, r8d
xor byte [rsp + rax + 0x30], r9b
cmp r10, rcx
je 0x40eb61
mov eax, ecx
movzx r9d, byte [rsi + rcx]
mul r11d
mov eax, ecx
shr edx, 5
lea r8d, [rdx + rdx*4]
shl r8d, 3
sub eax, r8d
lea r8, [rcx + 1]
xor byte [rsp + rax + 0x30], r9b
movzx r9d, byte [rsi + rcx + 1]
mov eax, r8d
mul r11d
shr edx, 5
lea edi, [rdx + rdx*4]
shl edi, 3
sub r8d, edi
xor byte [rsp + r8 + 0x30], r9b
lea r8, [rcx + 2]
movzx r9d, byte [rsi + rcx + 2]
mov eax, r8d
mul r11d
shr edx, 5
lea edi, [rdx + rdx*4]
shl edi, 3
sub r8d, edi
xor byte [rsp + r8 + 0x30], r9b
lea r8, [rcx + 3]
movzx r9d, byte [rsi + rcx + 3]
add rcx, 4
mov eax, r8d
mul r11d
shr edx, 5
lea edi, [rdx + rdx*4]
shl edi, 3
sub r8d, edi
xor byte [rsp + r8 + 0x30], r9b
cmp r10, rcx
jne 0x40ead2
mov r9d, 0x14
mov r8d, 0x20
mov rdx, rbp
mov rcx, rbx
call fcn.0040f7a0
test eax, eax
jne 0x40ea32
lea rdx, [rbp + 0x20]
xor r9d, r9d
mov r8d, 8
mov rcx, rbx
call fcn.0040f6a0
test eax, eax
jne 0x40ea32
mov edx, 0x28
mov rcx, rbp
mov dword [rsp + 0x2c], eax
call fcn.0040a640
mov eax, dword [rsp + 0x2c]
jmp 0x40ea32
movzx r9d, byte [rsi]
xor byte [rsp + rcx + 0x30], r9b
mov ecx, 1
jmp 0x40ea83
lea rdx, str.src_prngs_chacha20.c
lea rcx, str.prng___NULL
mov r8d, 0x3c
call fcn.00409b50
lea rdx, str.src_prngs_chacha20.c
lea rcx, [0x00440ecd]
mov r8d, 0x3e
call fcn.00409b50
lea rdx, str.src_prngs_chacha20.c
lea rcx, [0x00440ec2]
mov r8d, 0x3d
call fcn.00409b50
nop
nop