Function at 0x180005930
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 8], rcx
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
lea rdi, [rcx + 0x2f8]
xor r15d, r15d
movaps xmmword [rsp + 0x20], xmm6
mov ebx, r8d
mov rsi, rdx
mov r13, rcx
cmp qword [rdi + 8], r15
jne 0x180005967
mov eax, r15d
jmp 0x18000596d
mov eax, dword [rdi + 0x10]
sub eax, dword [rdi + 8]
lea edx, [rax + rbx]
mov rcx, rdi
call fcn.180001080
mov rcx, qword [rdi + 0x10]
mov r8, rbx
mov rdx, rsi
call fcn.180014f80
add qword [rdi + 0x10], rbx
mov qword [rsp + 0x78], rbp
movsd xmm6, qword [0x180034c88]
nop dword [rax + rax]
cmp qword [rdi + 8], 0
je 0x180005c8b
mov eax, dword [rdi + 0x10]
sub eax, dword [rdi + 8]
cmp eax, 0xe
jle 0x180005c8b
mov r9, qword [r13 + 0x300]
mov r8, qword [r13 + 0x30]
lea r14, [r13 + 0x30]
mov qword [rsp + 0x88], r14
cmp r8, qword [r9 + 4]
jne 0x1800059e8
movzx r8d, word [r14 + 8]
cmp r8w, word [r9 + 0xc]
jne 0x1800059e8
mov ecx, r15d
jmp 0x1800059ed
sbb ecx, ecx
sbb ecx, 0xffffffff
test ecx, ecx
jne 0x180005c76
mov esi, dword [r9]
test esi, esi
je 0x180005c8b
cmp eax, esi
jl 0x180005c8b
call qword [sym.imp.WINMM.dll_timeGetTime]
lea rbx, [r13 + 0x318]
mov edx, 0x400
mov dword [r13 + 0x1c], eax
mov rax, qword [rbx + 8]
mov rcx, rbx
mov qword [rbx + 0x10], rax
call fcn.180001140
cmp qword [rbx + 8], 0
mov r15, qword [r13 + 0x300]
lea r12d, [rsi - 0xe]
jne 0x180005a44
xor eax, eax
jmp 0x180005a4a
mov eax, dword [rbx + 0x10]
sub eax, dword [rbx + 8]
lea ecx, [rax + r12]
cmp ecx, dword [rbx + 0x18]
jb 0x180005ae1
pxor xmm0, xmm0
mov eax, ecx
cvtsi2sd xmm0, rax
mulsd xmm0, xmm6
call fcn.18002cc90
xor ecx, ecx
mov r8d, 0x1000
lea r9d, [rcx + 4]
cvttsd2si r14, xmm0
shl r14d, 0xa
mov edx, r14d
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rdx, qword [rbx + 8]
mov rbp, rax
test rdx, rdx
jne 0x180005a99
xor ecx, ecx
jmp 0x180005a9e
mov ecx, dword [rbx + 0x10]
sub ecx, edx
mov r13d, ecx
mov r8d, ecx
mov rcx, rax
call fcn.180014f80
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x180005ac3
xor edx, edx
mov r8d, 0x8000
call qword [sym.imp.KERNEL32.dll_VirtualFree]
lea rax, [r13 + rbp]
mov r13, qword [rsp + 0x70]
mov dword [rbx + 0x18], r14d
mov r14, qword [rsp + 0x88]
mov qword [rbx + 0x10], rax
mov qword [rbx + 8], rbp
mov rcx, qword [rbx + 0x10]
lea rdx, [r15 + 0xe]
mov r8d, r12d
mov ebp, r12d
call fcn.180014f80
xor r15d, r15d
mov r11d, r15d
mov r10d, r15d
mov r9d, r15d
test r12d, r12d
jle 0x180005b60
nop word [rax + rax]
movzx ecx, byte [r14 + r9]
mov r8, qword [rbx + 0x10]
inc r9
mov eax, 0x8fb823ef
imul ecx
add edx, ecx
sar edx, 8
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0xcccccccd
imul edx, edx, 0x1c8
sub ecx, edx
mul r11d
add cl, 0x36
xor byte [r8 + r10], cl
shr edx, 3
lea ecx, [rdx + rdx*4]
add ecx, ecx
cmp r11d, ecx
cmove r9, r15
inc r11d
inc r10
cmp r11d, r12d
jl 0x180005b10
add qword [rbx + 0x10], rbp
cmp qword [rbx + 8], r15
jne 0x180005b6f
mov r8d, r15d
jmp 0x180005b77
mov r8d, dword [rbx + 0x10]
sub r8d, dword [rbx + 8]
mov rcx, qword [r13 + 0x28]
mov rdx, qword [r13 + 0x320]
mov rax, qword [rcx]
call qword [rax]
mov edx, dword [rdi + 0x18]
cmp esi, edx
ja 0x1800059a0
mov rax, qword [rdi + 8]
test rax, rax
jne 0x180005ba0
mov ecx, r15d
jmp 0x180005ba5
mov ecx, dword [rdi + 0x10]
sub ecx, eax
cmp esi, ecx
jbe 0x180005bb3
test rax, rax
je 0x180005bd7
mov esi, dword [rdi + 0x10]
sub esi, eax
test esi, esi
je 0x180005bce
sub edx, esi
mov ebx, esi
mov rcx, rax
mov r8d, edx
lea rdx, [rax + rbx]
call fcn.180014f80
sub qword [rdi + 0x10], rbx
mov rax, qword [rdi + 8]
test rax, rax
jne 0x180005bdc
mov ecx, r15d
jmp 0x180005be1
mov ecx, dword [rdi + 0x10]
sub ecx, eax
test rax, rax
je 0x180005bf4
mov eax, dword [rdi + 0x10]
sub eax, dword [rdi + 8]
cmp ecx, eax
jb 0x1800059a0
pxor xmm0, xmm0
mov eax, ecx
cvtsi2sd xmm0, rax
mulsd xmm0, xmm6
call fcn.18002cc90
cvttsd2si rsi, xmm0
shl esi, 0xa
cmp esi, dword [rdi + 0x18]
jb 0x1800059a0
xor ecx, ecx
mov edx, esi
mov r8d, 0x1000
lea r9d, [rcx + 4]
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rdx, qword [rdi + 8]
mov rbp, rax
test rdx, rdx
jne 0x180005c3e
mov ecx, r15d
jmp 0x180005c43
mov ecx, dword [rdi + 0x10]
sub ecx, edx
mov ebx, ecx
mov r8d, ecx
mov rcx, rax
call fcn.180014f80
mov rcx, qword [rdi + 8]
xor edx, edx
mov r8d, 0x8000
call qword [sym.imp.KERNEL32.dll_VirtualFree]
lea rax, [rbx + rbp]
mov qword [rdi + 8], rbp
mov qword [rdi + 0x10], rax
mov dword [rdi + 0x18], esi
jmp 0x1800059a0
mov rax, qword [rdi + 8]
mov edx, 0x400
mov rcx, rdi
mov qword [rdi + 0x10], rax
call fcn.180001140
mov rbp, qword [rsp + 0x78]
movaps xmm6, xmmword [rsp + 0x20]
xor eax, eax
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret