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

Disassembly:
push r12
push r13
push r14
sub rsp, 0x30
xor r12d, r12d
xor r14d, r14d
mov r13, r9
test r9, r9
je 0x18004e95b
mov byte [r9], r12b
test rcx, rcx
jne 0x18004e96e
lea eax, [rcx - 0x66]
add rsp, 0x30
pop r14
pop r13
pop r12
ret
mov qword [rsp + 0x60], rsi
mov rsi, qword [rcx + 0x80]
test rsi, rsi
jne 0x18004e992
lea eax, [rsi - 0x66]
mov rsi, qword [rsp + 0x60]
add rsp, 0x30
pop r14
pop r13
pop r12
ret
cmp qword [rsi], r12
jne 0x18004e9ac
mov eax, 0xffffff9c
mov rsi, qword [rsp + 0x60]
add rsp, 0x30
pop r14
pop r13
pop r12
ret
test r8d, r8d
jne 0x18004e9c3
xor eax, eax
mov rsi, qword [rsp + 0x60]
add rsp, 0x30
pop r14
pop r13
pop r12
ret
mov eax, dword [rsi + 0x80]
mov qword [rsi + 0x18], rdx
mov dword [rsi + 0x20], r8d
cmp r8d, eax
jbe 0x18004e9d9
mov dword [rsi + 0x20], eax
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x58], rbp
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], r15
cmp dword [rsi + 0x20], r12d
jbe 0x18004eca9
lea r15, [0x18006cc00]
nop
cmp dword [rsi + 0x10], 0
jne 0x18004eb3e
mov eax, dword [rsi + 0x7c]
test eax, eax
je 0x18004eb3e
mov ebx, 0x4000
cmp eax, ebx
jae 0x18004ea28
mov ebx, eax
test eax, eax
je 0x18004ec85
mov edx, dword [rsi + 0x94]
mov rcx, qword [rsi + 0x88]
add edx, dword [rsi + 0x60]
cmp byte [rcx], 0
je 0x18004ea5c
cmp byte [rcx + 1], 0
je 0x18004ec93
add edx, dword [rcx + 0x14]
mov rcx, qword [rcx + 8]
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x18004ea5f
mov dword [rcx + 0x2c], edx
mov r9, qword [rsi + 0x88]
mov rcx, qword [rsi]
mov r8d, 1
mov edx, ebx
mov edi, ebx
call fcn.18004d690
cmp rax, 1
jne 0x18004ec93
mov r10, qword [rsi]
add dword [rsi + 0x60], ebx
sub dword [rsi + 0x7c], ebx
cmp byte [rsi + 0x98], 0
mov qword [rsi + 8], r10
mov dword [rsi + 0x10], ebx
je 0x18004eb3e
test ebx, ebx
je 0x18004eb3e
nop word [rax + rax]
mov r9d, dword [rsi + 0xa4]
mov edx, dword [rsi + 0x9c]
inc r10
mov eax, r9d
mov rcx, rdx
shr edx, 8
and eax, 0xfffd
or eax, 2
mov r8d, eax
xor r8d, 1
imul r8d, eax
shr r8d, 8
xor r8b, byte [r10 - 1]
movsx rax, r8b
xor rcx, rax
movzx eax, cl
mov ecx, dword [r15 + rax*4]
xor ecx, edx
movzx eax, cl
mov dword [rsi + 0x9c], ecx
movzx ecx, r9b
add eax, dword [rsi + 0xa0]
shr r9d, 8
imul eax, eax, 0x8088405
inc eax
mov dword [rsi + 0xa0], eax
movzx eax, byte [rsi + 0xa3]
xor rcx, rax
mov eax, dword [r15 + rcx*4]
xor eax, r9d
sub rdi, 1
mov dword [rsi + 0xa4], eax
mov byte [r10 - 1], r8b
jne 0x18004eab0
mov r8d, dword [rsi + 0xa8]
mov r9d, dword [rsi + 0x10]
cmp r8d, r9d
cmova r8d, r9d
test r8d, r8d
je 0x18004eb90
mov rdx, qword [rsi + 8]
lea eax, [r8 - 1]
sub r9d, r8d
movzx r10d, byte [rax + rdx]
sub dword [rsi + 0x80], r8d
mov eax, r8d
add rax, rdx
sub dword [rsi + 0xa8], r8d
mov dword [rsi + 0x10], r9d
mov qword [rsi + 8], rax
jne 0x18004eb90
cmp r10b, byte [rsi + 0xac]
jne 0x18004ec98
cmp dword [rsi + 0x90], 0
jne 0x18004ec14
mov eax, dword [rsi + 0x20]
mov edi, dword [rsi + 0x10]
cmp eax, edi
cmovb edi, eax
test edi, edi
je 0x18004ebca
xor edx, edx
mov r8d, edi
nop dword [rax]
mov rax, qword [rsi + 8]
mov rcx, qword [rsi + 0x18]
inc rdx
sub r8, 1
movzx eax, byte [rdx + rax - 1]
mov byte [rdx + rcx - 1], al
jne 0x18004ebb0
mov rbx, qword [rsi + 0x18]
mov ecx, dword [rsi + 0x74]
mov r8d, edi
mov rdx, rbx
call fcn.18004cd20
sub dword [rsi + 0x80], edi
sub dword [rsi + 0x10], edi
sub dword [rsi + 0x20], edi
add dword [rsi + 0x24], edi
mov dword [rsi + 0x74], eax
lea rax, [rdi + rbx]
mov ecx, edi
add r14d, edi
add qword [rsi + 8], rcx
cmp dword [rsi + 0x80], 0
mov qword [rsi + 0x18], rax
jne 0x18004ec71
test r13, r13
je 0x18004ec71
mov byte [r13], 1
jmp 0x18004ec71
mov ebx, dword [rsi + 0x24]
mov rdi, qword [rsi + 0x18]
lea rcx, [rsi + 8]
mov edx, 2
call fcn.18004d210
mov ebp, dword [rsi + 0x24]
mov ecx, dword [rsi + 0x74]
sub ebp, ebx
mov rdx, rdi
mov r12d, eax
mov r8d, ebp
call fcn.18004cd20
sub dword [rsi + 0x80], ebp
mov dword [rsi + 0x74], eax
jne 0x18004ec5a
cmp r12d, 1
je 0x18004ec5a
mov dword [rsi + 0x80], 0xc
add r14d, ebp
cmp r12d, 1
je 0x18004ec9f
cmp dword [rsi + 0x80], 0
je 0x18004ec9f
test r12d, r12d
jne 0x18004ec80
cmp dword [rsi + 0x20], 0
ja 0x18004ea00
test r12d, r12d
je 0x18004eca9
mov eax, r12d
jmp 0x18004ecac
test r13, r13
je 0x18004ec8f
mov byte [r13], 1
xor eax, eax
jmp 0x18004ecac
or eax, 0xffffffff
jmp 0x18004ecac
mov eax, 0xffffff96
jmp 0x18004ecac
test r13, r13
je 0x18004eca9
mov byte [r13], 1
mov eax, r14d
mov rdi, qword [rsp + 0x28]
mov rbx, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x58]
mov r15, qword [rsp + 0x20]
mov rsi, qword [rsp + 0x60]
add rsp, 0x30
pop r14
pop r13
pop r12
ret