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

Disassembly:
sub esp, 0x98
mov eax, dword [0x572844]
xor eax, esp
mov dword [esp + 0x94], eax
push ebx
mov ebx, dword [esp + 0xa0]
push ebp
push esi
mov esi, ecx
push edi
inc dword [esi + 0x1ec]
cmp dword [esi + 0x1ec], 1
jne 0x511699
push 0
call fcn.0052b567
mov edi, eax
call sub.KERNEL32.dll_GetCurrentProcessId
xor eax, edi
push eax
call fcn.0052b555
add esp, 8
push 0x80
lea eax, [esp + 0x28]
mov ecx, ebx
push eax
call fcn.004ad480
lea eax, [esp + 0x24]
mov ecx, esi
push eax
call fcn.00511c60
xor ebp, ebp
call fcn.0052b534
mov edx, dword [esi + 0x1e0]
mov ecx, edx
sar eax, 7
xor ecx, eax
mov edi, dword [esi + 0x1e8]
mov dword [esp + 0x10], eax
mov ebx, edi
movzx eax, cl
and ebx, 0xfffd
shr edx, 8
or ebx, 2
xor edx, dword [eax*4 + 0x617f28]
movzx eax, dl
add eax, dword [esi + 0x1e4]
imul eax, eax, 0x8088405
mov dword [esi + 0x1e0], edx
inc eax
mov dword [esi + 0x1e4], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x617f28]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1e8], edi
imul eax, ebx
shr eax, 8
xor al, byte [esp + 0x10]
mov byte [esp + ebp + 0x18], al
inc ebp
cmp ebp, 0xa
jl 0x5116b8
lea eax, [esp + 0x24]
mov ecx, esi
push eax
call fcn.00511c60
mov cl, byte [esp + 0x18]
mov ebx, dword [esi + 0x1e0]
mov ebp, dword [esi + 0x1e8]
mov edx, ebp
movzx eax, cl
and edx, 0xfffd
xor eax, ebx
or edx, 2
movzx eax, al
shr ebx, 8
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, dword [esi + 0x1e4]
imul edi, eax, 0x8088405
mov dword [esi + 0x1e0], ebx
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x18], cl
mov cl, byte [esp + 0x19]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x19], cl
mov cl, byte [esp + 0x1a]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
movzx eax, al
shr ebp, 8
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x1a], cl
mov cl, byte [esp + 0x1b]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x1b], cl
mov cl, byte [esp + 0x1c]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x1c], cl
mov cl, byte [esp + 0x1d]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov dword [esi + 0x1e4], edi
mov eax, edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x1d], cl
mov cl, byte [esp + 0x1e]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x1e], cl
mov cl, byte [esp + 0x1f]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x1f], cl
mov cl, byte [esp + 0x20]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul edi, eax, 0x8088405
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
push 0x80
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
or edx, 2
shr eax, 8
xor cl, al
mov byte [esp + 0x24], cl
mov cl, byte [esp + 0x25]
movzx eax, cl
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 0x1e4], eax
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
shr eax, 8
xor cl, al
lea eax, [esp + 0x28]
push eax
mov byte [esp + 0x29], cl
call fcn.004ad810
mov ecx, dword [esp + 0xb0]
mov ebx, dword [esi + 0x1e0]
mov ebp, dword [esi + 0x1e8]
mov edx, ebp
shr ecx, 0x10
and edx, 0xfffd
mov eax, ecx
or edx, 2
xor eax, ebx
shr ebx, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, dword [esi + 0x1e4]
imul edi, eax, 0x8088405
mov dword [esi + 0x1e0], ebx
inc edi
mov eax, edi
mov dword [esi + 0x1e4], edi
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
mov edx, ebp
and edx, 0xfffd
shr eax, 8
xor al, cl
mov ecx, dword [esp + 0xb0]
mov byte [esp + 0x22], al
or edx, 2
shr ecx, 0x18
mov eax, ecx
xor eax, ebx
shr ebx, 8
movzx eax, al
push 0
push 0xc
push 1
xor ebx, dword [eax*4 + 0x617f28]
movzx eax, bl
add eax, edi
mov dword [esi + 0x1e0], ebx
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 0x1e4], eax
shr eax, 0x18
xor eax, ebp
shr ebp, 8
movzx eax, al
xor ebp, dword [eax*4 + 0x617f28]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1e8], ebp
imul eax, edx
shr eax, 8
xor al, cl
mov ecx, esi
mov byte [esp + 0x2f], al
lea eax, [esp + 0x24]
push eax
call fcn.00510540
mov ecx, dword [esp + 0xa4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0051dca8
add esp, 0x98
ret 8