Function at 0x50a590
Capabilities:
Encode data using xor

Disassembly:
test r8d, r8d
mov qword [rsp + 0x10], rbx
mov r10d, ecx
mov qword [rsp + 0x18], rsi
mov ebx, r8d
mov r11, rdx
not r10d
lea rsi, [0x005daa10]
je 0x509f08
test r11b, 3
je 0x509f08
movzx ecx, byte [r11]
mov eax, r10d
add r11, 1
xor cl, r10b
shr eax, 8
movzx edx, cl
mov r10d, dword [rsi + rdx*4]
xor r10d, eax
add ebx, 0xffffffff
jne 0x509ee2
cmp ebx, 0x20
jb 0x50a13f
mov qword [rsp + 0x20], rdi
mov edi, ebx
shr rdi, 5
nop
xor r10d, dword [r11]
mov eax, r10d
shr rax, 0x10
movzx edx, al
mov eax, r10d
mov r8d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov eax, r10d
xor r8d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r8d, dword [rsi + rax*4]
movzx eax, r10b
xor r8d, dword [rsi + rax*4 + 0xc00]
xor r8d, dword [r11 + 4]
mov r9d, r8d
mov eax, r8d
shr rax, 0x10
movzx edx, al
mov eax, r8d
mov r8d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov rax, r9
xor r8d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r8d, dword [rsi + rax*4]
movzx eax, r9b
xor r8d, dword [rsi + rax*4 + 0xc00]
xor r8d, dword [r11 + 8]
mov r9d, r8d
mov eax, r8d
shr rax, 0x10
movzx edx, al
mov eax, r8d
mov r8d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov rax, r9
xor r8d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r8d, dword [rsi + rax*4]
movzx eax, r9b
xor r8d, dword [rsi + rax*4 + 0xc00]
xor r8d, dword [r11 + 0xc]
mov r9d, r8d
mov eax, r8d
shr rax, 0x10
movzx edx, al
mov eax, r8d
mov r8d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov rax, r9
xor r8d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r8d, dword [rsi + rax*4]
movzx eax, r9b
xor r8d, dword [rsi + rax*4 + 0xc00]
xor r8d, dword [r11 + 0x10]
mov r9d, r8d
mov eax, r8d
shr rax, 0x10
movzx edx, al
mov eax, r8d
mov r8d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov rax, r9
xor r8d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r8d, dword [rsi + rax*4]
movzx eax, r9b
xor r8d, dword [rsi + rax*4 + 0xc00]
xor r8d, dword [r11 + 0x14]
mov eax, r8d
mov r9d, r8d
shr rax, 0x10
movzx edx, al
mov eax, r8d
shr rax, 8
mov r8d, dword [rsi + rdx*4 + 0x400]
movzx ecx, al
mov rax, r9
xor r8d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
add r11, 0x20
xor r8d, dword [rsi + rax*4]
movzx eax, r9b
add ebx, 0xffffffe0
xor r8d, dword [rsi + rax*4 + 0xc00]
xor r8d, dword [r11 - 8]
mov r9d, r8d
mov eax, r8d
shr rax, 0x10
movzx edx, al
mov eax, r8d
mov r8d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov rax, r9
xor r8d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r8d, dword [rsi + rax*4]
movzx eax, r9b
xor r8d, dword [rsi + rax*4 + 0xc00]
xor r8d, dword [r11 - 4]
mov eax, r8d
shr rax, 0x10
movzx edx, al
mov eax, r8d
mov r10d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov eax, r8d
xor r10d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r10d, dword [rsi + rax*4]
movzx eax, r8b
xor r10d, dword [rsi + rax*4 + 0xc00]
sub rdi, 1
jne 0x509f20
mov rdi, qword [rsp + 0x20]
cmp ebx, 4
jb 0x50a19e
mov r9d, ebx
shr r9, 2
nop
nop
xor r10d, dword [r11]
add r11, 4
add ebx, 0xfffffffc
mov r8d, r10d
mov eax, r10d
shr rax, 0x10
movzx edx, al
mov eax, r10d
mov r10d, dword [rsi + rdx*4 + 0x400]
shr rax, 8
movzx ecx, al
mov rax, r8
xor r10d, dword [rsi + rcx*4 + 0x800]
shr rax, 0x18
xor r10d, dword [rsi + rax*4]
movzx eax, r8b
xor r10d, dword [rsi + rax*4 + 0xc00]
sub r9, 1
jne 0x50a150
test ebx, ebx
je 0x50a1c2
movzx ecx, byte [r11]
mov eax, r10d
add r11, 1
xor cl, r10b
shr eax, 8
movzx edx, cl
mov r10d, dword [rsi + rdx*4]
xor r10d, eax
add ebx, 0xffffffff
jne 0x50a1a2
mov rsi, qword [rsp + 0x18]
mov rbx, qword [rsp + 0x10]
not r10d
mov eax, r10d
ret
test rdx, rdx
jne 0x50a598
xor eax, eax
ret
jmp 0x509ec0