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

Disassembly:
sub esp, 0x10
push ebx
mov ebx, dword [esp + 0x18]
mov dword [esp + 4], 0
push esi
test ebx, ebx
je 0x4eb07d
mov esi, dword [ebx + 0xe0]
test esi, esi
je 0x4eb07d
cmp dword [esi], 0
jne 0x4ead67
pop esi
mov eax, 0xffffff9c
pop ebx
add esp, 0x10
ret
mov edx, dword [esp + 0x24]
push ebp
push edi
test edx, edx
je 0x4eb073
mov eax, dword [esp + 0x28]
xor ebp, ebp
mov ecx, edx
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0x80]
mov dword [esi + 0x14], edx
mov dword [esp + 0x14], ebp
cmp ebp, dword [esi + 0x84]
jb 0x4eada8
ja 0x4ead9b
cmp edx, eax
jbe 0x4eada8
cmp dword [esi + 0xc8], ebp
jne 0x4eada8
mov dword [esi + 0x14], eax
mov ecx, eax
mov edi, dword [esi + 8]
xor eax, eax
mov ebp, edi
add ebp, dword [esi + 0x78]
adc eax, dword [esi + 0x7c]
cmp dword [esp + 0x14], eax
jb 0x4eadd2
ja 0x4eadc1
cmp edx, ebp
jbe 0x4eadd2
cmp dword [esi + 0xc8], 0
je 0x4eadd2
mov ecx, dword [esi + 0x78]
add ecx, edi
mov dword [esi + 0x14], ecx
test ecx, ecx
je 0x4eb067
mov ebp, 0xfffffffd
test edi, edi
jne 0x4eaf2f
mov ecx, dword [esi + 0x7c]
mov eax, dword [esi + 0x78]
test ecx, ecx
jne 0x4eadf9
test eax, eax
je 0x4eaf2f
mov edi, 0x4000
test ecx, ecx
ja 0x4eae12
jb 0x4eae08
cmp eax, edi
jae 0x4eae12
mov edi, eax
test edi, edi
je 0x4eb073
mov ecx, dword [esi + 0xc0]
add ecx, dword [esi + 0x40]
mov eax, dword [esi + 0xc4]
adc eax, dword [esi + 0x44]
push 0
push eax
push ecx
push dword [esi + 0xb4]
lea eax, [esi + 0x88]
push eax
call fcn.004eb0b0
add esp, 0x14
test eax, eax
jne 0x4eb05c
mov eax, dword [esi + 0x8c]
push edi
push dword [esi]
push dword [esi + 0xb4]
push dword [esi + 0xa4]
call eax
add esp, 0x10
cmp eax, edi
jne 0x4eb05c
cmp dword [ebx + 0xe4], 0
je 0x4eaf19
xor ebp, ebp
test edi, edi
je 0x4eaf14
nop
mov edx, dword [ebx + 0xf4]
mov ecx, dword [esi]
and edx, 0xfffd
or edx, 2
mov eax, edx
xor eax, 1
imul eax, edx
shr eax, 8
xor byte [ecx + ebp], al
mov bl, byte [ecx + ebp]
mov eax, dword [esp + 0x24]
mov edx, dword [eax + 0xf8]
mov ecx, dword [eax + 0xec]
movsx eax, bl
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [edx + eax*4]
mov eax, dword [esp + 0x24]
mov dword [eax + 0xec], ecx
movzx eax, cl
mov ecx, dword [esp + 0x24]
add eax, dword [ecx + 0xf0]
imul eax, eax, 0x8088405
inc eax
mov dword [ecx + 0xf0], eax
mov ecx, dword [ecx + 0xf4]
shr eax, 0x18
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [edx + eax*4]
mov eax, dword [esp + 0x24]
mov dword [eax + 0xf4], ecx
mov eax, dword [esi]
mov byte [eax + ebp], bl
inc ebp
mov ebx, dword [esp + 0x24]
cmp ebp, edi
jb 0x4eae80
mov ebp, 0xfffffffd
add dword [esi + 0x40], edi
mov eax, dword [esi]
adc dword [esi + 0x44], 0
sub dword [esi + 0x78], edi
mov dword [esi + 4], eax
sbb dword [esi + 0x7c], 0
mov dword [esi + 8], edi
mov eax, dword [esi + 0xb8]
test eax, eax
je 0x4eafe2
cmp dword [esi + 0xc8], 0
jne 0x4eafe2
cmp eax, 0xc
je 0x4eb04d
mov eax, dword [esi + 0x10]
mov edi, dword [esi + 0x18]
mov dword [esp + 0x18], eax
lea eax, [esi + 4]
push 2
push eax
mov dword [esp + 0x1c], edi
call fcn.004e6450
mov ebx, eax
add esp, 8
test ebx, ebx
js 0x4eaf7c
cmp dword [esi + 0x1c], 0
cmovne ebx, ebp
mov ebp, dword [esi + 0x18]
xor eax, eax
cmp ebp, edi
jae 0x4eaf8b
add ebp, 0
adc eax, 1
mov edi, ebp
sub edi, dword [esp + 0x14]
push edi
push dword [esp + 0x1c]
sbb eax, 0
add dword [esi + 0x68], edi
push dword [esi + 0x70]
adc dword [esi + 0x6c], eax
mov dword [esp + 0x28], eax
call fcn.004e8250
add esp, 0xc
mov dword [esi + 0x70], eax
sub dword [esi + 0x80], edi
mov eax, dword [esp + 0x1c]
sbb dword [esi + 0x84], eax
sub ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
add eax, ebp
mov dword [esp + 0x10], eax
cmp ebx, 1
je 0x4eafda
test ebx, ebx
je 0x4eb04a
mov eax, ebx
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x10
ret
test edi, edi
jne 0x4eafee
mov eax, dword [esi + 0x78]
or eax, dword [esi + 0x7c]
je 0x4eb067
mov ebx, dword [esi + 0x14]
cmp ebx, edi
cmovae ebx, edi
xor edx, edx
test ebx, ebx
je 0x4eb011
nop dword [eax]
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, ebx
jb 0x4eb000
add dword [esi + 0x68], ebx
push ebx
push dword [esi + 0x10]
adc dword [esi + 0x6c], 0
push dword [esi + 0x70]
call fcn.004e8250
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 dword [esp + 0x10], ebx
mov edi, dword [esi + 8]
cmp dword [esi + 0x14], 0
jbe 0x4eb067
mov ebx, dword [esp + 0x24]
jmp 0x4eadda
pop edi
pop ebp
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
mov eax, dword [esp + 0x10]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x10
ret
pop edi
pop ebp
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret
pop esi
mov eax, 0xffffff9a
pop ebx
add esp, 0x10
ret