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

Disassembly:
sub esp, 0x10
mov eax, dword [0x4c0390]
xor eax, esp
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x14]
push ebx
push ebp
push esi
push edi
push eax
mov esi, ecx
call fcn.0046db30
mov eax, dword [esi]
mov ecx, dword [esi + 4]
mov edx, dword [esi + 8]
mov edi, dword [0x4db5dc]
mov dword [esp + 0x10], eax
mov eax, dword [0x4db5d8]
mov dword [esp + 0x14], ecx
mov ecx, dword [0x4db5e0]
mov dword [esp + 0x18], edx
xor ebp, ebp
mov edx, ecx
and edx, 0xfffd
or edx, 2
mov ebx, edx
xor ebx, 1
imul ebx, edx
shr ebx, 8
xor byte [esp + ebp + 0x10], bl
movzx edx, byte [esp + ebp + 0x10]
xor edx, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edx*4 + 0x4c6a28]
movzx esi, al
add esi, edi
imul esi, esi, 0x8088405
inc esi
mov edx, esi
shr edx, 0x18
xor edx, ecx
and edx, 0xff
shr ecx, 8
xor ecx, dword [edx*4 + 0x4c6a28]
mov edi, ecx
and edi, 0xfffd
or edi, 2
mov edx, edi
xor edx, 1
imul edx, edi
shr edx, 8
xor byte [esp + ebp + 0x11], dl
movzx edx, byte [esp + ebp + 0x11]
xor edx, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edx*4 + 0x4c6a28]
movzx edx, al
add edx, esi
imul edx, edx, 0x8088405
inc edx
mov esi, edx
shr esi, 0x18
xor esi, ecx
shr ecx, 8
and esi, 0xff
xor ecx, dword [esi*4 + 0x4c6a28]
mov esi, ecx
mov edi, esi
and edi, 0xfffd
or edi, 2
mov ecx, edi
xor ecx, 1
imul ecx, edi
shr ecx, 8
xor byte [esp + ebp + 0x12], cl
movzx ecx, byte [esp + ebp + 0x12]
xor ecx, eax
and ecx, 0xff
shr eax, 8
xor eax, dword [ecx*4 + 0x4c6a28]
movzx ecx, al
add ecx, edx
imul ecx, ecx, 0x8088405
inc ecx
mov edx, ecx
shr edx, 0x18
xor edx, esi
and edx, 0xff
shr esi, 8
xor esi, dword [edx*4 + 0x4c6a28]
mov edi, esi
and edi, 0xfffd
or edi, 2
mov edx, edi
xor edx, 1
imul edx, edi
shr edx, 8
xor byte [esp + ebp + 0x13], dl
movzx edx, byte [esp + ebp + 0x13]
xor edx, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edx*4 + 0x4c6a28]
add ebp, 6
movzx edx, al
add edx, ecx
imul edx, edx, 0x8088405
inc edx
mov ecx, edx
shr ecx, 0x18
xor ecx, esi
and ecx, 0xff
shr esi, 8
xor esi, dword [ecx*4 + 0x4c6a28]
mov edi, esi
and edi, 0xfffd
or edi, 2
mov ecx, edi
xor ecx, 1
imul ecx, edi
shr ecx, 8
xor byte [esp + ebp + 0xe], cl
movzx ecx, byte [esp + ebp + 0xe]
xor ecx, eax
and ecx, 0xff
shr eax, 8
xor eax, dword [ecx*4 + 0x4c6a28]
movzx ecx, al
add ecx, edx
imul ecx, ecx, 0x8088405
inc ecx
mov edx, ecx
shr edx, 0x18
xor edx, esi
and edx, 0xff
shr esi, 8
xor esi, dword [edx*4 + 0x4c6a28]
mov edi, esi
and edi, 0xfffd
or edi, 2
mov edx, edi
xor edx, 1
imul edx, edi
shr edx, 8
xor byte [esp + ebp + 0xf], dl
movzx edx, byte [esp + ebp + 0xf]
xor edx, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edx*4 + 0x4c6a28]
movzx edi, al
add edi, ecx
imul edi, edi, 0x8088405
inc edi
mov ecx, edi
shr ecx, 0x18
xor ecx, esi
and ecx, 0xff
shr esi, 8
xor esi, dword [ecx*4 + 0x4c6a28]
cmp ebp, 0xc
mov ecx, esi
jl 0x46dc05
movzx dx, byte [esp + 0x1b]
mov dword [0x4db5d8], eax
mov eax, dword [0x4ca4a0]
mov dword [0x4db5e0], ecx
mov dword [0x4db5dc], edi
test byte [eax + 0x28], 2
movzx eax, byte [0x4da50f]
movzx edx, dx
jne 0x46de40
movzx eax, byte [0x4da517]
movzx edx, dx
cmp edx, eax
je 0x46de5f
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
mov ecx, dword [esp + 0xc]
xor ecx, esp
call fcn.0049eaa6
add esp, 0x10
ret 4
mov esi, dword [0x4da4b8]
mov eax, esi
cdq
cmp edx, dword [0x4c9874]
jl 0x46de7e
mov edx, dword [0x4c9870]
jg 0x46de7c
cmp eax, edx
jbe 0x46de7e
mov esi, edx
mov edx, dword [0x4da4b0]
test esi, esi
je 0x46df00
jmp 0x46de90
and ecx, 0xfffd
or ecx, 2
mov eax, ecx
xor eax, 1
imul eax, ecx
shr eax, 8
xor byte [edx], al
movzx ecx, byte [edx]
mov eax, dword [0x4db5d8]
xor ecx, eax
shr eax, 8
and ecx, 0xff
xor eax, dword [ecx*4 + 0x4c6a28]
mov ecx, dword [0x4db5e0]
mov dword [0x4db5d8], eax
movzx eax, al
add eax, dword [0x4db5dc]
dec esi
imul eax, eax, 0x8088405
inc eax
mov dword [0x4db5dc], eax
shr eax, 0x18
xor eax, ecx
and eax, 0xff
shr ecx, 8
xor ecx, dword [eax*4 + 0x4c6a28]
inc edx
mov dword [0x4db5e0], ecx
test esi, esi
jne 0x46de90
mov ecx, dword [esp + 0x1c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0049eaa6
add esp, 0x10
ret 4