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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x88
mov rax, qword [0x1402e0038]
xor rax, rsp
mov qword [rsp + 0x80], rax
mov ebx, 0xffffff9a
test rcx, rcx
je 0x1402274e1
mov ebp, dword [rsp + 0x110]
mov eax, ebp
and eax, 0xfffffff7
jne 0x1402274e1
mov r15, r9
mov rdi, r8
mov r13, rdx
mov rsi, rcx
test rdx, rdx
je 0x140227518
mov rcx, r13
call fcn.14012f6e0
cmp rax, 0xffff
jbe 0x140227518
mov rcx, qword [rsp + 0x80]
xor rcx, rsp
call fcn.14010fba0
mov eax, ebx
add rsp, 0x88
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov qword [rsp + 0x48], r15
or eax, r12d
cmp eax, 0xffff
jbe 0x140227560
jmp 0x1402274e1
mov r14, qword [rsp + 0x108]
mov eax, dword [rsp + 0x100]
mov r12d, dword [rsp + 0xf0]
test r14, r14
je 0x140227507
mov rcx, r14
mov rbp, rax
call fcn.14012f6e0
mov ecx, ebp
or ecx, r12d
cmp ecx, 0xffff
ja 0x1402274e1
mov qword [rsp + 0x48], r15
cmp rax, 0x10000
mov ebp, dword [rsp + 0x110]
jae 0x1402274e1
cmp dword [rsi + 0x70], 1
je 0x140227635
test r13, r13
lea r12, [0x1402a1e2f]
cmovne r12, r13
xor r13d, r13d
mov eax, 0
test r14, r14
je 0x14022758d
mov rcx, r14
call fcn.14012f6e0
mov qword [rsp + 0x50], rax
mov r15d, dword [rsp + 0x158]
mov rcx, r12
call fcn.14012f6e0
mov qword [rsp + 0x40], rax
test rdi, rdi
je 0x1402275fe
mov r13d, dword [rdi + 0x18]
test r13d, r13d
jne 0x1402275fe
mov eax, dword [rdi + 0x14]
lea ecx, [rax + 0x30]
cmp eax, 0x50
cmovb ecx, eax
lea edx, [rax + 0x44]
cmp eax, 0x7bc
cmovae ecx, edx
mov eax, dword [rdi + 0xc]
mov edx, dword [rdi + 0x10]
shl ecx, 0x19
shl edx, 0x15
shl eax, 0x10
add eax, edx
add eax, ecx
add eax, 0x200000
mov ecx, dword [rdi]
mov edx, dword [rdi + 4]
shr ecx, 1
shl edx, 5
add edx, ecx
mov r13d, dword [rdi + 8]
shl r13d, 0xb
add r13d, edx
or r13d, eax
mov dword [rsi + 0x10100], r13d
mov edx, dword [rsp + 0x118]
mov ecx, edx
and ecx, 0xfffffffe
mov eax, r15d
or eax, 2
cmp ecx, 8
cmovne eax, r15d
mov dword [rsi + 0xf4], eax
cmp edx, 2
je 0x14022764c
cmp edx, 1
jne 0x140227659
mov ecx, 6
jmp 0x140227651
mov rcx, rsi
call fcn.140227f95
mov ebx, eax
test eax, eax
jne 0x1402274e1
jmp 0x14022756a
mov ecx, 4
or eax, ecx
mov dword [rsi + 0xf4], eax
mov ecx, dword [rsp + 0x120]
cmp qword [rsp + 0x140], 0
je 0x140227674
or eax, 1
mov dword [rsi + 0xf4], eax
mov r15, qword [rsp + 0xf8]
lea rax, [rsi + 0x78]
mov qword [rsp + 0x58], rax
xor r13d, r13d
mov qword [rsi + 0x10104], r13
mov dword [rsi + 0xf8], ebp
mov qword [rsi + 0xd0], r13
mov dword [rsi + 0xfc], ecx
mov rdx, qword [rsi + 0x58]
mov rcx, rsi
call fcn.140241b33
mov rbp, rax
mov qword [rsi + 0xd8], rax
mov ebx, dword [rsp + 0x100]
mov rax, qword [rsp + 0x50]
add eax, ebx
mov rdx, qword [rsp + 0x40]
lea ecx, [rdx + rax + 0x2e]
mov dword [rsi + 0xec], ecx
mov dword [rsi + 0xf0], 0x20
lea ecx, [rdx + rax]
add ecx, 0x4e
call fcn.14003bfa0
mov qword [rsi + 0xe0], rax
mov dword [rsi + 0xe8], ebx
mov ecx, 0x2014b50
mov byte [rax + r13], cl
shr ecx, 8
inc r13
cmp r13, 4
jne 0x1402276fc
mov ecx, dword [rsp + 0x150]
mov word [rax + 4], cx
cmp ecx, 0x10000
jb 0x140227725
mov word [rax + 4], 0xffff
mov word [rax + 6], 0x14
mov ecx, dword [rsi + 0xf4]
mov word [rax + 8], cx
cmp ecx, 0x10000
mov r11, qword [rsp + 0x50]
jb 0x140227748
mov word [rax + 8], 0xffff
mov ecx, dword [rsi + 0xf8]
mov word [rax + 0xa], cx
cmp ecx, 0x10000
jb 0x140227760
mov word [rax + 0xa], 0xffff
mov ecx, dword [rsi + 0x10100]
xor edx, edx
mov r8, rcx
mov byte [rax + rdx + 0xc], r8b
shr rcx, 8
inc rdx
cmp rdx, 4
jne 0x140227768
cmp r8, 0x100
jb 0x14022778d
mov dword [rax + 0xc], 0xffffffff
mov qword [rax + 0x10], 0
mov dword [rax + 0x18], 0
mov rdx, qword [rsp + 0x40]
mov ecx, edx
mov byte [rax + 0x1c], dl
mov byte [rax + 0x1d], dh
cmp rcx, 0x10000
jb 0x1402277b8
mov word [rax + 0x1c], 0xffff
mov word [rax + 0x1e], bx
cmp ebx, 0x10000
jb 0x1402277ca
mov word [rax + 0x1e], 0xffff
mov word [rax + 0x20], r11w
cmp r11d, 0x10000
jb 0x1402277de
mov word [rax + 0x20], 0xffff
mov word [rax + 0x22], 0
test rdi, rdi
je 0x14022782b
mov edx, dword [rdi + 0x1c]
mov word [rax + 0x24], dx
cmp edx, 0x10000
jb 0x1402277fe
mov word [rax + 0x24], 0xffff
mov edx, dword [rdi + 0x20]
xor r8d, r8d
mov r9, rdx
mov byte [rax + r8 + 0x26], r9b
shr rdx, 8
inc r8
cmp r8, 4
jne 0x140227804
cmp r9, 0x100
jb 0x140227838
mov dword [rax + 0x26], 0xffffffff
jmp 0x140227838
mov word [rax + 0x24], 0
mov dword [rax + 0x26], 0
mov edx, 0xffffffff
cmp rbp, rdx
jae 0x140227875
mov rdx, qword [rsi + 0x10150]
sub rbp, rdx
xor edx, edx
mov r8, rbp
mov byte [rax + rdx + 0x2a], r8b
shr rbp, 8
inc rdx
cmp rdx, 4
jne 0x14022784e
cmp r8, 0x100
jb 0x14022788e
mov dword [rax + 0x2a], 0xffffffff
jmp 0x14022788e
mov edx, 0xffffffff
xor r8d, r8d
mov byte [rax + r8 + 0x2a], dl
shr edx, 8
inc r8
cmp r8, 4
jne 0x14022787d
mov eax, ebx
cmp dword [rsp + 0x40], 0
je 0x1402278b1
xor edx, edx
mov r8b, byte [r12 + rdx]
mov r9, qword [rsi + 0xe0]
mov byte [r9 + rdx + 0x2e], r8b
inc rdx
cmp rcx, rdx
jne 0x140227899
test ebx, ebx
je 0x1402278d6
lea rdx, [rcx + 0x2e]
xor r8d, r8d
mov r9b, byte [r15 + r8]
mov r10, qword [rsi + 0xe0]
add r10, rdx
mov byte [r8 + r10], r9b
inc r8
cmp rax, r8
jne 0x1402278bc
test r11d, r11d
je 0x140227901
mov edx, r11d
add rax, rcx
add rax, 0x2e
xor ecx, ecx
mov r8b, byte [r14 + rcx]
mov r9, qword [rsi + 0xe0]
add r9, rax
mov byte [rcx + r9], r8b
inc rcx
cmp rdx, rcx
jne 0x1402278e7
mov ebx, 0xffffff98
cmp qword [rsi + 0xe0], 0
je 0x1402274e1
mov eax, dword [rsp + 0x160]
mov dword [rsi + 0x1010c], eax
xorps xmm0, xmm0
movups xmmword [rsi + 0x10110], xmm0
xor edi, edi
mov qword [rsi + 0x10120], rdi
mov rcx, rsi
mov rdx, r12
mov r8d, dword [rsp + 0xf0]
mov r9, qword [rsp + 0x48]
call fcn.14022716d
mov qword [rsi + 0x80], rdi
mov qword [rsi + 0x90], 0x10000
lea rcx, [rsi + 0x100]
mov qword [rsi + 0x88], rcx
mov dword [rsi + 0xc0], 0
mov ebx, 0xffffffff
test eax, eax
je 0x14022798e
mov dword [rsi + 0x10140], 0
jmp 0x1402274e1
cmp dword [rsi + 0xf8], 8
jne 0x1402279a0
cmp dword [rsi + 0xfc], 0
je 0x1402279c7
mov dword [rsi + 0x10140], 0
cmp qword [rsp + 0x140], 0
jne 0x140227a47
mov dword [rsi + 0x70], 1
xor ebx, ebx
jmp 0x1402274e1
mov eax, dword [rsp + 0x128]
mov r9d, eax
neg r9d
cmovns r9d, eax
xorps xmm0, xmm0
movups xmmword [rsi + 0xa8], xmm0
mov qword [rsi + 0xb8], 0
lea rax, str.1.3.0.1_motley
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x138]
mov dword [rsp + 0x28], eax
mov eax, dword [rsp + 0x130]
mov dword [rsp + 0x20], eax
mov dword [rsp + 0x38], 0x58
mov rcx, qword [rsp + 0x58]
mov edx, dword [rsp + 0x118]
mov r8d, 8
call fcn.1400dfa30
mov ebx, eax
test eax, eax
jne 0x14022797f
mov dword [rsi + 0xd0], 8
jmp 0x1402279a0
movabs r14, 0xaaaaaaaaaaaaaaaa
mov qword [rsp + 0x60], r14
mov dword [rsp + 0x68], 0xaaaaaaaa
mov dword [rsi + 0x10108], 1
call fcn.1401d7910
mov rdi, rax
mov qword [rsi + 0x10138], rax
lea rbx, [rsi + 0x10128]
mov qword [rsp + 0x70], r14
mov word [rsp + 0x78], 0xaaaa
mov eax, dword [0x140302390]
lea ecx, [rax + 1]
mov dword [0x140302390], ecx
test eax, eax
jne 0x140227ab0
xor ecx, ecx
call fcn.14010de88
xor eax, 0xbb40e64e
mov ecx, eax
call fcn.14012ec54
mov rcx, qword [rsp + 0x140]
mov rdx, rbx
mov r8, rdi
call fcn.1402289a1
xor r14d, r14d
mov ebp, 0xff
call fcn.14012ec6c
shr eax, 7
mov r8d, dword [rsi + 0x10128]
mov edx, dword [rsi + 0x10130]
mov ecx, edx
and ecx, 0xfffd
mov r9d, edx
or r9d, 2
xor ecx, 3
imul ecx, r9d
mov r9d, r8d
xor r9d, eax
and r9d, ebp
shr r8d, 8
xor r8d, dword [rdi + r9*4]
mov dword [rsi + 0x10128], r8d
and r8d, ebp
add r8d, dword [rsi + 0x1012c]
shr ecx, 8
imul r8d, r8d, 0x8088405
inc r8d
mov dword [rsi + 0x1012c], r8d
shr r8d, 0x18
mov r9d, edx
and r9d, ebp
xor r9d, r8d
shr edx, 8
xor edx, dword [rdi + r9*4]
mov dword [rsi + 0x10130], edx
xor ecx, eax
mov byte [rsp + r14 + 0x70], cl
inc r14
cmp r14, 0xa
jne 0x140227acb
mov rcx, qword [rsp + 0x140]
mov rdx, rbx
mov r8, rdi
call fcn.1402289a1
mov eax, dword [rsi + 0x10130]
mov ecx, dword [rsi + 0x10128]
mov edx, dword [rsi + 0x1012c]
xor r8d, r8d
mov r9d, 0xff
mov r10d, eax
and r10d, 0xfffd
mov r11d, eax
or r11d, 2
xor r10d, 3
imul r10d, r11d
shr r10d, 8
mov r11b, byte [rsp + r8 + 0x70]
mov ebx, ecx
xor bl, r11b
movzx ebx, bl
shr ecx, 8
xor ecx, dword [rdi + rbx*4]
mov dword [rsi + 0x10128], ecx
mov ebx, ecx
and ebx, r9d
add ebx, edx
imul edx, ebx, 0x8088405
inc edx
mov dword [rsi + 0x1012c], edx
mov ebx, edx
shr ebx, 0x18
mov r14d, eax
and r14d, r9d
xor r14d, ebx
shr eax, 8
xor eax, dword [rdi + r14*4]
mov dword [rsi + 0x10130], eax
xor r10b, r11b
mov byte [rsp + r8 + 0x60], r10b
inc r8
cmp r8, 0xa
jne 0x140227b88
mov r9d, 0xfffd
mov r8d, eax
and r8d, r9d
mov r10d, eax
or r10d, 2
xor r8d, 3
imul r8d, r10d
shr r8d, 8
mov r15d, dword [rsp + 0x148]
mov ebx, r15d
shr ebx, 0x10
mov r11d, ecx
xor r11d, ebx
mov r10d, 0xff
and r11d, r10d
shr ecx, 8
xor ecx, dword [rdi + r11*4]
mov dword [rsi + 0x10128], ecx
mov r11d, ecx
and r11d, r10d
add edx, r11d
imul edx, edx, 0x8088405
lea ebp, [rdx + 1]
mov dword [rsi + 0x1012c], ebp
shr ebp, 0x18
mov r14d, eax
and r14d, r10d
xor r14d, ebp
shr eax, 8
xor eax, dword [rdi + r14*4]
mov dword [rsi + 0x10130], eax
xor ebx, r8d
lea r8, [rsp + 0x60]
mov byte [r8 + 0xa], bl
and r9d, eax
mov ebx, eax
or ebx, 2
xor r9d, 3
imul r9d, ebx
shr r15d, 0x18
xor r11d, r15d
shr ecx, 8
xor ecx, dword [rdi + r11*4]
mov dword [rsi + 0x10128], ecx
and ecx, r10d
add ecx, edx
inc ecx
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rsi + 0x1012c], ecx
shr ecx, 0x18
and r10d, eax
xor r10d, ecx
shr eax, 8
xor eax, dword [rdi + r10*4]
shr r9d, 8
mov dword [rsi + 0x10130], eax
xor r15d, r9d
mov byte [r8 + 0xb], r15b
mov dword [rsi + 0x10140], 0xc
mov rdx, qword [rsi + 0x58]
mov rax, qword [rsi + 0x10]
mov rcx, qword [rsi + 0x38]
mov r9d, 0xc
call qword [0x140318008]
mov ebx, 0xffffffff
cmp eax, 0xc
jne 0x1402274e1
jmp 0x1402279b9