Function at 0x140161170
Capabilities:
Encode data using xor

Disassembly:
push rbp
push rbx
push rdi
push r12
lea rbp, [rsp - 0x5a8]
sub rsp, 0x6a8
mov rax, qword [0x140375828]
xor rax, rsp
mov qword [rbp + 0x580], rax
mov r12, qword [rbp + 0x600]
mov edi, edx
mov dword [rsp + 0x54], r8d
mov rbx, rcx
mov r8, qword [rbp + 0x5f8]
mov r10d, 0x10
mov qword [rsp + 0x60], r8
mov qword [rbp - 0x80], r9
mov qword [rsp + 0x70], r12
cmp edx, 0x100
jbe 0x1401611d6
mov eax, dword [rcx + 0x400]
mov dword [rsp + 0x24], eax
jmp 0x1401611db
mov dword [rsp + 0x24], r10d
xor eax, eax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], rax
mov qword [rbp - 0x50], rax
mov qword [rbp - 0x48], rax
mov qword [rbp - 0x40], rax
mov qword [rbp - 0x38], rax
mov dword [rbp - 0x30], eax
mov eax, dword [rcx]
lea rcx, [rcx + 4]
inc dword [rbp + rax*4 - 0x70]
add edx, 0xffffffff
jne 0x140161200
cmp dword [rbp - 0x70], edi
jne 0x140161222
xor eax, eax
mov qword [r8], rax
mov dword [r12], eax
jmp 0x140161652
mov qword [rsp + 0x6a0], r13
mov r13d, 1
mov ecx, r13d
mov eax, ecx
cmp dword [rbp + rax*4 - 0x70], 0
jne 0x140161243
inc ecx
cmp ecx, r10d
jbe 0x140161233
mov dword [rsp + 0x20], ecx
cmp dword [r12], ecx
jae 0x140161251
mov dword [r12], ecx
mov eax, r10d
cmp dword [rbp + rax*4 - 0x70], 0
jne 0x140161261
add r10d, 0xffffffff
jne 0x140161251
mov dword [rsp + 0x28], r10d
cmp dword [r12], r10d
jbe 0x140161270
mov dword [r12], r10d
mov edx, r13d
shl edx, cl
cmp ecx, r10d
jae 0x140161291
nop word [rax + rax]
mov eax, ecx
sub edx, dword [rbp + rax*4 - 0x70]
js 0x1401612a6
inc ecx
add edx, edx
cmp ecx, r10d
jb 0x140161280
mov eax, r10d
lea rcx, [rbp - 0x70]
lea rcx, [rcx + rax*4]
mov eax, dword [rcx]
sub edx, eax
mov dword [rsp + 0x58], edx
jns 0x1401612b0
mov eax, 2
jmp 0x14016164a
add eax, edx
mov qword [rsp + 0x6e0], rsi
mov dword [rcx], eax
xor ecx, ecx
mov qword [rsp + 0x690], r15
mov dword [rbp - 0x1c], ecx
add r10d, 0xffffffff
je 0x1401612f2
xor eax, eax
nop dword [rax]
nop word [rax + rax]
add ecx, dword [rbp + rax - 0x6c]
mov dword [rbp + rax - 0x18], ecx
lea rax, [rax + 4]
add r10d, 0xffffffff
jne 0x1401612e0
xor edx, edx
lea rcx, [rbp + 0x100]
mov r8d, 0x480
call sub.VCRUNTIME140.dll_memset
xor edx, edx
nop dword [rax + rax]
mov eax, dword [rbx]
lea rbx, [rbx + 4]
test eax, eax
je 0x14016132f
lea rcx, [rbp - 0x20]
lea rcx, [rcx + rax*4]
mov eax, dword [rcx]
mov dword [rbp + rax*4 + 0x100], edx
inc eax
mov dword [rcx], eax
inc edx
cmp edx, edi
jb 0x140161310
movsxd rbx, dword [rsp + 0x28]
lea r9, [rbp + 0x100]
mov r11d, dword [rsp + 0x20]
xor r15d, r15d
xor edi, edi
mov qword [rsp + 0x698], r14
or r10, 0xffffffffffffffff
mov qword [rsp + 0x48], r9
mov eax, dword [rbp + rbx*4 - 0x20]
xor r8d, r8d
xor esi, esi
mov dword [rsp + 0x50], eax
mov dword [rbp - 0x20], r15d
mov dword [rbp + 0x30], r15d
mov qword [rbp + 0x80], rdi
cmp r11d, ebx
jg 0x140161619
mov r14, r10
movsxd rax, r11d
mov edx, dword [rbp + rax*4 - 0x70]
lea rax, [rbp + rax*4 - 0x70]
mov qword [rsp + 0x78], rax
test edx, edx
je 0x140161603
lea eax, [rdx + 1]
dec edx
lea r12, [r14*4]
mov ecx, dword [rbp + r12 + 0x34]
dec eax
add ecx, edi
mov dword [rsp + 0x2c], edx
mov dword [rsp + 0x30], eax
cmp r11d, ecx
jle 0x1401614fa
nop dword [rax]
nop dword [rax + rax]
add edi, dword [rbp + r12 + 0x34]
lea r12, [r12 + 4]
mov rax, qword [rsp + 0x70]
mov r8d, ebx
inc r10d
sub r8d, edi
inc r14
mov qword [rsp + 0x68], r10
mov ebx, r11d
mov eax, dword [rax]
cmp r8d, eax
cmova r8d, eax
sub ebx, edi
mov ecx, ebx
mov eax, r13d
shl eax, cl
cmp eax, dword [rsp + 0x30]
jbe 0x140161436
or ecx, 0xffffffff
inc ebx
sub ecx, edx
add eax, ecx
mov rcx, qword [rsp + 0x78]
cmp ebx, r8d
jae 0x140161436
nop
mov edx, dword [rcx + 4]
lea rcx, [rcx + 4]
add eax, eax
cmp eax, edx
jbe 0x140161436
sub eax, edx
inc ebx
cmp ebx, r8d
jb 0x140161420
mov ecx, dword [rsp + 0x24]
lea eax, [rdi + rbx]
cmp eax, ecx
jbe 0x140161449
cmp edi, ecx
jae 0x140161449
mov ebx, ecx
sub ebx, edi
mov ecx, ebx
mov dword [rbp + r12 + 0x34], ebx
mov esi, r13d
shl esi, cl
lea ecx, [rsi + 1]
shl rcx, 4
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
test rax, rax
je 0x14016166e
mov rcx, qword [rsp + 0x60]
lea r8, [rax + 0x10]
add rax, 8
mov qword [rbp + r14*8 + 0x80], r8
mov qword [rsp + 0x60], rax
mov qword [rcx], r8
mov qword [rax], 0
test r14, r14
je 0x1401614d7
movzx eax, byte [rbp + r12 + 0x30]
mov ecx, edi
mov byte [rsp + 0x39], al
mov edx, r13d
shl edx, cl
lea eax, [rbx + 0x20]
sub ecx, dword [rbp + r12 + 0x30]
dec edx
mov byte [rsp + 0x38], al
mov eax, r15d
and rdx, rax
mov qword [rsp + 0x40], r8
mov rax, qword [rbp + r14*8 + 0x78]
movups xmm0, xmmword [rsp + 0x38]
shr rdx, cl
add rdx, rdx
mov dword [rbp + r12 - 0x20], r15d
movups xmmword [rax + rdx*8], xmm0
mov r11d, dword [rsp + 0x20]
lea eax, [rdi + rbx]
mov r10, qword [rsp + 0x68]
mov edx, dword [rsp + 0x2c]
mov ebx, dword [rsp + 0x28]
cmp r11d, eax
jg 0x1401613d0
mov r9, qword [rsp + 0x48]
movzx eax, r11b
lea rcx, [rbp + 0x100]
sub al, dil
mov byte [rsp + 0x39], al
mov eax, dword [rsp + 0x50]
lea rcx, [rcx + rax*4]
cmp r9, rcx
jb 0x140161520
mov byte [rsp + 0x38], 0x63
jmp 0x140161568
mov eax, dword [r9]
mov ecx, dword [rsp + 0x54]
cmp eax, ecx
jae 0x14016153f
cmp eax, 0x100
setb al
add al, 0x1f
mov byte [rsp + 0x38], al
movzx eax, word [r9]
jmp 0x14016155a
sub eax, ecx
mov ecx, eax
mov rax, qword [rbp + 0x5f0]
movzx eax, byte [rcx + rax]
mov byte [rsp + 0x38], al
mov rax, qword [rbp - 0x80]
movzx eax, word [rax + rcx*2]
add r9, 4
mov word [rsp + 0x40], ax
mov qword [rsp + 0x48], r9
mov ecx, r11d
mov r9d, r13d
sub ecx, edi
mov edx, r15d
shl r9d, cl
mov ecx, edi
shr edx, cl
cmp edx, esi
jae 0x1401615a1
movups xmm1, xmmword [rsp + 0x38]
nop dword [rax]
nop word [rax + rax]
mov eax, edx
add edx, r9d
add rax, rax
movups xmmword [r8 + rax*8], xmm1
cmp edx, esi
jb 0x140161590
lea ecx, [r11 - 1]
mov eax, r13d
shl eax, cl
test r15d, eax
je 0x1401615ba
nop
xor r15d, eax
shr eax, 1
test r15d, eax
jne 0x1401615b0
xor r15d, eax
mov ecx, edi
mov eax, r13d
shl eax, cl
dec eax
and eax, r15d
cmp eax, dword [rbp + r14*4 - 0x20]
je 0x1401615ee
sub edi, dword [rbp + r14*4 + 0x30]
dec r14
mov ecx, edi
mov eax, r13d
shl eax, cl
dec r10d
dec eax
and eax, r15d
cmp eax, dword [rbp + r14*4 - 0x20]
jne 0x1401615d0
mov edx, dword [rsp + 0x2c]
mov r9, qword [rsp + 0x48]
mov eax, dword [rsp + 0x30]
test edx, edx
jne 0x1401613a0
inc r11d
mov dword [rsp + 0x20], r11d
cmp r11d, ebx
jle 0x140161384
mov r12, qword [rsp + 0x70]
cmp dword [rsp + 0x58], 0
mov eax, dword [rbp + 0x34]
mov dword [r12], eax
je 0x14016162c
cmp ebx, r13d
jne 0x14016162f
xor r13d, r13d
mov eax, r13d
mov r14, qword [rsp + 0x698]
mov rsi, qword [rsp + 0x6e0]
mov r15, qword [rsp + 0x690]
mov r13, qword [rsp + 0x6a0]
mov rcx, qword [rbp + 0x580]
xor rcx, rsp
call fcn.1401dd140
add rsp, 0x6a8
pop r12
pop rdi
pop rbx
pop rbp
ret
cmp dword [rsp + 0x68], 0
je 0x140161681
mov rcx, qword [rbp + 0x80]
call fcn.140161690
mov eax, 3
jmp 0x140161632