Function at 0x6a1660
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg

Disassembly:
push rbp
push r14
sub rsp, 0x38
xor ebp, ebp
mov r14, rcx
test rcx, rcx
jne 0x6a167d
lea eax, [rcx - 0x66]
add rsp, 0x38
pop r14
pop rbp
ret
mov qword [rsp + 0x60], rdi
mov rdi, qword [rcx + 0xc0]
test rdi, rdi
jne 0x6a169e
lea eax, [rdi - 0x66]
mov rdi, qword [rsp + 0x60]
add rsp, 0x38
pop r14
pop rbp
ret
cmp qword [rdi], rbp
jne 0x6a16b5
mov eax, 0xffffff9c
mov rdi, qword [rsp + 0x60]
add rsp, 0x38
pop r14
pop rbp
ret
test r8d, r8d
jne 0x6a16c9
xor eax, eax
mov rdi, qword [rsp + 0x60]
add rsp, 0x38
pop r14
pop rbp
ret
mov eax, dword [rdi + 0x80]
mov qword [rdi + 0x18], rdx
mov dword [rdi + 0x20], r8d
cmp r8d, eax
jbe 0x6a16e7
cmp dword [rdi + 0xd8], ebp
jne 0x6a16e7
mov dword [rdi + 0x20], eax
mov edx, dword [rdi + 0x7c]
add edx, dword [rdi + 0x10]
cmp r8d, edx
jbe 0x6a16fd
cmp dword [rdi + 0xd8], ebp
je 0x6a16fd
mov dword [rdi + 0x20], edx
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x30], r12
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], r15
cmp dword [rdi + 0x20], ebp
jbe 0x6a1941
mov r15d, 0xfffffffd
cmp dword [rdi + 0x10], 0
jne 0x6a1866
mov eax, dword [rdi + 0x7c]
test eax, eax
je 0x6a1866
mov r8d, dword [rdi + 0xd4]
mov rdx, qword [rdi + 0xc8]
mov rcx, qword [rdi + 0xc0]
mov ebx, 0x4000
cmp eax, ebx
cmovb ebx, eax
add r8d, dword [rdi + 0x60]
xor r9d, r9d
call qword [rdi + 0xa8]
test eax, eax
jne 0x6a1969
mov r8, qword [rdi]
mov rdx, qword [rdi + 0xc8]
mov rcx, qword [rdi + 0xc0]
mov r9d, ebx
call qword [rdi + 0x90]
cmp eax, ebx
jne 0x6a1969
cmp dword [r14 + 0xc8], 0
je 0x6a1856
test ebx, ebx
je 0x6a1856
xor r10d, r10d
mov r11d, ebx
nop dword [rax]
mov edx, dword [r14 + 0xd4]
mov rcx, qword [rdi]
inc r10
and edx, 0xfffd
or edx, 2
mov eax, edx
xor eax, 1
imul eax, edx
shr eax, 8
xor byte [rcx + r10 - 1], al
mov rax, qword [rdi]
mov r8, qword [r14 + 0xd8]
movsx r9d, byte [rax + r10 - 1]
mov edx, dword [r14 + 0xcc]
mov rcx, rdx
shr edx, 8
mov eax, r9d
xor rcx, rax
movzx eax, cl
mov ecx, dword [r8 + rax*4]
xor ecx, edx
mov edx, dword [r14 + 0xd4]
mov dword [r14 + 0xcc], ecx
movzx eax, cl
add eax, dword [r14 + 0xd0]
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
mov dword [r14 + 0xd0], eax
shr ecx, 0x18
xor rcx, rdx
shr edx, 8
movzx eax, cl
mov eax, dword [r8 + rax*4]
xor eax, edx
sub r11, 1
mov dword [r14 + 0xd4], eax
mov rax, qword [rdi]
mov byte [r10 + rax - 1], r9b
jne 0x6a17b0
mov rax, qword [rdi]
add dword [rdi + 0x60], ebx
sub dword [rdi + 0x7c], ebx
mov qword [rdi + 8], rax
mov dword [rdi + 0x10], ebx
cmp dword [rdi + 0xd0], 0
je 0x6a18cd
cmp dword [rdi + 0xd8], 0
jne 0x6a18cd
mov r12d, dword [rdi + 0x24]
mov r13, qword [rdi + 0x18]
lea rcx, [rdi + 8]
mov edx, 2
call fcn.006dc680
mov esi, eax
test eax, eax
js 0x6a189d
cmp qword [rdi + 0x28], 0
cmovne esi, r15d
mov ebx, dword [rdi + 0x24]
mov ecx, dword [rdi + 0x74]
mov rdx, r13
sub ebx, r12d
mov r8d, ebx
call fcn.006e15c0
sub dword [rdi + 0x80], ebx
add ebp, ebx
mov dword [rdi + 0x74], eax
cmp esi, 1
je 0x6a1941
test esi, esi
je 0x6a1937
mov eax, esi
jmp 0x6a1943
mov ebx, dword [rdi + 0x10]
test ebx, ebx
jne 0x6a18d9
cmp dword [rdi + 0x7c], ebx
je 0x6a1941
mov eax, dword [rdi + 0x20]
cmp eax, ebx
cmovb ebx, eax
test ebx, ebx
je 0x6a190a
xor edx, edx
mov r8d, ebx
nop word [rax + rax]
mov rax, qword [rdi + 8]
mov rcx, qword [rdi + 0x18]
inc rdx
sub r8, 1
movzx eax, byte [rdx + rax - 1]
mov byte [rdx + rcx - 1], al
jne 0x6a18f0
mov rdx, qword [rdi + 0x18]
mov ecx, dword [rdi + 0x74]
mov r8d, ebx
call fcn.006e15c0
sub dword [rdi + 0x80], ebx
sub dword [rdi + 0x10], ebx
sub dword [rdi + 0x20], ebx
add dword [rdi + 0x24], ebx
mov dword [rdi + 0x74], eax
mov eax, ebx
add qword [rdi + 0x18], rax
add qword [rdi + 8], rax
add ebp, ebx
cmp dword [rdi + 0x20], 0
ja 0x6a1725
mov eax, ebp
mov r13, qword [rsp + 0x28]
mov r12, qword [rsp + 0x30]
mov rbx, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x58]
mov r15, qword [rsp + 0x20]
mov rdi, qword [rsp + 0x60]
add rsp, 0x38
pop r14
pop rbp
ret
or eax, 0xffffffff
jmp 0x6a1943