Function at 0x140123350
Capabilities:
Encode data using xor

Disassembly:
mov dword [rsp + 0x20], r9d
push rbx
push rbp
push r12
push r13
sub rsp, 0x28
xor ebx, ebx
mov r13d, r8d
mov r12d, edx
mov ebp, ecx
test ecx, ecx
js 0x140123638
cmp ecx, 8
ja 0x140123638
test r8d, r8d
js 0x140123638
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x58], rdi
mov edi, 1
mov esi, edi
shl esi, cl
cmp r8d, esi
jge 0x14012362e
test r9d, r9d
jle 0x14012362e
cmp r9d, esi
jge 0x14012362e
mov ecx, dword [rsp + 0x70]
test ecx, ecx
js 0x14012362e
cmp ecx, esi
jge 0x14012362e
mov qword [rsp + 0x60], r14
mov r14d, dword [rsp + 0x78]
test r14d, r14d
js 0x140123629
mov eax, esi
sub eax, ecx
dec eax
cmp r14d, eax
jge 0x140123629
lea edx, [rbx + 0x38]
mov ecx, edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov rbx, rax
test rax, rax
je 0x140123629
mov dword [rax], ebp
lea ebp, [rsi - 1]
mov qword [rsp + 0x20], r15
movsxd r15, esi
mov rcx, r15
mov dword [rax + 4], ebp
mov dword [rax + 0x30], r14d
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rbx + 8], rax
mov r14, rax
test rax, rax
je 0x140123445
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rbx + 0x10], rax
mov r10, rax
test rax, rax
jne 0x140123455
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor ebx, ebx
jmp 0x140123624
mov byte [rax], bpl
xor r15d, r15d
movsxd rax, ebp
mov r8d, edi
mov r9d, r15d
mov byte [rax + r14], 0
test ebp, ebp
jle 0x1401234a4
mov r11d, r15d
movsxd rax, r8d
lea r11, [r11 + 1]
mov ecx, esi
mov byte [rax + r10], r9b
mov byte [r14 + r11 - 1], r8b
add r8d, r8d
and ecx, r8d
mov edx, r8d
xor r8d, r12d
test ecx, ecx
cmove r8d, edx
inc r9d
and r8d, ebp
cmp r9d, ebp
jl 0x140123470
cmp r8d, edi
jne 0x1401234c1
mov r12d, dword [rsp + 0x70]
movsxd rcx, r12d
inc rcx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rbx + 0x18], rax
mov rcx, rax
test rax, rax
jne 0x1401234e5
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rbx + 0x10]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rbx, r15
jmp 0x140123624
mov r14d, dword [rsp + 0x68]
xor edx, edx
mov eax, edi
mov dword [rbx + 0x24], r13d
div r14d
mov dword [rbx + 0x28], r14d
mov dword [rbx + 0x20], r12d
test edx, edx
je 0x14012350d
add edi, ebp
mov eax, edi
cdq
idiv r14d
test edx, edx
jne 0x140123501
mov eax, edi
imul r13d, r14d
cdq
mov byte [rcx], 1
idiv r14d
mov dword [rbx + 0x2c], eax
test r12d, r12d
jle 0x1401235fe
mov rsi, r15
mov rbp, r12
nop dword [rax]
mov rax, qword [rbx + 0x18]
mov r11, rsi
mov byte [rsi + rax + 1], 1
test rsi, rsi
jle 0x1401235a1
mov r9, qword [rbx + 0x18]
add r9, r11
movzx eax, byte [r9]
test al, al
je 0x140123591
mov r8d, dword [rbx + 4]
mov ecx, eax
mov rax, qword [rbx + 0x10]
mov rdi, qword [rbx + 8]
movzx eax, byte [rcx + rax]
add eax, r13d
cmp eax, r8d
jl 0x140123584
mov r10d, dword [rbx]
nop dword [rax]
sub eax, r8d
mov ecx, r10d
mov edx, eax
and eax, r8d
sar edx, cl
add eax, edx
cmp eax, r8d
jge 0x140123570
movsxd rcx, eax
movzx eax, byte [rcx + rdi]
xor al, byte [r9 - 1]
jmp 0x140123596
movzx eax, byte [r9 - 1]
dec r11
mov byte [r9], al
test r11, r11
jg 0x140123541
mov r10, qword [rbx + 0x18]
mov rax, qword [rbx + 0x10]
mov r9d, dword [rbx + 4]
mov r11, qword [rbx + 8]
movzx ecx, byte [r10]
movzx r8d, byte [rcx + rax]
add r8d, r13d
cmp r8d, r9d
jl 0x1401235e3
mov ecx, dword [rbx]
nop dword [rax]
nop dword [rax + rax]
sub r8d, r9d
mov edx, r8d
and r8d, r9d
sar edx, cl
add r8d, edx
cmp r8d, r9d
jge 0x1401235d0
movsxd rax, r8d
inc rsi
add r13d, r14d
movzx ecx, byte [rax + r11]
mov byte [r10], cl
sub rbp, 1
jne 0x140123530
lea r8d, [r12 + 1]
mov rdx, qword [rbx + 0x18]
lea r15, [r15 + 1]
mov rax, qword [rbx + 0x10]
movzx ecx, byte [rdx + r15 - 1]
movzx ecx, byte [rcx + rax]
mov byte [rdx + r15 - 1], cl
sub r8, 1
jne 0x140123603
mov r15, qword [rsp + 0x20]
mov r14, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x58]
mov rax, rbx
add rsp, 0x28
pop r13
pop r12
pop rbp
pop rbx
ret