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

Disassembly:
sub rsp, 0x78
mov rax, qword [0x0072f1d0]
mov qword [rsp + 0x30], rax
cmp r8d, 0xc
mov qword [rsp + 0x70], rbx
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x50], r12
mov rbx, r9
mov rsi, rcx
mov r12, rdx
jge 0x513a35
xor eax, eax
jmp 0x513ed4
mov eax, dword [0x007730f0]
inc eax
cmp eax, 1
mov dword [0x007730f0], eax
jne 0x513a5d
xor ecx, ecx
call qword [sym.imp.msvcrt.dll_time]
xor eax, 0xbb40e64e
mov ecx, eax
call qword [sym.imp.msvcrt.dll_srand]
mov dword [rbx], 0x12345678
mov dword [rbx + 4], 0x23456789
mov dword [rbx + 8], 0x34567890
movzx eax, byte [rsi]
mov qword [rsp + 0x58], rdi
mov rdi, qword [rsp + 0xa0]
test al, al
mov r8, rsi
je 0x513ad5
nop
nop
mov edx, dword [rbx]
inc r8
movzx ecx, dl
shr edx, 8
xor cl, al
movzx eax, cl
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov edx, dword [rbx + 8]
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, dl
shr edx, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, edx
mov dword [rbx + 8], eax
mov al, byte [r8]
test al, al
jne 0x513a90
mov qword [rsp + 0x68], rbp
mov qword [rsp + 0x48], r13
xor r13d, r13d
mov rbp, r13
call qword [sym.imp.msvcrt.dll_rand]
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
sar eax, 7
movzx ecx, dl
shr edx, 8
movzx r10d, al
mov r9d, r8d
inc rbp
xor cl, r10b
and r9d, 0xfffd
movzx eax, cl
or r9d, 2
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, r8b
shr r8d, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r9d
xor eax, 1
imul eax, r9d
shr eax, 8
xor al, r10b
cmp rbp, 0xa
mov byte [rsp + rbp + 0x1f], al
jl 0x513ae5
mov rbp, qword [rsp + 0x68]
mov dword [rbx], 0x12345678
mov dword [rbx + 4], 0x23456789
mov dword [rbx + 8], 0x34567890
movzx ecx, byte [rsi]
test cl, cl
je 0x513bc1
nop
mov edx, dword [rbx]
inc rsi
xor cl, dl
shr edx, 8
movzx eax, cl
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov edx, dword [rbx + 8]
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, dl
shr edx, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, edx
mov dword [rbx + 8], eax
mov cl, byte [rsi]
test cl, cl
jne 0x513b80
lea rax, [rsp + 0x20]
mov rsi, r12
sub rsi, rax
nop
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
movzx r9d, byte [rsp + r13 + 0x20]
lea r11, [rsp + r13 + 0x20]
movzx ecx, r9b
mov r10d, r8d
xor cl, dl
and r10d, 0xfffd
shr edx, 8
movzx eax, cl
or r10d, 2
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, r8b
shr r8d, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r10d
xor eax, 1
imul eax, r10d
shr eax, 8
xor al, r9b
movzx r9d, byte [r11 + 1]
mov byte [r11 + rsi], al
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
movzx ecx, dl
shr edx, 8
mov r10d, r8d
xor cl, r9b
and r10d, 0xfffd
movzx eax, cl
or r10d, 2
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, r8b
shr r8d, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r10d
xor eax, 1
imul eax, r10d
shr eax, 8
xor al, r9b
movzx r9d, byte [r11 + 2]
mov byte [r12 + r13 + 1], al
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
movzx ecx, dl
shr edx, 8
mov r10d, r8d
xor cl, r9b
and r10d, 0xfffd
movzx eax, cl
or r10d, 2
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
add r13, 5
xor cl, r8b
shr r8d, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r10d
xor eax, 1
imul eax, r10d
shr eax, 8
xor al, r9b
movzx r9d, byte [r11 + 3]
mov byte [r12 + r13 - 3], al
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
movzx ecx, dl
shr edx, 8
mov r10d, r8d
xor cl, r9b
and r10d, 0xfffd
movzx eax, cl
or r10d, 2
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, r8b
shr r8d, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r10d
xor eax, 1
imul eax, r10d
shr eax, 8
xor al, r9b
movzx r9d, byte [r11 + 4]
mov byte [r12 + r13 - 2], al
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
movzx ecx, dl
shr edx, 8
mov r10d, r8d
xor cl, r9b
and r10d, 0xfffd
movzx eax, cl
or r10d, 2
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, r8b
shr r8d, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r10d
xor eax, 1
imul eax, r10d
shr eax, 8
xor al, r9b
cmp r13, 0xa
mov byte [r12 + r13 - 1], al
jl 0x513bd0
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
mov r11d, dword [rsp + 0xa8]
mov r13, qword [rsp + 0x48]
mov eax, r11d
mov r10d, r8d
shr eax, 0x10
and r10d, 0xfffd
shr r11d, 0x18
movzx ecx, al
mov r9d, eax
or r10d, 2
xor cl, dl
shr edx, 8
movzx eax, cl
mov ecx, dword [rdi + rax*4]
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, r8b
shr r8d, 8
movzx eax, cl
movzx ecx, r11b
mov eax, dword [rdi + rax*4]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r10d
xor eax, 1
imul eax, r10d
shr eax, 8
xor al, r9b
mov byte [r12 + 0xa], al
mov edx, dword [rbx]
mov r8d, dword [rbx + 8]
xor cl, dl
shr edx, 8
mov r10d, r8d
movzx eax, cl
and r10d, 0xfffd
mov ecx, dword [rdi + rax*4]
or r10d, 2
xor ecx, edx
mov dword [rbx], ecx
movzx ecx, cl
add ecx, dword [rbx + 4]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [rbx + 4], ecx
shr ecx, 0x18
xor cl, r8b
shr r8d, 8
movzx eax, cl
mov eax, dword [rdi + rax*4]
mov rdi, qword [rsp + 0x58]
xor eax, r8d
mov dword [rbx + 8], eax
mov eax, r10d
xor eax, 1
imul eax, r10d
shr eax, 8
xor al, r11b
mov byte [r12 + 0xb], al
mov eax, reloc.WS2_32.dll_inet_ntoa
mov r12, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x60]
mov rbx, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x30]
call fcn.00693b90
add rsp, 0x78
ret