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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x5a6008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x5d7c6c]
push ebx
mov ebx, dword [0x5b5e80]
inc eax
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x24], ebx
mov dword [0x5d7c6c], eax
push esi
push edi
cmp eax, 1
jne 0x4b5d7a
push 0
call fcn.00517466
xor eax, 0xbb40e64e
push eax
call fcn.00517454
add esp, 8
mov ecx, ebx
call fcn.004b5cb0
mov dword [ebp - 0x14], 0
call fcn.00517433
mov edx, dword [0x5d7c70]
mov ecx, edx
mov esi, dword [0x622cd4]
sar eax, 7
xor ecx, eax
mov edi, dword [0x5d7c78]
mov dword [ebp - 0x20], eax
mov ebx, edi
movzx eax, cl
and ebx, 0xfffd
shr edx, 8
or ebx, 2
mov ecx, dword [ebp - 0x14]
xor edx, dword [esi + eax*4]
movzx eax, dl
add eax, dword [0x5d7c74]
imul eax, eax, 0x8088405
mov dword [0x5d7c70], edx
inc eax
mov dword [0x5d7c74], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [esi + eax*4]
mov eax, ebx
xor eax, 1
mov dword [0x5d7c78], edi
imul eax, ebx
shr eax, 8
xor al, byte [ebp - 0x20]
mov byte [ebp + ecx - 0x10], al
inc ecx
mov dword [ebp - 0x14], ecx
cmp ecx, 0xa
jl 0x4b5d88
mov ecx, dword [ebp - 0x24]
call fcn.004b5cb0
xor eax, eax
mov dword [ebp - 0x14], eax
nop dword [eax + eax]
movzx edi, byte [ebp + eax - 0x10]
mov ecx, dword [0x5d7c70]
mov eax, edi
xor eax, ecx
mov edx, dword [0x5d7c78]
movzx eax, al
mov ebx, edx
shr ecx, 8
and ebx, 0xfffd
push dword [ebp - 0x1c]
or ebx, 2
xor ecx, dword [esi + eax*4]
movzx eax, cl
add eax, dword [0x5d7c74]
imul eax, eax, 0x8088405
mov dword [0x5d7c70], ecx
inc eax
mov dword [0x5d7c74], eax
shr eax, 0x18
xor eax, edx
shr edx, 8
movzx eax, al
xor edx, dword [esi + eax*4]
mov eax, ebx
xor eax, 1
mov dword [0x5d7c78], edx
imul eax, ebx
shr eax, 8
movzx eax, al
xor eax, edi
push eax
call fcn.00529f4d
mov eax, dword [ebp - 0x14]
add esp, 8
inc eax
mov dword [ebp - 0x14], eax
cmp eax, 0xa
jge 0x4b5eab
mov esi, dword [0x622cd4]
jmp 0x4b5e20
mov ebx, dword [ebp - 0x18]
mov ecx, dword [0x5d7c70]
mov edx, dword [0x622cd4]
mov esi, dword [0x5d7c78]
mov edi, esi
shr ebx, 0x10
and edi, 0xfffd
mov eax, ebx
or edi, 2
xor eax, ecx
shr ecx, 8
movzx eax, al
push dword [ebp - 0x1c]
xor ecx, dword [edx + eax*4]
movzx eax, cl
add eax, dword [0x5d7c74]
imul eax, eax, 0x8088405
mov dword [0x5d7c70], ecx
mov ecx, edi
xor ecx, 1
imul ecx, edi
inc eax
mov dword [0x5d7c74], eax
shr eax, 0x18
xor eax, esi
shr esi, 8
movzx eax, al
xor esi, dword [edx + eax*4]
mov eax, dword [ebp - 0x18]
shr eax, 8
xor ecx, eax
mov dword [0x5d7c78], esi
shr ecx, 8
movzx eax, cl
push eax
call fcn.00529f4d
mov eax, dword [ebp - 0x18]
mov ecx, dword [0x5d7c70]
mov edx, dword [0x622cd4]
shr eax, 0x18
xor eax, ecx
mov esi, dword [0x5d7c78]
movzx eax, al
mov edi, esi
shr ecx, 8
and edi, 0xfffd
push dword [ebp - 0x1c]
or edi, 2
xor ecx, dword [edx + eax*4]
movzx eax, cl
add eax, dword [0x5d7c74]
imul eax, eax, 0x8088405
mov dword [0x5d7c70], ecx
inc eax
mov dword [0x5d7c74], eax
shr eax, 0x18
xor eax, esi
shr esi, 8
movzx eax, al
xor esi, dword [edx + eax*4]
mov eax, edi
xor eax, 1
mov dword [0x5d7c78], esi
imul eax, edi
and eax, 0xff00
xor eax, ebx
shr eax, 8
push eax
call fcn.00529f4d
mov ecx, dword [ebp - 4]
add esp, 0x10
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.00511339
mov esp, ebp
pop ebp
ret