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

Disassembly:
push rbx
push r12
push r14
sub rsp, 0x30
xor r12d, r12d
mov r14, rcx
test rcx, rcx
je 0x14003206f
mov rbx, qword [rcx + 0x110]
test rbx, rbx
je 0x14003206f
cmp qword [rbx], r12
jne 0x140031d2d
lea eax, [r12 - 0x64]
add rsp, 0x30
pop r14
pop r12
pop rbx
ret
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x60], rdi
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], r15
test r8d, r8d
je 0x140032068
mov rax, qword [rbx + 0xa0]
mov r9d, r8d
mov qword [rbx + 0x18], rdx
mov dword [rbx + 0x20], r8d
cmp r9, rax
jbe 0x140031d75
cmp dword [rbx + 0x118], r12d
jne 0x140031d75
mov dword [rbx + 0x20], eax
mov r8d, eax
mov ecx, dword [rbx + 0x10]
mov rdx, qword [rbx + 0x98]
lea rax, [rdx + rcx]
cmp r9, rax
jbe 0x140031d99
cmp dword [rbx + 0x118], r12d
je 0x140031d99
lea r8d, [rcx + rdx]
mov dword [rbx + 0x20], r8d
test r8d, r8d
je 0x140032056
mov edi, 0xfffffffd
nop word [rax + rax]
mov esi, dword [rbx + 0x10]
test esi, esi
jne 0x140031f07
mov rax, qword [rbx + 0x98]
test rax, rax
je 0x140031f07
mov esi, 0x4000
cmp rax, rsi
jae 0x140031ddf
mov esi, eax
test eax, eax
je 0x140032068
mov r8, qword [rbx + 0x110]
lea rcx, [rbx + 0xa8]
add r8, qword [rbx + 0x60]
xor r9d, r9d
mov rdx, qword [rbx + 0x100]
call fcn.1400320a0
test eax, eax
jne 0x14003205e
mov r8, qword [rbx]
mov r9d, esi
mov rdx, qword [rbx + 0x100]
mov rcx, qword [rbx + 0xe0]
call qword [rbx + 0xb0]
cmp eax, esi
jne 0x14003205e
cmp dword [r14 + 0x118], 0
je 0x140031ef0
test esi, esi
je 0x140031ef0
xor r10d, r10d
mov r11d, esi
nop word [rax + rax]
mov ecx, dword [r14 + 0x128]
lea r10, [r10 + 1]
mov rax, qword [rbx]
and ecx, 0xfffd
or ecx, 2
mov r9d, ecx
xor r9d, 1
imul r9d, ecx
shr r9d, 8
xor r9b, byte [rax + r10 - 1]
mov byte [rax + r10 - 1], r9b
mov r8, qword [r14 + 0x130]
mov edx, dword [r14 + 0x120]
movsx rax, r9b
xor rax, rdx
shr edx, 8
movzx ecx, al
xor edx, dword [r8 + rcx*4]
movzx eax, dl
add eax, dword [r14 + 0x124]
imul ecx, eax, 0x8088405
mov dword [r14 + 0x120], edx
mov edx, dword [r14 + 0x128]
inc ecx
mov dword [r14 + 0x124], ecx
shr rcx, 0x18
xor rcx, rdx
shr edx, 8
movzx eax, cl
xor edx, dword [r8 + rax*4]
mov dword [r14 + 0x128], edx
mov rax, qword [rbx]
mov byte [r10 + rax - 1], r9b
sub r11, 1
jne 0x140031e50
mov eax, esi
add qword [rbx + 0x60], rax
sub qword [rbx + 0x98], rax
mov rax, qword [rbx]
mov qword [rbx + 8], rax
mov dword [rbx + 0x10], esi
mov eax, dword [rbx + 0x108]
test eax, eax
je 0x140031fcd
cmp dword [rbx + 0x118], 0
jne 0x140031fcd
cmp eax, 0xc
je 0x14003204c
mov r15d, dword [rbx + 0x24]
lea rcx, [rbx + 8]
mov r13, qword [rbx + 0x18]
mov edx, 2
call fcn.1400322a0
mov ebp, eax
test eax, eax
js 0x140031f4f
cmp qword [rbx + 0x28], 0
cmovne ebp, edi
mov ecx, dword [rbx + 0x24]
movabs rsi, 0x100000000
add rsi, rcx
mov rdx, r13
cmp rcx, r15
cmovae rsi, rcx
mov ecx, dword [rbx + 0x90]
mov rdi, rsi
sub rdi, r15
add qword [rbx + 0x88], rdi
mov r8d, edi
call fcn.140033f60
sub qword [rbx + 0xa0], rdi
sub esi, r15d
add r12d, esi
mov dword [rbx + 0x90], eax
cmp ebp, 1
je 0x140032056
test ebp, ebp
je 0x140032047
mov eax, ebp
mov r13, qword [rsp + 0x28]
mov rdi, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x50]
mov r15, qword [rsp + 0x20]
add rsp, 0x30
pop r14
pop r12
pop rbx
ret
test esi, esi
jne 0x140031fdb
cmp qword [rbx + 0x98], 0
je 0x140032056
cmp dword [rbx + 0x20], esi
cmovb esi, dword [rbx + 0x20]
test esi, esi
je 0x14003200b
xor edx, edx
mov r8d, esi
nop dword [rax + rax]
mov rax, qword [rbx + 8]
lea rdx, [rdx + 1]
mov rcx, qword [rbx + 0x18]
movzx eax, byte [rdx + rax - 1]
mov byte [rdx + rcx - 1], al
sub r8, 1
jne 0x140031ff0
mov rdx, qword [rbx + 0x18]
mov r8d, esi
mov ecx, dword [rbx + 0x90]
mov edi, esi
add qword [rbx + 0x88], rdi
call fcn.140033f60
sub qword [rbx + 0xa0], rdi
sub dword [rbx + 0x10], esi
sub dword [rbx + 0x20], esi
add qword [rbx + 0x18], rdi
add qword [rbx + 8], rdi
add dword [rbx + 0x24], esi
add r12d, esi
mov dword [rbx + 0x90], eax
mov edi, 0xfffffffd
cmp dword [rbx + 0x20], 0
ja 0x140031db0
mov eax, r12d
jmp 0x140031faa
mov eax, 0xffffffff
jmp 0x140031faa
xor eax, eax
jmp 0x140031faa
mov eax, 0xffffff9a
add rsp, 0x30
pop r14
pop r12
pop rbx
ret