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

Disassembly:
sub esp, 0x98
mov eax, dword [0x5513d4]
xor eax, esp
mov dword [esp + 0x94], eax
push ebx
mov ebx, dword [esp + 0xa0]
push esi
mov esi, ecx
push edi
inc dword [esi + 0x1f4]
cmp dword [esi + 0x1f4], 1
jne 0x4f8628
push 0
call fcn.0050eb8d
mov edi, eax
call sub.KERNEL32.dll_GetCurrentProcessId
xor eax, edi
push eax
call fcn.0050eafc
add esp, 8
push 0x80
lea eax, [esp + 0x24]
mov ecx, ebx
push eax
call fcn.0049a160
lea eax, [esp + 0x20]
mov ecx, esi
push eax
call fcn.004f8c70
xor edi, edi
call fcn.0050eadb
mov ecx, dword [esi + 0x1e8]
sar eax, 7
movzx ebx, al
mov eax, dword [esi + 0x1e8]
xor eax, ebx
mov edx, dword [esi + 0x1f0]
movzx eax, al
and edx, 0xfffd
shr ecx, 8
or edx, 2
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov ecx, dword [esi + 0x1f0]
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [eax*4 + 0x5eda68]
mov eax, edx
xor eax, 1
mov dword [esi + 0x1f0], ecx
imul eax, edx
shr eax, 8
xor al, bl
mov byte [esp + edi + 0x14], al
inc edi
cmp edi, 0xa
jl 0x4f8647
lea eax, [esp + 0x20]
mov ecx, esi
push eax
call fcn.004f8c70
mov dl, byte [esp + 0x14]
mov ecx, dword [esi + 0x1e8]
mov edi, dword [esi + 0x1f0]
mov ebx, edi
movzx eax, dl
and ebx, 0xfffd
xor eax, ecx
or ebx, 2
movzx eax, al
shr ecx, 8
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x14], dl
mov dl, byte [esp + 0x15]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x15], dl
mov dl, byte [esp + 0x16]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
mov ecx, dword [esi + 0x1e8]
movzx eax, al
shr edi, 8
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x16], dl
mov dl, byte [esp + 0x17]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x17], dl
mov dl, byte [esp + 0x18]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x18], dl
mov dl, byte [esp + 0x19]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x19], dl
mov dl, byte [esp + 0x1a]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x1a], dl
mov dl, byte [esp + 0x1b]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
shr eax, 8
xor dl, al
or ebx, 2
mov byte [esp + 0x1b], dl
mov dl, byte [esp + 0x1c]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
push 0x80
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
mov ecx, dword [esi + 0x1e8]
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
mov ebx, edi
and ebx, 0xfffd
or ebx, 2
shr eax, 8
xor dl, al
mov byte [esp + 0x20], dl
mov dl, byte [esp + 0x21]
movzx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], edi
imul eax, ebx
shr eax, 8
xor dl, al
lea eax, [esp + 0x24]
push eax
mov byte [esp + 0x25], dl
call fcn.0049a3e0
mov edx, dword [esp + 0xac]
mov ecx, dword [esi + 0x1e8]
shr edx, 0x10
mov eax, edx
mov edi, dword [esi + 0x1f0]
xor eax, ecx
and edi, 0xfffd
movzx eax, al
or edi, 2
shr ecx, 8
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov ecx, dword [esi + 0x1f0]
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, ecx
shr ecx, 8
movzx eax, al
mov ebx, dword [eax*4 + 0x5eda68]
xor ebx, ecx
mov ecx, dword [esi + 0x1e8]
mov eax, edi
xor eax, 1
mov dword [esi + 0x1f0], ebx
imul eax, edi
and ebx, 0xfffd
or ebx, 2
push 0
push 0xc
push 1
shr eax, 8
xor al, dl
mov edx, dword [esp + 0xb8]
mov byte [esp + 0x2a], al
shr edx, 0x18
mov eax, edx
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [eax*4 + 0x5eda68]
xor eax, ecx
mov ecx, dword [esi + 0x1f0]
mov dword [esi + 0x1e8], eax
movzx eax, al
add eax, dword [esi + 0x1ec]
imul eax, eax, 0x8088405
inc eax
mov dword [esi + 0x1ec], eax
shr eax, 0x18
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [eax*4 + 0x5eda68]
mov eax, ebx
xor eax, 1
mov dword [esi + 0x1f0], ecx
imul eax, ebx
mov ecx, esi
shr eax, 8
xor al, dl
mov byte [esp + 0x2b], al
lea eax, [esp + 0x20]
push eax
call fcn.004f7500
mov ecx, dword [esp + 0xa0]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00502f8e
add esp, 0x98
ret 8