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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [0x10023c48]
sub esp, 0x14
push ebx
push esi
mov esi, dword [ebp + 0x10]
inc eax
push edi
mov edi, dword [ebp + 0x14]
mov dword [0x10023c48], eax
cmp eax, 1
jne 0x4182d1
push 0
call fcn.00409c60
xor eax, 0xbb40e64e
push eax
call fcn.00409c2d
add esp, 8
mov eax, dword [ebp + 8]
push edi
push esi
push eax
call fcn.0041638e
add esp, 0xc
mov dword [ebp - 4], 0
lea esp, [esp]
call fcn.00409c3f
mov ecx, dword [esi + 8]
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov dword [ebp - 8], 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 - 8]
mov edx, ecx
xor edx, 1
imul edx, ecx
shr edx, 8
xor dl, al
mov eax, dword [ebp - 4]
mov byte [ebp + eax - 0x14], dl
inc eax
mov dword [ebp - 4], eax
cmp eax, 0xa
jl 0x4182ed
mov eax, dword [ebp + 8]
push edi
push esi
push eax
call fcn.0041638e
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x14]
add esp, 0xc
xor ecx, ecx
sub eax, edx
mov dword [ebp - 4], eax
mov eax, dword [esi + 8]
movzx ebx, byte [ebp + ecx - 0x14]
mov edx, eax
and edx, 0xfffd
or edx, 2
mov dword [ebp - 8], 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, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edi + edx*4]
mov dword [esi + 8], eax
mov eax, dword [ebp - 8]
mov edx, eax
xor edx, 1
imul edx, eax
mov eax, dword [ebp - 4]
shr edx, 8
xor dl, byte [ebp + ecx - 0x14]
add eax, ecx
inc ecx
mov byte [ebp + eax - 0x14], dl
cmp ecx, 0xa
jl 0x418380
mov eax, dword [esi + 8]
mov ebx, dword [ebp + 0x18]
mov edx, eax
and edx, 0xfffd
or edx, 2
mov dword [ebp - 8], edx
mov edx, dword [esi]
shr ebx, 0x10
mov dword [ebp - 4], 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, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edi + edx*4]
mov ebx, dword [ebp + 0x18]
mov dword [esi + 8], eax
mov eax, dword [ebp - 8]
mov edx, eax
xor edx, 1
imul edx, eax
mov eax, dword [ebp + 0xc]
shr edx, 8
xor dl, byte [ebp - 4]
shr ebx, 0x18
mov byte [ecx + eax], dl
mov eax, dword [esi + 8]
mov edx, eax
and edx, 0xfffd
or edx, 2
mov dword [ebp - 8], edx
mov edx, dword [esi]
mov dword [ebp - 4], 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, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edi + edx*4]
pop edi
mov dword [esi + 8], eax
mov eax, dword [ebp - 8]
mov edx, eax
xor edx, 1
imul edx, eax
mov eax, dword [ebp + 0xc]
shr edx, 8
xor dl, byte [ebp - 4]
pop esi
mov byte [ecx + eax + 1], dl
lea eax, [ecx + 2]
pop ebx
mov esp, ebp
pop ebp
ret