Function at 0x140040970
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 8], rcx
push rbx
push rbp
push r12
push r13
sub rsp, 0x58
mov rax, qword [rcx]
mov r13, r9
mov rbx, r8
mov rbp, rdx
mov r12, rcx
call qword [rax + 0x20]
test al, al
jne 0x1400409a2
mov rcx, r12
call fcn.14000dd30
mov qword [rsp + 0x50], rdi
call fcn.140081770
test al, al
je 0x1400409ec
cmp r13, 4
jb 0x1400409ec
mov rdi, r13
shr rdi, 2
imul rax, rdi, 0xfffffffffffffffc
add r13, rax
mov qword [rsp + 0x98], r13
nop dword [rax]
mov r8, rbx
mov rdx, rbp
mov rcx, r12
call fcn.1400873d0
add rbp, 0x40
add rbx, 0x40
sub rdi, 1
jne 0x1400409d0
test r13, r13
je 0x140040e29
mov qword [rsp + 0x90], rsi
lea rdx, [0x1400c0a30]
mov qword [rsp + 0x48], r14
lea rsi, [rbx + 8]
mov qword [rsp + 0x40], r15
lea r15, [rbp + 8]
sub rbp, rbx
mov qword [rsp + 0x20], r15
sub rbp, 8
mov qword [rsp + 0x28], rsi
mov qword [rsp + 0x88], rbp
nop
mov rcx, qword [r12 + 8]
mov edi, dword [rsi + rbp]
mov eax, dword [r15 - 4]
mov r14d, dword [r15]
mov ebx, dword [r15 + 4]
mov r15d, dword [rcx + 4]
mov esi, dword [rcx + 0xc]
mov r13d, dword [rcx + 8]
mov ebp, dword [rcx]
mov qword [rsp + 0x30], 0
mov r12, qword [rsp + 0x30]
bswap edi
bswap eax
bswap r14d
bswap ebx
nop word [rax + rax]
movzx ecx, byte [r12 + rdx]
mov r8d, r14d
xor edi, ecx
xor r8d, edi
mov edx, r8d
mov ecx, r8d
ror ecx, 8
ror edx, 0x18
xor edx, ecx
mov ecx, r15d
xor r8d, edx
xor ecx, r8d
xor eax, ecx
mov ecx, esi
xor ecx, r8d
xor ebx, ecx
mov r10d, ebx
mov r9d, ebx
xor r10d, eax
shr r9d, 0x1e
ror eax, 0x1f
mov edx, r10d
ror edx, 0x18
mov ecx, r10d
ror ecx, 8
xor edx, ecx
mov ecx, r13d
xor r10d, edx
xor ecx, r10d
xor r14d, ecx
lea ecx, [rbx*4]
or r9d, ecx
mov r8d, r14d
shr r8d, 0x1b
mov ecx, r9d
mov edx, r9d
shl r14d, 5
or r8d, r14d
lea r14, [0x1400c0a30]
or ecx, r8d
mov ebx, r8d
not ecx
xor eax, ecx
and ebx, eax
xor ebx, ebp
xor ebx, r10d
xor ebx, edi
xor edx, ebx
mov ecx, ebx
xor edx, r8d
ror ebx, 2
xor edx, eax
xor ebx, esi
or ecx, edx
mov r11d, edx
not ecx
xor eax, ecx
movzx ecx, byte [r12 + r14 + 1]
and r11d, eax
ror eax, 1
xor r11d, r9d
xor eax, r15d
mov r9d, edx
xor r11d, ecx
shr edx, 5
shl r9d, 0x1b
or r9d, edx
mov r8d, r9d
xor r8d, r11d
mov edx, r8d
mov ecx, r8d
ror edx, 0x18
ror ecx, 8
xor edx, ecx
xor r8d, edx
xor ebx, r8d
xor eax, r8d
mov r10d, ebx
xor r10d, eax
mov edx, r10d
ror edx, 0x18
ror eax, 0x1f
mov ecx, r10d
ror ecx, 8
xor edx, ecx
mov ecx, r13d
xor r10d, edx
xor ecx, r10d
xor r9d, ecx
lea ecx, [rbx*4]
mov r8d, r9d
shl r9d, 5
shr r8d, 0x1b
or r8d, r9d
mov r9d, ebx
shr r9d, 0x1e
mov ebx, r8d
or r9d, ecx
mov ecx, r9d
mov edx, r9d
or ecx, r8d
not ecx
xor eax, ecx
and ebx, eax
xor ebx, ebp
xor ebx, r10d
xor ebx, r11d
xor edx, ebx
mov ecx, ebx
xor edx, r8d
ror ebx, 2
xor edx, eax
xor ebx, esi
or ecx, edx
mov r11d, edx
not ecx
xor eax, ecx
movzx ecx, byte [r12 + r14 + 2]
and r11d, eax
ror eax, 1
xor r11d, r9d
xor eax, r15d
xor r11d, ecx
mov r9d, edx
shr edx, 5
shl r9d, 0x1b
or r9d, edx
mov r8d, r9d
xor r8d, r11d
mov edx, r8d
mov ecx, r8d
ror ecx, 8
ror edx, 0x18
xor edx, ecx
xor r8d, edx
xor ebx, r8d
xor eax, r8d
mov r10d, ebx
xor r10d, eax
ror eax, 0x1f
mov edx, r10d
mov ecx, r10d
ror ecx, 8
ror edx, 0x18
xor edx, ecx
mov ecx, r13d
xor r10d, edx
xor ecx, r10d
xor r9d, ecx
lea ecx, [rbx*4]
mov r8d, r9d
shl r9d, 5
shr r8d, 0x1b
or r8d, r9d
mov r9d, ebx
shr r9d, 0x1e
mov edi, r8d
or r9d, ecx
mov ecx, r9d
or ecx, r8d
not ecx
xor eax, ecx
and edi, eax
mov edx, r9d
xor edi, ebp
xor edi, r10d
xor edi, r11d
xor edx, edi
mov ecx, edi
xor edx, r8d
ror edi, 2
xor edx, eax
xor edi, esi
or ecx, edx
mov ebx, edx
not ecx
xor eax, ecx
movzx ecx, byte [r12 + r14 + 3]
and ebx, eax
ror eax, 1
xor ebx, r9d
xor eax, r15d
xor ebx, ecx
mov r9d, edx
shr edx, 5
shl r9d, 0x1b
or r9d, edx
mov r8d, r9d
xor r8d, ebx
mov edx, r8d
mov ecx, r8d
ror ecx, 8
ror edx, 0x18
xor edx, ecx
xor r8d, edx
xor eax, r8d
xor edi, r8d
mov r10d, edi
xor r10d, eax
ror eax, 0x1f
mov edx, r10d
mov ecx, r10d
ror ecx, 8
ror edx, 0x18
xor edx, ecx
mov ecx, r13d
xor r10d, edx
xor ecx, r10d
xor r9d, ecx
lea ecx, [rdi*4]
mov r8d, r9d
shl r9d, 5
shr r8d, 0x1b
or r8d, r9d
mov r9d, edi
shr r9d, 0x1e
mov r11d, r8d
or r9d, ecx
mov ecx, r9d
or ecx, r8d
not ecx
xor eax, ecx
mov ecx, r9d
and r11d, eax
mov edx, eax
xor r11d, ebp
xor r11d, r10d
xor r11d, ebx
xor ecx, r11d
xor ecx, r8d
xor ecx, eax
mov eax, r11d
or eax, ecx
mov edi, ecx
not eax
mov r14d, ecx
xor edx, eax
and edi, edx
mov eax, edx
xor edi, r9d
shl eax, 0x1f
shr edx, 1
or eax, edx
mov ebx, r11d
shl r14d, 0x1b
shl ebx, 0x1e
lea rdx, [0x1400c0a30]
shr ecx, 5
add r12, 4
shr r11d, 2
or r14d, ecx
or ebx, r11d
cmp r12, 0x10
jne 0x140040a70
mov rsi, qword [rsp + 0x28]
mov edx, edi
mov r12, qword [rsp + 0x80]
xor edx, r14d
mov r15, qword [rsp + 0x20]
xor edx, 0xd4
mov rbp, qword [rsp + 0x88]
mov r8d, edx
ror r8d, 0x18
mov ecx, edx
mov r9, qword [r12 + 8]
add r15, 0x10
ror ecx, 8
xor r8d, ecx
mov qword [rsp + 0x20], r15
xor r8d, edx
xor edi, dword [r9]
mov ecx, r8d
xor ecx, dword [r9 + 4]
xor r8d, dword [r9 + 0xc]
xor eax, ecx
xor ebx, r8d
mov r8d, ebx
xor r8d, eax
mov edx, r8d
mov ecx, r8d
ror ecx, 8
ror edx, 0x18
xor edx, ecx
xor r8d, edx
lea rdx, [0x1400c0a30]
xor edi, r8d
mov ecx, r8d
xor ecx, dword [r9 + 8]
xor edi, 0xd4
xor ecx, r14d
bswap edi
mov dword [rsi - 8], edi
bswap eax
mov dword [rsi - 4], eax
bswap ecx
mov dword [rsi], ecx
bswap ebx
mov dword [rsi + 4], ebx
add rsi, 0x10
sub qword [rsp + 0x98], 1
mov qword [rsp + 0x28], rsi
jne 0x140040a30
mov r15, qword [rsp + 0x40]
mov r14, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x90]
mov rdi, qword [rsp + 0x50]
add rsp, 0x58
pop r13
pop r12
pop rbp
pop rbx
ret