Function at 0x716ed0
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, 0x18
mov eax, dword [ebp + 8]
mov edi, 0xffffff9a
test eax, eax
je 0x716f57
mov ecx, dword [eax + 0xe0]
test ecx, ecx
je 0x716f57
cmp dword [ecx], 0
je 0x716f52
mov edx, dword [ebp + 0x10]
xor edi, edi
test edx, edx
je 0x716f57
mov eax, dword [ebp + 0xc]
mov dword [ecx + 0x10], eax
mov dword [ecx + 0x14], edx
mov dword [ebp - 0x10], ecx
mov eax, dword [ebp - 0x10]
mov esi, dword [eax + 0x7c]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 8]
mov ecx, dword [ebp - 0x10]
mov ecx, dword [ecx + 0x78]
mov ebx, ecx
add ebx, eax
adc esi, 0
cmp ebx, edx
sbb esi, 0
mov esi, dword [ebp - 0x10]
jae 0x716f3c
cmp dword [esi + 0xc8], 0
je 0x716f3c
add ecx, eax
mov dword [esi + 0x14], ecx
je 0x716f57
lea eax, [esi + 4]
mov dword [ebp - 0x20], eax
lea eax, [esi + 0x88]
mov dword [ebp - 0x24], eax
xor edi, edi
jmp 0x716fd7
mov edi, 0xffffff9c
mov eax, edi
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret
xor edi, edi
dec edi
jmp 0x716f57
cmp eax, 1
je 0x716f57
mov edi, eax
jmp 0x716f57
test ebx, ebx
jne 0x716f7b
mov eax, dword [esi + 0x78]
or eax, dword [esi + 0x7c]
je 0x716f57
mov eax, dword [esi + 0x14]
cmp eax, ebx
cmovb ebx, eax
test ebx, ebx
je 0x716f9a
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 ebx, eax
jne 0x716f89
add dword [esi + 0x68], ebx
adc dword [esi + 0x6c], 0
push ebx
push dword [esi + 0x10]
push dword [esi + 0x70]
call fcn.0056a6d0
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 0x716f57
mov ebx, dword [esi + 8]
test ebx, ebx
je 0x71707e
mov eax, dword [esi + 0xb8]
test eax, eax
je 0x716f6f
cmp dword [esi + 0xc8], 0
jne 0x716f6f
cmp eax, 0xc
je 0x716fd1
mov ebx, dword [esi + 0x10]
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x18], eax
push 2
push dword [ebp - 0x20]
call fcn.00542800
add esp, 8
mov ecx, eax
test eax, eax
mov dword [ebp - 0x1c], edi
mov edx, ebx
js 0x71702b
cmp dword [esi + 0x1c], 0
mov eax, 0xfffffffd
cmovne ecx, eax
mov dword [ebp - 0x14], ecx
mov edi, dword [esi + 0x18]
xor ebx, ebx
sub edi, dword [ebp - 0x18]
setb bl
sbb ebx, 0
mov eax, dword [esi + 0x70]
add dword [esi + 0x68], edi
adc dword [esi + 0x6c], ebx
push edi
push edx
push eax
call fcn.0056a6d0
add esp, 0xc
mov dword [esi + 0x70], eax
sub dword [esi + 0x80], edi
sbb dword [esi + 0x84], ebx
mov eax, dword [ebp - 0x1c]
add edi, eax
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x716f66
mov esi, dword [ebp - 0x10]
jmp 0x716fd1
xor ebx, ebx
jmp 0x716fe2
mov ebx, dword [esi + 0x78]
mov eax, dword [esi + 0x7c]
mov ecx, ebx
or ecx, eax
je 0x717077
mov ecx, 0x4000
cmp ebx, ecx
cmovae ebx, ecx
test eax, eax
cmovne ebx, ecx
mov eax, dword [esi + 0xc0]
add eax, dword [esi + 0x40]
mov ecx, dword [esi + 0xc4]
adc ecx, dword [esi + 0x44]
push 0
push ecx
push eax
push dword [esi + 0xb4]
push dword [ebp - 0x24]
call fcn.00737cf0
add esp, 0x14
test eax, eax
jne 0x716f61
mov eax, dword [esi]
mov dword [ebp - 0x14], eax
mov ecx, dword [esi + 0x8c]
mov dword [ebp - 0x18], ebx
mov ebx, dword [esi + 0xb4]
mov esi, dword [esi + 0xa4]
call dword [0x8072c0]
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push ebx
mov ebx, dword [ebp - 0x18]
push esi
call ecx
add esp, 0x10
cmp eax, ebx
jne 0x716f61
mov dword [ebp - 0x1c], edi
mov edx, dword [ebp + 8]
cmp dword [edx + 0xe4], 0
mov edi, dword [ebp - 0x10]
je 0x7171b9
xor esi, esi
mov eax, dword [edx + 0xf4]
mov ecx, eax
and ecx, 0xfffd
or eax, 2
xor ecx, 3
imul ecx, eax
mov eax, dword [edi]
xor ch, byte [eax + esi]
mov byte [eax + esi], ch
mov edi, dword [edx + 0xf8]
mov dword [ebp - 0x14], edi
mov eax, dword [edx + 0xec]
mov edx, dword [ebp + 8]
mov ebx, dword [edx + 0xf4]
mov edx, eax
xor dl, ch
movzx edx, dl
shr eax, 8
xor eax, dword [edi + edx*4]
mov edx, dword [ebp + 8]
mov dword [edx + 0xec], eax
mov edx, 0xff
and eax, edx
mov edx, dword [ebp + 8]
add eax, dword [edx + 0xf0]
imul eax, eax, 0x8088405
inc eax
mov dword [edx + 0xf0], eax
shr eax, 0x18
mov edx, ebx
mov edi, 0xff
and edx, edi
xor edx, eax
shr ebx, 8
mov eax, dword [ebp - 0x14]
xor ebx, dword [eax + edx*4]
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp + 8]
mov dword [eax + 0xf4], ebx
mov ebx, dword [ebp - 0x18]
mov edx, dword [ebp + 8]
mov eax, dword [edi]
mov byte [eax + esi], ch
inc esi
cmp ebx, esi
jne 0x717118
add dword [edi + 0x40], ebx
adc dword [edi + 0x44], 0
sub dword [edi + 0x78], ebx
sbb dword [edi + 0x7c], 0
mov eax, dword [edi]
mov dword [edi + 4], eax
mov dword [edi + 8], ebx
mov esi, edi
mov edi, dword [ebp - 0x1c]
jmp 0x716fe2