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

Disassembly:
sub esp, 0x10
push ebp
mov ebp, dword [esp + 0x18]
mov dword [esp + 4], 0
push esi
test ebp, ebp
je 0x547e70
mov esi, dword [ebp + 0xe0]
test esi, esi
je 0x547e70
cmp dword [esi], 0
jne 0x547b57
pop esi
mov eax, 0xffffff9c
pop ebp
add esp, 0x10
ret
mov edx, dword [esp + 0x24]
push ebx
push edi
test edx, edx
je 0x547e66
mov eax, dword [esp + 0x28]
xor ebx, ebx
mov ecx, edx
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0x80]
mov dword [esi + 0x14], edx
mov dword [esp + 0x14], ebx
cmp ebx, dword [esi + 0x84]
jb 0x547b98
ja 0x547b8b
cmp edx, eax
jbe 0x547b98
cmp dword [esi + 0xc8], ebx
jne 0x547b98
mov dword [esi + 0x14], eax
mov ecx, eax
mov ebx, dword [esi + 8]
xor eax, eax
mov edi, ebx
add edi, dword [esi + 0x78]
adc eax, dword [esi + 0x7c]
cmp dword [esp + 0x14], eax
jb 0x547bc2
ja 0x547bb1
cmp edx, edi
jbe 0x547bc2
cmp dword [esi + 0xc8], 0
je 0x547bc2
mov ecx, dword [esi + 0x78]
add ecx, ebx
mov dword [esi + 0x14], ecx
test ecx, ecx
je 0x547e45
nop word [eax + eax]
mov edi, dword [esi + 8]
test edi, edi
jne 0x547d1c
mov ecx, dword [esi + 0x7c]
mov eax, dword [esi + 0x78]
test ecx, ecx
jne 0x547bed
test eax, eax
je 0x547d1c
mov edi, 0x4000
test ecx, ecx
ja 0x547c06
jb 0x547bfc
cmp eax, edi
jae 0x547c06
mov edi, eax
test edi, edi
je 0x547e66
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.00547ea0
add esp, 0x14
test eax, eax
jne 0x547e51
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 0x547e51
cmp dword [ebp + 0xe4], 0
je 0x547d06
xor ecx, ecx
mov dword [esp + 0x14], ecx
test edi, edi
je 0x547d06
nop word [eax + 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
xor ecx, dword [edx + eax*4]
movzx eax, cl
add eax, dword [ebp + 0xf0]
imul eax, eax, 0x8088405
mov dword [ebp + 0xec], ecx
mov ecx, dword [ebp + 0xf4]
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 0x547c80
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 0x547dd8
cmp dword [esi + 0xc8], 0
jne 0x547dd8
cmp eax, 0xc
je 0x547e3b
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.005297d0
mov ebx, eax
add esp, 8
test ebx, ebx
js 0x547d6e
cmp dword [esi + 0x1c], 0
mov eax, 0xfffffffd
cmovne ebx, eax
mov ebp, dword [esi + 0x18]
xor eax, eax
cmp ebp, edi
jae 0x547d7d
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.0052b710
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 0x547e49
test ebx, ebx
jne 0x547e5c
mov ebp, dword [esp + 0x24]
jmp 0x547e3b
test edi, edi
jne 0x547de4
mov eax, dword [esi + 0x78]
or eax, dword [esi + 0x7c]
je 0x547e45
cmp dword [esi + 0x14], edi
cmovb edi, dword [esi + 0x14]
xor edx, edx
test edi, edi
je 0x547e02
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, edi
jb 0x547df1
add dword [esi + 0x68], edi
push edi
push dword [esi + 0x10]
adc dword [esi + 0x6c], 0
push dword [esi + 0x70]
call fcn.0052b710
add esp, 0xc
mov dword [esi + 0x70], eax
sub dword [esi + 0x80], edi
sbb dword [esi + 0x84], 0
sub dword [esi + 8], edi
sub dword [esi + 0x14], edi
add dword [esi + 0x10], edi
add dword [esi + 4], edi
add dword [esi + 0x18], edi
add dword [esp + 0x10], edi
cmp dword [esi + 0x14], 0
ja 0x547bd0
mov eax, dword [esp + 0x10]
pop edi
pop ebx
pop esi
pop ebp
add esp, 0x10
ret
pop edi
pop ebx
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0x10
ret
pop edi
mov eax, ebx
pop ebx
pop esi
pop ebp
add esp, 0x10
ret
pop edi
pop ebx
pop esi
xor eax, eax
pop ebp
add esp, 0x10
ret
pop esi
mov eax, 0xffffff9a
pop ebp
add esp, 0x10
ret