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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x58c8c0]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0xc], 0xc
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], eax
jge 0x416e63
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005089e3
mov esp, ebp
pop ebp
ret
mov eax, dword [0x58e630]
inc eax
mov dword [0x58e630], eax
cmp eax, 1
jne 0x416e88
push 0
call fcn.00509fac
xor eax, 0xbb40e64e
push eax
call fcn.0050cea5
add esp, 8
push ebx
mov ebx, edi
mov ecx, esi
call fcn.00416db0
add esp, 4
mov dword [ebp - 0x14], 0
lea esp, [esp]
call fcn.0050ceb7
mov ecx, dword [esi + 8]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x20], edx
mov edx, dword [esi]
mov ebx, edx
shr edx, 8
sar eax, 7
and eax, 0xff
xor ebx, eax
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x20]
mov edx, ecx
xor edx, 1
imul edx, ecx
shr edx, 8
xor dl, al
mov eax, dword [ebp - 0x14]
mov byte [ebp + eax - 0x10], dl
inc eax
mov dword [ebp - 0x14], eax
cmp eax, 0xa
jl 0x416ea0
mov eax, dword [ebp - 0x1c]
push eax
mov ebx, edi
mov ecx, esi
call fcn.00416db0
mov ecx, dword [ebp - 0x18]
lea edx, [ebp - 0x10]
add esp, 4
xor eax, eax
sub ecx, edx
mov dword [ebp - 0x1c], ecx
mov ecx, dword [esi + 8]
movzx ebx, byte [ebp + eax - 0x10]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x14], edx
mov edx, dword [esi]
xor ebx, edx
shr edx, 8
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
movzx ebx, byte [ebp + eax - 0xf]
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x14]
mov edx, ecx
xor edx, 1
imul edx, ecx
mov ecx, dword [ebp - 0x1c]
shr edx, 8
xor dl, byte [ebp + eax - 0x10]
add ecx, eax
mov byte [ebp + ecx - 0x10], dl
mov ecx, dword [esi + 8]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x14], edx
mov edx, dword [esi]
xor ebx, edx
shr edx, 8
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
movzx ebx, byte [ebp + eax - 0xe]
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x14]
mov edx, ecx
xor edx, 1
imul edx, ecx
mov ecx, dword [ebp - 0x18]
shr edx, 8
xor dl, byte [ebp + eax - 0xf]
mov byte [ecx + eax + 1], dl
mov ecx, dword [esi + 8]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x14], edx
mov edx, dword [esi]
xor ebx, edx
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
shr edx, 8
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
movzx ebx, byte [ebp + eax - 0xd]
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x14]
mov edx, ecx
xor edx, 1
imul edx, ecx
shr edx, 8
xor dl, byte [ebp + eax - 0xe]
mov ecx, dword [ebp - 0x18]
mov byte [ecx + eax + 2], dl
mov ecx, dword [esi + 8]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x14], edx
mov edx, dword [esi]
xor ebx, edx
shr edx, 8
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
movzx ebx, byte [ebp + eax - 0xc]
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x14]
mov edx, ecx
xor edx, 1
imul edx, ecx
mov ecx, dword [ebp - 0x18]
shr edx, 8
xor dl, byte [ebp + eax - 0xd]
mov byte [ecx + eax + 3], dl
mov ecx, dword [esi + 8]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x14], edx
mov edx, dword [esi]
xor ebx, edx
shr edx, 8
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x14]
mov edx, ecx
xor edx, 1
imul edx, ecx
mov ecx, dword [ebp - 0x18]
shr edx, 8
xor dl, byte [ebp + eax - 0xc]
add eax, 5
mov byte [ecx + eax - 1], dl
cmp eax, 0xa
jl 0x416f35
mov ecx, dword [esi + 8]
mov ebx, dword [ebp + 0x10]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x1c], edx
mov edx, dword [esi]
shr ebx, 0x10
mov dword [ebp - 0x20], ebx
xor ebx, edx
shr edx, 8
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
mov ebx, dword [ebp + 0x10]
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x1c]
mov edx, ecx
xor edx, 1
imul edx, ecx
mov ecx, dword [ebp - 0x18]
shr edx, 8
xor dl, byte [ebp - 0x20]
shr ebx, 0x18
mov byte [ecx + eax], dl
mov ecx, dword [esi + 8]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 0x1c], edx
mov edx, dword [esi]
mov dword [ebp - 0x20], ebx
xor ebx, edx
shr edx, 8
and ebx, 0xff
mov ebx, dword [edi + ebx*4]
xor ebx, edx
movzx edx, bl
add edx, dword [esi + 4]
mov dword [esi], ebx
imul edx, edx, 0x8088405
inc edx
mov dword [esi + 4], edx
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edi + edx*4]
add eax, 2
mov dword [esi + 8], ecx
mov ecx, dword [ebp - 0x1c]
mov edx, ecx
xor edx, 1
imul edx, ecx
mov ecx, dword [ebp - 0x18]
shr edx, 8
xor dl, byte [ebp - 0x20]
pop ebx
mov byte [ecx + eax - 1], dl
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005089e3
mov esp, ebp
pop ebp
ret