Function at 0x40a940
Capabilities:
Encode data using xor

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov rbx, rcx
call fcn.00409380
cmp eax, 0x18
je 0x40aac0
ja 0x40aa80
cmp eax, 6
je 0x40a9f0
cmp eax, 0x15
jne 0x40aa8f
mov eax, dword [rbx + 0x18]
lea rdx, [rbx + 0x42d]
mov r9, qword [rbx]
add eax, 1
cmp eax, dword [rbx + 0x10]
mov dword [rbx + 0x18], eax
jbe 0x40ab32
mov qword [rbx + 0x14], 0
mov byte [rbx + 0x1c], 0
mov r8d, 5
mov rcx, rbx
mov dword [rbx + 0x20], 0
mov dword [rbx + 0x24], 0
mov dword [rbx + 0x42d], 0x18181818
mov byte [rbx + 0x431], 0x18
mov dword [rbx + 0x838], 5
call qword [r9 + 0x10]
mov rax, qword [rbx]
xor r9d, r9d
xor r8d, r8d
mov edx, 5
mov rcx, rbx
mov rax, qword [rax]
add rsp, 0x28
pop rbx
pop rsi
jmp rax
lea rsi, [rbx + 0x430]
xor edx, edx
mov r8d, 0x400
mov rcx, rsi
call fcn.00417418
mov rax, qword [rbx]
mov r8, rsi
mov edx, 1
lea r9, [rbx + 0x838]
mov rcx, rbx
call qword [rax]
cmp eax, 4
je 0x40aba0
cmp eax, 6
jne 0x40ac50
mov r9d, dword [rbx + 0x838]
xor eax, eax
mov r10, r9
add r9, rsi
nop
cmp rsi, r9
je 0x40abe4
add rsi, 1
movzx edx, byte [rsi - 1]
mov ecx, 8
shl edx, 8
xor eax, edx
nop dword [rax + rax]
lea edx, [rax + rax]
lea r8d, [rax + rax]
xor dx, 0x1021
test ax, ax
mov eax, edx
cmovns eax, r8d
sub ecx, 1
jne 0x40aa60
jmp 0x40aa40
cmp eax, 0x43
je 0x40ab00
cmp eax, 0x61
je 0x40aac0
cmp eax, 0x41
je 0x40aac0
mov eax, dword [rbx + 0x14]
xor edx, edx
mov esi, dword [rbx + 8]
add eax, 1
lea ecx, [rsi + 1]
mov dword [rbx + 0x14], eax
div ecx
cmp eax, dword [rbx + 0xc]
ja 0x40ab50
test edx, edx
je 0x40aca0
add rsp, 0x28
pop rbx
pop rsi
ret
mov rax, qword [rbx]
mov byte [rbx + 0x1c], 0
xor r9d, r9d
xor r8d, r8d
mov qword [rbx + 0x14], 0
mov edx, 3
mov rcx, rbx
mov dword [rbx + 0x20], 0
mov dword [rbx + 0x24], 0
mov rax, qword [rax]
add rsp, 0x28
pop rbx
pop rsi
jmp rax
mov eax, dword [rbx + 0x18]
lea rdx, [rbx + 0x42d]
mov r9, qword [rbx]
add eax, 1
cmp eax, dword [rbx + 0x10]
mov dword [rbx + 0x18], eax
mov qword [rbx + 0x14], 0
ja 0x40a993
movzx eax, byte [rbx + 0x1c]
mov dword [rbx + 0x20], 0
add dword [rbx + 0x24], eax
mov rax, qword [r9 + 0x10]
mov r8d, dword [rbx + 0x838]
mov rcx, rbx
add rsp, 0x28
pop rbx
pop rsi
jmp rax
mov rax, qword [rbx]
mov byte [rbx + 0x1c], 0
mov r8d, 5
mov rcx, rbx
mov qword [rbx + 0x14], 0
lea rdx, [rbx + 0x42d]
mov dword [rbx + 0x20], 0
mov dword [rbx + 0x24], 0
mov dword [rbx + 0x42d], 0x18181818
mov byte [rbx + 0x431], 0x18
mov dword [rbx + 0x838], 5
call qword [rax + 0x10]
jmp 0x40a9cd
mov rax, qword [rbx]
mov qword [rbx + 0x14], 0
lea rdx, [rbx + 0x42d]
mov r8d, 1
mov byte [rbx + 0x1c], 2
mov dword [rbx + 0x20], 0
mov dword [rbx + 0x24], 2
mov byte [rbx + 0x42d], 4
mov dword [rbx + 0x838], 1
mov rax, qword [rax + 0x10]
jmp 0x40ab3d
cmp r10d, 0x80
movzx ecx, ah
mov byte [rbx + 0x1c], 1
seta dl
mov qword [rbx + 0x14], 0
add edx, 1
mov dword [rbx + 0x20], 0
mov byte [rbx + 0x42d], dl
mov edx, 0xfffffe01
mov word [rbx + 0x42e], dx
lea edx, [r10 + 3]
mov dword [rbx + 0x24], 2
mov byte [rbx + rdx + 0x42d], cl
lea edx, [r10 + 4]
add r10d, 5
mov byte [rbx + rdx + 0x42d], al
mov dword [rbx + 0x838], r10d
jmp 0x40aab3
mov rax, qword [rbx]
mov qword [rbx + 0x14], 0
lea rdx, [rbx + 0x42d]
mov r8d, 5
mov byte [rbx + 0x1c], 0
mov dword [rbx + 0x20], 0
mov dword [rbx + 0x24], 0
mov dword [rbx + 0x42d], 0x18181818
mov byte [rbx + 0x431], 0x18
mov dword [rbx + 0x838], 5
mov rax, qword [rax + 0x10]
jmp 0x40ab3d
mov rax, qword [rbx]
lea rdx, [rbx + 0x42d]
mov rax, qword [rax + 0x10]
jmp 0x40ab36