Function at 0x18012bd90
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Hash data with crc32

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xe8
movdqa xmmword [rsp + 0xd0], xmm6
mov r14, r9
mov r15, r8
mov rdi, rdx
mov rsi, rcx
movzx eax, byte [rdx]
test rax, rax
je 0x18012be1d
cmp eax, 1
jne 0x18012be61
mov rbx, qword [rdi + 0x18]
test rbx, rbx
je 0x18012bec0
cmp r14, rbx
mov r9, rbx
cmovb r9, r14
mov rdx, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
lea rcx, [rsp + 0x40]
mov r8, r15
call qword [rax + 0x18]
cmp qword [rsp + 0x40], 0
mov rax, qword [rsp + 0x48]
mov ecx, 1
jne 0x18012bec4
sub rbx, rax
jb 0x18012c60b
mov qword [rdi + 0x18], rbx
xor ecx, ecx
jmp 0x18012bec4
mov rbx, qword [rdi + 0x18]
test rbx, rbx
je 0x18012beb5
cmp r14, rbx
cmovae r14, rbx
mov rdx, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
lea rcx, [rsp + 0x40]
mov r8, r15
mov r9, r14
call qword [rax + 0x18]
cmp qword [rsp + 0x40], 0
mov rax, qword [rsp + 0x48]
je 0x18012bf5d
mov qword [rsi + 8], rax
jmp 0x18012c345
mov rbx, qword [rdi + 0x30]
test rbx, rbx
je 0x18012beb5
mov r12, qword [rdi + 0x18]
test r12, r12
je 0x18012bf7a
cmp rbx, r14
mov r9, r14
cmovb r9, rbx
cmp r9, r12
cmovae r9, r12
mov rdx, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
lea rcx, [rsp + 0x40]
mov r8, r15
call qword [rax + 0x18]
cmp qword [rsp + 0x40], 0
mov r13, qword [rsp + 0x48]
je 0x18012bf7f
mov qword [rsi + 8], r13
jmp 0x18012c345
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
jmp 0x18012c34c
xor ecx, ecx
xor eax, eax
test r14, r14
je 0x18012bf51
mov r8d, dword [rdi + 0x28]
mov edx, dword [rdi + 0x20]
mov r9d, dword [rdi + 0x24]
xor r10d, r10d
lea r11, [0x1801e8b98]
nop word cs:[rax + rax]
mov ebp, r8d
or ebp, 3
mov ebx, ebp
and ebx, 0xfffffffe
imul ebx, ebp
shr ebx, 8
xor bl, byte [r15 + r10]
mov ebp, edx
xor bpl, bl
movzx r12d, bpl
shr edx, 8
xor edx, dword [r11 + r12*4]
movzx ebp, dl
add ebp, r9d
imul r9d, ebp, 0x8088405
inc r9d
mov ebp, r9d
shr ebp, 0x18
movzx r12d, r8b
xor r12d, ebp
shr r8d, 8
xor r8d, dword [r11 + r12*4]
mov byte [r15 + r10], bl
inc r10
cmp r14, r10
jne 0x18012bef0
mov dword [rdi + 0x28], r8d
mov dword [rdi + 0x20], edx
mov dword [rdi + 0x24], r9d
mov qword [rsi], rcx
mov qword [rsi + 8], rax
jmp 0x18012c34c
sub rbx, rax
jb 0x18012c60b
mov qword [rdi + 0x18], rbx
mov qword [rsi + 8], rax
mov qword [rsi], 0
jmp 0x18012c34c
xor r13d, r13d
jmp 0x18012bf9c
sub r12, r13
jb 0x18012c60b
mov qword [rdi + 0x18], r12
sub rbx, r13
mov qword [rdi + 0x30], rbx
cmp r13, r14
ja 0x18012c60b
lea rcx, [rdi + 0x98]
movzx r12d, byte [rdi + 0xd8]
mov eax, 0x40
sub rax, r12
mov rbx, r13
sub rbx, rax
mov rdx, rcx
mov qword [rsp + 0x28], rcx
jae 0x18012bfd9
add rcx, r12
mov rdx, r15
mov r8, r13
call fcn.180167370
add r12, r13
jmp 0x18012c05a
mov r14, r13
mov r8, r13
mov r13, r15
test r12, r12
je 0x18012c01c
lea r13, [r15 + rax]
add r12, rcx
mov rcx, r12
mov rdx, r15
mov r8, rax
call fcn.180167370
inc qword [rdi + 0x38]
lea rcx, [rdi + 0x40]
mov r8d, 1
mov rdx, qword [rsp + 0x28]
call fcn.1800f0350
mov rcx, qword [rsp + 0x28]
mov r8, rbx
mov rbp, r8
and rbp, 0xffffffffffffffc0
mov r12d, r8d
and r12d, 0x3f
add rbp, r13
cmp r8, 0x40
jb 0x18012c04c
shr r8, 6
add qword [rdi + 0x38], r8
lea rcx, [rdi + 0x40]
mov rdx, r13
call fcn.1800f0350
mov rcx, qword [rsp + 0x28]
mov rdx, rbp
mov r8, r12
call fcn.180167370
mov r13, r14
mov byte [rdi + 0xd8], r12b
mov rcx, qword [rdi + 0x20]
mov rax, qword [rdi + 0x28]
mov rdx, r15
mov r8, r13
call qword [rax + 0x18]
cmp qword [rdi + 0x30], 0
je 0x18012c089
mov qword [rsi + 8], r13
mov qword [rsi], 0
jmp 0x18012c34c
mov qword [rsp + 0x98], r13
cmp byte [rdi + 0xe0], 0
jne 0x18012c60b
mov byte [rdi + 0xe0], 1
mov word [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov rbp, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
mov qword [rsp + 0xa8], rax
mov rbx, qword [rdi + 0x18]
mov r13d, 0xa
lea r12, [rsp + 0x30]
mov qword [rsp + 0xa0], rbp
jmp 0x18012c119
mov rcx, qword [0x1801fe9b8]
xor edx, edx
mov r8, r14
call qword [sym.imp.kernel32.dll_HeapFree]
mov rcx, qword [0x1801fe9b8]
xor edx, edx
mov r8, rbp
call qword [sym.imp.kernel32.dll_HeapFree]
mov rbp, qword [rsp + 0xa0]
nop word [rax + rax]
test r13, r13
je 0x18012c331
test rbx, rbx
je 0x18012c328
cmp r13, rbx
mov r9, rbx
cmovb r9, r13
lea rcx, [rsp + 0x40]
mov rdx, rbp
mov r8, r12
mov rax, qword [rsp + 0xa8]
call qword [rax + 0x18]
cmp qword [rsp + 0x40], 0
mov r15, qword [rsp + 0x48]
je case.default.0x18012c164
mov r14d, r15d
and r14d, 3
lea rcx, [0x18012c634]
movsxd rax, dword [rcx + r14*4]
add rax, rcx
jmp rax
movzx eax, byte [r15 + 0x10]
jmp 0x18012c1a7
sub rbx, r15
jb 0x18012c60b
mov qword [rdi + 0x18], rbx
test r15, r15
je 0x18012c328
sub r13, r15
jb 0x18012c60b
add r12, r15
jmp 0x18012c110
cmp al, 0x23
jne 0x18012c334
lea rax, [r14 - 2]
cmp rax, 2
jb 0x18012c110
test r14, r14
je 0x18012c110
lea rbp, [r15 - 1]
mov r14, qword [r15 - 1]
mov r15, qword [r15 + 7]
mov rcx, r14
call qword [r15]
cmp qword [r15 + 8], 0
je 0x18012c0f0
cmp qword [r15 + 0x10], 0x11
jb 0x18012c0de
mov r14, qword [r14 - 8]
jmp 0x18012c0de
lea r15, str.failed_to_fill_whole_buffer
jmp 0x18012c334
xor r15d, r15d
test r15, r15
mov r13, qword [rsp + 0x98]
je 0x18012c368
mov qword [rsi + 8], r15
mov qword [rsi], 1
movaps xmm6, xmmword [rsp + 0xd0]
add rsp, 0xe8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [rdi + 0x38]
movups xmm0, xmmword [rdi + 0x40]
mov ecx, dword [rdi + 0x50]
movzx r14d, byte [rdi + 0xd8]
shl rax, 9
lea rbx, [r14*8]
or rbx, rax
mov dword [rsp + 0x90], ecx
movaps xmmword [rsp + 0x80], xmm0
mov byte [rdi + r14 + 0x98], 0x80
mov r8, r14
xor r8, 0x3f
je 0x18012c3be
mov rax, qword [rsp + 0x28]
lea rcx, [r14 + rax]
inc rcx
xor edx, edx
call fcn.180167a10
bswap rbx
xor r14d, 0x38
cmp r14d, 8
jae 0x18012c419
lea r14, [rsp + 0x80]
mov r8d, 1
mov rcx, r14
mov r15, qword [rsp + 0x28]
mov rdx, r15
call fcn.1800f0350
xorps xmm0, xmm0
movaps xmmword [rsp + 0x60], xmm0
movaps xmmword [rsp + 0x50], xmm0
movaps xmmword [rsp + 0x40], xmm0
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x78], rbx
lea rdx, [rsp + 0x40]
mov r8d, 1
mov rcx, r14
jmp 0x18012c436
mov qword [rdi + 0xd0], rbx
lea rcx, [rsp + 0x80]
mov r8d, 1
mov r15, qword [rsp + 0x28]
mov rdx, r15
call fcn.1800f0350
mov eax, dword [rsp + 0x90]
bswap eax
movdqa xmm0, xmmword [rsp + 0x80]
pxor xmm6, xmm6
movdqa xmm1, xmm0
punpckhbw xmm1, xmm6
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
punpcklbw xmm0, xmm6
pshuflw xmm0, xmm0, 0x1b
pshufhw xmm0, xmm0, 0x1b
packuswb xmm0, xmm1
movups xmm1, xmmword [rdi + 0x60]
mov ecx, dword [rdi + 0x70]
mov rdx, qword [rdi + 0x58]
movdqu xmmword [rdi + 0x98], xmm0
mov dword [rdi + 0xa8], eax
mov byte [rdi + 0xd8], 0x14
shl rdx, 9
or rdx, 0xa0
mov dword [rsp + 0x50], ecx
movaps xmmword [rsp + 0x40], xmm1
bswap rdx
mov byte [rdi + 0xac], 0x80
movdqu xmmword [rdi + 0xad], xmm6
movdqu xmmword [rdi + 0xbd], xmm6
mov dword [rdi + 0xcc], 0
mov qword [rdi + 0xd0], rdx
lea rcx, [rsp + 0x40]
mov r8d, 1
mov rdx, r15
call fcn.1800f0350
movups xmm0, xmmword [rdi + 0x80]
mov eax, dword [rdi + 0x90]
mov rcx, qword [rdi + 0x78]
mov edx, dword [rsp + 0x50]
bswap edx
movdqa xmm1, xmmword [rsp + 0x40]
movdqa xmm2, xmm1
punpckhbw xmm2, xmm6
pshuflw xmm2, xmm2, 0x1b
pshufhw xmm2, xmm2, 0x1b
punpcklbw xmm1, xmm6
pshuflw xmm1, xmm1, 0x1b
pshufhw xmm1, xmm1, 0x1b
packuswb xmm1, xmm2
mov qword [rdi + 0x38], rcx
mov dword [rdi + 0x50], eax
movups xmmword [rdi + 0x40], xmm0
mov byte [rdi + 0xd8], 0
movdqa xmmword [rsp + 0xb0], xmm1
mov dword [rsp + 0xc0], edx
lea rcx, [rsp + 0xb0]
lea rdx, [rsp + 0x30]
call fcn.1800255a0
test al, al
je 0x18012c079
movzx eax, byte [0x1801fea30]
mov ecx, 0x5b
mov edx, 1
call fcn.180020bb0
test rax, rax
je 0x18012c60f
mov rdi, rax
movups xmm0, xmmword [0x1801e89d9]
movups xmmword [rax + 0x4b], xmm0
movups xmm0, xmmword [0x1801e89ce]
movups xmmword [rax + 0x40], xmm0
movups xmm0, xmmword [0x1801e89be]
movups xmmword [rax + 0x30], xmm0
movups xmm0, xmmword [0x1801e89ae]
movups xmmword [rax + 0x20], xmm0
movups xmm0, xmmword [0x1801e899e]
movups xmmword [rax + 0x10], xmm0
movups xmm0, xmmword [0x1801e898e]
movups xmmword [rax], xmm0
movzx eax, byte [0x1801fea30]
mov ecx, 0x18
mov edx, 8
call fcn.180020bb0
test rax, rax
je 0x18012c620
mov qword [rax], rdi
mov qword [rax + 8], 0x5b
mov qword [rax + 0x10], 0x5b
lea r8, fcn.18005a590
mov cl, 0x15
mov rdx, rax
call fcn.1800f9ab0
jmp 0x18012be58
ud2
mov ecx, 1
mov edx, 0x5b
call fcn.180169390
ud2
mov ecx, 8
mov edx, 0x18
call fcn.180169390
ud2