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

Disassembly:
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]
push ss
push ss
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 0x409e25
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.0040ba8f
mov esp, ebp
pop ebp
ret