Function at 0x180169ef0
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 0x180169f7d
cmp eax, 1
jne 0x180169fc1
mov rbx, qword [rdi + 0x18]
test rbx, rbx
je 0x18016a020
cmp r14, rbx
mov r9, rbx
cmovb r9, r14
mov rdx, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
lea rcx, [rsp + 0x20]
mov r8, r15
call qword [rax + 0x18]
cmp qword [rsp + 0x20], 0
mov rax, qword [rsp + 0x28]
mov ecx, 1
jne 0x18016a024
sub rbx, rax
jb 0x18016a632
mov qword [rdi + 0x18], rbx
xor ecx, ecx
jmp 0x18016a024
mov rbx, qword [rdi + 0x18]
test rbx, rbx
je 0x18016a015
cmp r14, rbx
cmovae r14, rbx
mov rdx, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
lea rcx, [rsp + 0x20]
mov r8, r15
mov r9, r14
call qword [rax + 0x18]
cmp qword [rsp + 0x20], 0
mov rax, qword [rsp + 0x28]
je 0x18016a0bd
mov qword [rsi + 8], rax
jmp 0x18016a36e
mov rbx, qword [rdi + 0x30]
test rbx, rbx
je 0x18016a015
mov r12, qword [rdi + 0x18]
test r12, r12
je 0x18016a0da
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 + 0x20]
mov r8, r15
call qword [rax + 0x18]
cmp qword [rsp + 0x20], 0
mov r13, qword [rsp + 0x28]
je 0x18016a0df
mov qword [rsi + 8], r13
jmp 0x18016a36e
xorps xmm0, xmm0
movups xmmword [rsi], xmm0
jmp 0x18016a375
xor ecx, ecx
xor eax, eax
test r14, r14
je 0x18016a0b1
mov r8d, dword [rdi + 0x28]
mov edx, dword [rdi + 0x20]
mov r9d, dword [rdi + 0x24]
xor r10d, r10d
lea r11, [0x180235670]
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 0x18016a050
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 0x18016a375
sub rbx, rax
jb 0x18016a632
mov qword [rdi + 0x18], rbx
mov qword [rsi + 8], rax
mov qword [rsi], 0
jmp 0x18016a375
xor r13d, r13d
jmp 0x18016a0fc
sub r12, r13
jb 0x18016a632
mov qword [rdi + 0x18], r12
sub rbx, r13
mov qword [rdi + 0x30], rbx
cmp r13, r14
ja 0x18016a682
lea rbp, [rdi + 0x98]
movzx ecx, byte [rdi + 0xd8]
movzx r14d, cl
mov eax, 0x40
sub rax, r14
mov rbx, r13
sub rbx, rax
jae 0x18016a132
lea rcx, [r14 + rbp]
mov rdx, r15
mov r8, r13
call fcn.180199330
add r14, r13
jmp 0x18016a1b0
mov qword [rsp + 0x68], r13
mov r8, r13
mov r12, r15
test cl, cl
je 0x18016a172
lea r12, [r15 + rax]
mov r13, rbp
add r14, rbp
mov rcx, r14
mov rdx, r15
mov r8, rax
call fcn.180199330
inc qword [rdi + 0x38]
lea rcx, [rdi + 0x40]
mov r8d, 1
mov rdx, rbp
call fcn.180114d10
mov r8, rbx
mov r13, r8
and r13, 0xffffffffffffffc0
mov r14d, r8d
and r14d, 0x3f
add r13, r12
cmp r8, 0x40
jb 0x18016a19d
shr r8, 6
add qword [rdi + 0x38], r8
lea rcx, [rdi + 0x40]
mov rdx, r12
call fcn.180114d10
mov rcx, rbp
mov rdx, r13
mov r8, r14
call fcn.180199330
mov r13, qword [rsp + 0x68]
mov byte [rdi + 0xd8], r14b
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 0x18016a1df
mov qword [rsi + 8], r13
mov qword [rsi], 0
jmp 0x18016a375
mov qword [rsp + 0x98], rbp
mov qword [rsp + 0x68], r13
cmp byte [rdi + 0xe0], 0
jne 0x18016a696
mov byte [rdi + 0xe0], 1
mov word [rsp + 0x78], 0
mov qword [rsp + 0x70], 0
mov rbp, qword [rdi + 8]
mov rax, qword [rdi + 0x10]
mov qword [rsp + 0xa8], rax
mov r15, qword [rdi + 0x18]
mov r13d, 0xa
lea r12, [rsp + 0x70]
mov qword [rsp + 0xa0], rsi
jmp 0x18016a259
test r13, r13
je 0x18016a362
test r15, r15
je 0x18016a359
cmp r13, r15
mov r9, r15
cmovb r9, r13
lea rcx, [rsp + 0x20]
mov rdx, rbp
mov r8, r12
mov rax, qword [rsp + 0xa8]
call qword [rax + 0x18]
cmp qword [rsp + 0x20], 0
mov r14, qword [rsp + 0x28]
je case.default.0x18016a2a3
mov ebx, r14d
and ebx, 3
lea rcx, [0x18016a6f4]
movsxd rax, dword [rcx + rbx*4]
add rax, rcx
jmp rax
movzx eax, byte [r14 + 0x10]
jmp 0x18016a2f1
sub r15, r14
jb 0x18016a632
mov qword [rdi + 0x18], r15
test r14, r14
je 0x18016a359
mov rax, r13
sub rax, r14
jb 0x18016a66e
add r12, r14
mov r13, rax
jmp 0x18016a250
cmp al, 0x23
jne 0x18016a365
cmp ebx, 1
jne 0x18016a250
mov rsi, rbp
lea rbp, [r14 - 1]
mov rbx, qword [r14 - 1]
mov r14, qword [r14 + 7]
mov rcx, rbx
call qword [r14]
cmp qword [r14 + 8], 0
je 0x18016a337
cmp qword [r14 + 0x10], 0x11
jb 0x18016a325
mov rbx, qword [rbx - 8]
mov rcx, qword [0x180246f98]
xor edx, edx
mov r8, rbx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [0x180246f98]
xor edx, edx
mov r8, rbp
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rbp, rsi
mov rsi, qword [rsp + 0xa0]
jmp 0x18016a250
lea r14, [0x180234de8]
jmp 0x18016a365
xor r14d, r14d
test r14, r14
je 0x18016a391
mov qword [rsi + 8], r14
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 ebx, byte [rdi + 0xd8]
shl rax, 9
lea r14, [rbx*8]
or r14, rax
mov dword [rsp + 0x90], ecx
movaps xmmword [rsp + 0x80], xmm0
mov byte [rdi + rbx + 0x98], 0x80
mov r8, rbx
xor r8, 0x3f
mov r15, qword [rsp + 0x98]
je 0x18016a3e8
lea rcx, [rbx + r15]
inc rcx
xor edx, edx
call sub.VCRUNTIME140.dll_memset
bswap r14
xor ebx, 0x38
cmp ebx, 8
mov r13, qword [rsp + 0x68]
jae 0x18016a441
lea rbx, [rsp + 0x80]
mov r8d, 1
mov rcx, rbx
mov rdx, r15
call fcn.180114d10
xorps xmm0, xmm0
movaps xmmword [rsp + 0x40], xmm0
movaps xmmword [rsp + 0x30], xmm0
movaps xmmword [rsp + 0x20], xmm0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x58], r14
lea rdx, [rsp + 0x20]
mov r8d, 1
mov rcx, rbx
jmp 0x18016a459
mov qword [rdi + 0xd0], r14
lea rcx, [rsp + 0x80]
mov r8d, 1
mov rdx, r15
call fcn.180114d10
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 + 0x30], ecx
movaps xmmword [rsp + 0x20], 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 + 0x20]
mov r8d, 1
mov rdx, r15
call fcn.180114d10
movups xmm0, xmmword [rdi + 0x80]
mov eax, dword [rdi + 0x90]
mov rcx, qword [rdi + 0x78]
mov edx, dword [rsp + 0x30]
bswap edx
movdqa xmm1, xmmword [rsp + 0x20]
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 + 0x70]
call fcn.180024550
test al, al
je 0x18016a1cf
movzx eax, byte [0x180247060]
mov ecx, 0x5b
mov edx, 1
call fcn.18001e7b0
test rax, rax
je 0x18016a6d2
mov rdi, rax
movups xmm0, xmmword [0x1802351ab]
movups xmmword [rax + 0x4b], xmm0
movups xmm0, xmmword [0x1802351a0]
movups xmmword [rax + 0x40], xmm0
movups xmm0, xmmword [0x180235190]
movups xmmword [rax + 0x30], xmm0
movups xmm0, xmmword [0x180235180]
movups xmmword [rax + 0x20], xmm0
movups xmm0, xmmword [0x180235170]
movups xmmword [rax + 0x10], xmm0
movups xmm0, xmmword [str.Invalid_authentication_code__this_could_be_due_to_an_invalid_password_or_errors_in_the_dataTried_to_use_an_already_finalized_HMAC._This_is_a_bug_]
movups xmmword [rax], xmm0
movzx eax, byte [0x180247060]
mov ecx, 0x18
mov edx, 8
call fcn.18001e7b0
test rax, rax
je 0x18016a6e3
mov qword [rax], rdi
mov qword [rax + 8], 0x5b
mov qword [rax + 0x10], 0x5b
lea r8, fcn.18001e8e0
mov cl, 0x15
mov rdx, rax
call fcn.1801239b0
jmp 0x180169fb8
lea rax, str.number_of_read_bytes_exceeds_limit
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x28], 1
lea rax, [0x180234e18]
mov qword [rsp + 0x30], rax
xorps xmm0, xmm0
movups xmmword [rsp + 0x38], xmm0
lea rdx, str._rustc_8c74a5d27c644a0f7a22bb2fa8dd3ff8257bc220library_std_srciomod.rs_rustc_8c74a5d27c644a0f7a22bb2fa8dd3ff8257bc220library_std_srcio_readbuf.rsfailed_to_fill_whole_buffer
lea rcx, [rsp + 0x20]
call fcn.18019abc0
ud2
lea r8, str._rustc_8c74a5d27c644a0f7a22bb2fa8dd3ff8257bc220library_std_srciomod.rs_rustc_8c74a5d27c644a0f7a22bb2fa8dd3ff8257bc220library_std_srcio_readbuf.rsfailed_to_fill_whole_buffer
mov rcx, r14
mov rdx, r13
call fcn.18019ac80
ud2
lea r8, str.C:UsersDadoodze.cargo_registry_srcindex.crates.io_6f17d22bba15001fzip_0.6.6_src_aes.rs
mov rcx, r13
mov rdx, r14
call fcn.18019ad00
ud2
lea rax, [0x1802351f8]
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x28], 1
lea rax, [0x180234e18]
mov qword [rsp + 0x30], rax
xorps xmm0, xmm0
movups xmmword [rsp + 0x38], xmm0
lea rdx, str.C:UsersDadoodze.cargo_registry_srcindex.crates.io_6f17d22bba15001fzip_0.6.6_src_aes.rs
lea rcx, [rsp + 0x20]
call fcn.18019abc0
ud2
mov ecx, 1
mov edx, 0x5b
call fcn.18019a870
ud2
mov ecx, 8
mov edx, 0x18
call fcn.18019a870
ud2