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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x1c
mov ecx, dword [ebp + 8]
mov eax, 0xffffff9a
test ecx, ecx
je 0x4ce94a
mov esi, dword [ecx + 0xe0]
test esi, esi
je 0x4ce94a
cmp dword [esi], 0
je 0x4ce936
mov ecx, dword [ebp + 0x10]
xor eax, eax
test ecx, ecx
je 0x4ce94a
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x1c], esi
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], ecx
mov ecx, dword [esi + 0x78]
mov edi, dword [esi + 8]
mov edx, dword [esi + 0x7c]
mov esi, dword [ebp - 0x1c]
mov eax, ecx
mov ebx, edi
add eax, edi
adc edx, 0
cmp eax, dword [ebp + 0x10]
mov eax, 0
sbb edx, 0
jae 0x4ce6c2
cmp dword [esi + 0xc8], 0
je 0x4ce6c2
add ecx, ebx
mov dword [esi + 0x14], ecx
je 0x4ce94a
lea eax, [esi + 4]
lea ecx, [esi + 0x88]
xor edi, edi
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], ecx
test ebx, ebx
jne 0x4ce829
mov dword [ebp - 0x10], edi
mov eax, dword [esi + 0x78]
mov edi, dword [esi + 0x7c]
mov ecx, eax
or eax, edi
je 0x4ce824
mov ebx, 0x4000
xor edx, edx
mov eax, ecx
cmp ecx, ebx
mov ecx, edi
sbb ecx, 0
cmovae eax, ebx
cmovae edi, edx
test eax, eax
mov dword [ebp - 0x28], edi
je 0x4ce948
mov ecx, dword [esi + 0xc0]
mov ebx, eax
mov eax, dword [esi + 0xc4]
add ecx, dword [esi + 0x40]
adc eax, dword [esi + 0x44]
push 0
push eax
push ecx
push dword [esi + 0xb4]
push dword [ebp - 0x24]
call fcn.004da826
add esp, 0x14
test eax, eax
jne 0x4ce941
mov edi, ebx
push ebx
push dword [esi]
push dword [esi + 0xb4]
push dword [esi + 0xa4]
call dword [esi + 0x8c]
add esp, 0x10
cmp eax, ebx
jne 0x4ce941
mov eax, dword [ebp + 8]
cmp dword [eax + 0xe4], 0
je 0x4ce809
mov edi, eax
xor eax, eax
mov dword [ebp - 0x14], ebx
mov edx, dword [edi + 0xf4]
mov ecx, 0xfffd
and edx, ecx
lea ecx, [edx + 2]
xor edx, 3
imul ecx, edx
mov edx, dword [esi]
xor ch, byte [edx + eax]
mov byte [edx + eax], ch
mov dword [ebp - 0x18], ecx
movzx edx, ch
mov ecx, edi
mov ebx, dword [edi + 0xec]
mov esi, dword [edi + 0xf8]
movzx edi, bl
shr ebx, 8
xor edi, edx
mov edx, dword [ecx + 0xf4]
xor ebx, dword [esi + edi*4]
mov dword [ecx + 0xec], ebx
movzx edi, bl
movzx ebx, dl
shr edx, 8
add edi, dword [ecx + 0xf0]
imul edi, edi, 0x8088405
inc edi
mov dword [ecx + 0xf0], edi
shr edi, 0x18
xor ebx, edi
mov edi, ecx
mov ecx, dword [ebp - 0x1c]
xor edx, dword [esi + ebx*4]
mov ebx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x14]
mov dword [edi + 0xf4], edx
mov edx, dword [ecx]
mov byte [edx + eax], bh
inc eax
mov ebx, esi
cmp eax, esi
mov esi, ecx
jb 0x4ce779
add dword [esi + 0x40], ebx
mov ecx, ebx
mov eax, dword [ebp - 0x28]
adc dword [esi + 0x44], eax
sub dword [esi + 0x78], ebx
sbb dword [esi + 0x7c], eax
mov eax, dword [esi]
mov dword [esi + 4], eax
mov dword [esi + 8], ebx
jmp 0x4ce826
xor ebx, ebx
mov edi, dword [ebp - 0x10]
mov eax, dword [esi + 0xb8]
test eax, eax
je 0x4ce83c
cmp dword [esi + 0xc8], 0
je 0x4ce8b8
test ebx, ebx
jne 0x4ce84c
mov eax, dword [esi + 0x78]
or eax, dword [esi + 0x7c]
je 0x4ce946
mov eax, dword [esi + 0x14]
mov ecx, ebx
cmp eax, ebx
cmovb ecx, eax
mov ebx, ecx
test ecx, ecx
je 0x4ce86f
xor eax, eax
mov ecx, dword [esi + 4]
mov edx, dword [esi + 0x10]
mov cl, byte [ecx + eax]
mov byte [edx + eax], cl
inc eax
cmp eax, ebx
jb 0x4ce85e
add dword [esi + 0x68], ebx
adc dword [esi + 0x6c], 0
push ebx
push dword [esi + 0x10]
push dword [esi + 0x70]
call fcn.00433b66
add esp, 0xc
mov dword [esi + 0x70], eax
sub dword [esi + 0x80], ebx
sbb dword [esi + 0x84], 0
sub dword [esi + 8], ebx
sub dword [esi + 0x14], ebx
add dword [esi + 0x10], ebx
add dword [esi + 4], ebx
add dword [esi + 0x18], ebx
add edi, ebx
cmp dword [esi + 0x14], 0
je 0x4ce93d
mov ebx, dword [esi + 8]
jmp 0x4ce6d3
cmp eax, 0xc
je 0x4ce8a6
mov ebx, dword [esi + 0x10]
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x18], eax
push 2
push dword [ebp - 0x20]
call fcn.00405dfb
add esp, 8
mov ecx, eax
test eax, eax
mov dword [ebp - 0x10], edi
js 0x4ce8e8
cmp dword [esi + 0x1c], 0
mov eax, 0xfffffffd
cmovne ecx, eax
mov edx, dword [ebp - 0x18]
mov edi, dword [esi + 0x18]
mov dword [ebp - 0x14], ecx
mov ecx, ebx
mov eax, dword [esi + 0x70]
mov ebx, esi
mov esi, 0
sub edi, edx
sbb esi, esi
add dword [ebx + 0x68], edi
adc dword [ebx + 0x6c], esi
push edi
push ecx
push eax
call fcn.00433b66
add esp, 0xc
mov dword [ebx + 0x70], eax
sub dword [ebx + 0x80], edi
sbb dword [ebx + 0x84], esi
mov eax, dword [ebp - 0x10]
add eax, edi
mov edi, eax
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x4ce952
mov esi, ebx
jmp 0x4ce8a6
mov eax, 0xffffff9c
jmp 0x4ce94a
mov eax, edi
jmp 0x4ce94a
xor edx, edx
dec edx
jmp 0x4ce948
mov edx, edi
mov eax, edx
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
cmp eax, 1
mov edx, edi
je 0x4ce948
jmp 0x4ce94a