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

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
xor ebx, ebx
mov dword [esp + 8], ebx
push esi
test ebp, ebp
je 0x5c6aad
mov esi, dword [ebp + 0xe0]
test esi, esi
je 0x5c6aad
cmp dword [esi], ebx
jne 0x5c6794
pop esi
pop ebp
lea eax, [ebx - 0x64]
pop ebx
add esp, 0x10
ret
mov edx, dword [esp + 0x28]
push edi
test edx, edx
je 0x5c6aa3
mov eax, dword [esp + 0x28]
xor edi, edi
mov ecx, edx
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0x80]
mov dword [esi + 0x14], edx
cmp edi, dword [esi + 0x84]
jb 0x5c67d0
ja 0x5c67c3
cmp edx, eax
jbe 0x5c67d0
cmp dword [esi + 0xc8], ebx
jne 0x5c67d0
mov dword [esi + 0x14], eax
mov ecx, eax
mov edi, dword [esi + 8]
xor eax, eax
add edi, dword [esi + 0x78]
adc eax, dword [esi + 0x7c]
cmp ebx, eax
jb 0x5c67f6
ja 0x5c67e5
cmp edx, edi
jbe 0x5c67f6
cmp dword [esi + 0xc8], ebx
je 0x5c67f6
mov ecx, dword [esi + 0x78]
add ecx, dword [esi + 8]
mov dword [esi + 0x14], ecx
test ecx, ecx
je 0x5c6a78
mov edi, dword [esi + 8]
mov ebx, 0xfffffffd
test edi, edi
jne 0x5c6953
mov ecx, dword [esi + 0x7c]
mov eax, dword [esi + 0x78]
test ecx, ecx
jne 0x5c6820
test eax, eax
je 0x5c6953
mov edi, 0x4000
test ecx, ecx
ja 0x5c6839
jb 0x5c682f
cmp eax, edi
jae 0x5c6839
mov edi, eax
test edi, edi
je 0x5c6aa3
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.005c6ae0
add esp, 0x14
test eax, eax
jne 0x5c6a82
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 0x5c6a82
cmp dword [ebp + 0xe4], 0
je 0x5c693d
xor ecx, ecx
mov dword [esp + 0x14], ecx
test edi, edi
je 0x5c693d
nop dword [eax]
mov edx, dword [ebp + 0xf4]
add ecx, dword [esi]
and edx, 0xfffd
or edx, 2
mov eax, edx
xor eax, 1
imul eax, edx
shr eax, 8
xor byte [ecx], al
mov bl, byte [ecx]
mov ecx, dword [ebp + 0xec]
mov edx, dword [ebp + 0xf8]
movsx eax, bl
xor eax, ecx
shr ecx, 8
movzx eax, al
mov eax, dword [edx + eax*4]
xor eax, ecx
mov ecx, dword [ebp + 0xf4]
mov dword [ebp + 0xec], eax
movzx eax, al
add eax, dword [ebp + 0xf0]
imul eax, eax, 0x8088405
inc eax
mov dword [ebp + 0xf0], eax
shr eax, 0x18
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [edx + eax*4]
mov dword [ebp + 0xf4], ecx
mov ecx, dword [esp + 0x14]
mov eax, dword [esi]
mov byte [ecx + eax], bl
inc ecx
mov dword [esp + 0x14], ecx
cmp ecx, edi
jb 0x5c68b0
mov ebx, 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 0x5c6a01
cmp dword [esi + 0xc8], 0
jne 0x5c6a01
cmp eax, 0xc
je 0x5c6a6a
mov eax, dword [esi + 0x18]
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0x10]
mov dword [esp + 0x1c], eax
lea eax, [esi + 4]
push 2
push eax
call fcn.005c9a80
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
js 0x5c69a6
cmp dword [esi + 0x1c], 0
cmovne eax, ebx
mov dword [esp + 0x18], eax
mov ebp, dword [esi + 0x18]
xor ebx, ebx
mov edi, ebp
sub edi, dword [esp + 0x14]
push edi
push dword [esp + 0x20]
sbb ebx, ebx
add dword [esi + 0x68], edi
push dword [esi + 0x70]
adc dword [esi + 0x6c], ebx
call fcn.005c74b0
mov ecx, dword [esp + 0x1c]
add esp, 0xc
sub dword [esi + 0x80], edi
mov dword [esi + 0x70], eax
sbb dword [esi + 0x84], ebx
sub ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add ecx, ebp
mov dword [esp + 0x10], ecx
cmp eax, 1
je 0x5c6a8d
test eax, eax
jne 0x5c6a7a
mov ebp, dword [esp + 0x24]
jmp 0x5c6a6a
test edi, edi
jne 0x5c6a11
mov eax, dword [esi + 0x78]
or eax, dword [esi + 0x7c]
je 0x5c6a97
mov ebx, dword [esi + 0x14]
cmp ebx, edi
cmovae ebx, edi
xor edx, edx
test ebx, ebx
je 0x5c6a31
nop
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 0x5c6a20
add dword [esi + 0x68], ebx
push ebx
push dword [esi + 0x10]
adc dword [esi + 0x6c], 0
push dword [esi + 0x70]
call fcn.005c74b0
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
cmp dword [esi + 0x14], 0
ja 0x5c67fe
mov ebx, dword [esp + 0x10]
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
pop edi
pop esi
pop ebp
mov eax, ecx
pop ebx
add esp, 0x10
ret
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
pop esi
pop ebp
mov eax, 0xffffff9a
pop ebx
add esp, 0x10
ret