Function at 0x507ea0
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, 0x30
mov esi, dword [ebp + 8]
mov eax, dword [0x54a010]
xor eax, ebp
mov dword [ebp - 0x10], eax
xor edi, edi
dec edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], edi
mov ebx, 0xffffff9a
test esi, esi
je 0x507f16
mov eax, dword [esi + 0x60]
or eax, dword [esi + 0x64]
je 0x507f16
cmp dword [esi + 0xe0], 0
jne 0x507f2a
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x30], edi
mov eax, dword [esi + 0x48]
add eax, dword [esi + 0xd8]
mov ecx, dword [esi + 0x4c]
adc ecx, dword [esi + 0xdc]
push 0
push ecx
push eax
push dword [esi + 0x30]
push esi
call fcn.00512720
add esp, 0x14
test eax, eax
je 0x507f35
mov ebx, 0xffffff99
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004a0403
mov eax, ebx
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
push esi
call fcn.00507510
add esp, 4
jmp 0x507edc
mov edx, dword [esi + 0x30]
lea ebx, [ebp - 0x20]
mov ecx, esi
push ebx
call fcn.00508840
add esp, 4
mov dword [ebp - 0x38], eax
mov eax, dword [ebx]
mov dword [ebp - 0x34], eax
mov edx, dword [esi + 0x30]
lea eax, [ebp - 0x24]
mov ecx, esi
push eax
call fcn.00508de0
add esp, 4
mov dword [ebp - 0x3c], eax
mov edx, dword [esi + 0x30]
lea eax, [ebp - 0x28]
mov ecx, esi
push eax
call fcn.00508de0
add esp, 4
mov ebx, eax
mov edx, dword [esi + 0x30]
mov ecx, esi
lea eax, [ebp - 0x24]
push eax
call fcn.00508de0
add esp, 4
mov ecx, edi
test eax, eax
jne 0x507fe5
or ebx, dword [ebp - 0x3c]
or ebx, dword [ebp - 0x38]
sete al
mov edx, dword [ebp - 0x34]
jne 0x507fcd
cmp edx, 0x4034b50
jne 0x507fcd
mov eax, dword [ebp - 0x24]
mov ecx, 0xffffff99
cmp eax, dword [esi + 0x8c]
jne 0x507fe5
cmp eax, 0xc
ja 0x507fc6
mov ecx, 0x1101
bt ecx, eax
mov ecx, 0
jb 0x507fe5
mov ecx, 0xffffff99
jmp 0x507fe5
xor ecx, ecx
cmp edx, 0x4034b50
mov edx, 0xffffff99
cmove edx, ecx
xor ecx, ecx
dec ecx
test al, al
cmovne ecx, edx
mov dword [ebp - 0x34], ecx
mov edx, dword [esi + 0x30]
mov ecx, esi
lea ebx, [ebp - 0x24]
push ebx
call fcn.00508840
add esp, 4
mov dword [ebp - 0x38], eax
mov edx, dword [esi + 0x30]
mov ecx, esi
push ebx
call fcn.00508840
add esp, 4
mov ebx, edi
test eax, eax
jne 0x50803a
xor ebx, ebx
neg dword [ebp - 0x38]
sbb ebx, ebx
or ebx, dword [ebp - 0x34]
jne 0x50803a
mov eax, dword [ebp - 0x24]
mov ebx, 0
cmp eax, dword [esi + 0x94]
je 0x50803a
xor eax, eax
test byte [ebp - 0x28], 8
mov ebx, 0xffffff99
cmovne ebx, eax
mov edx, dword [esi + 0x30]
mov ecx, esi
lea eax, [ebp - 0x24]
push eax
call fcn.00508840
add esp, 4
mov ecx, edi
test eax, eax
jne 0x508081
mov eax, dword [ebp - 0x24]
cmp eax, 0xffffffff
je 0x50807f
mov ecx, ebx
test ebx, ebx
jne 0x508081
xor eax, dword [esi + 0x98]
xor ecx, ecx
or eax, dword [esi + 0x9c]
je 0x508081
xor eax, eax
test byte [ebp - 0x28], 8
mov ecx, 0xffffff99
cmovne ecx, eax
jmp 0x508081
mov ecx, ebx
mov dword [ebp - 0x34], ecx
mov edx, dword [esi + 0x30]
mov ecx, esi
lea eax, [ebp - 0x24]
push eax
call fcn.00508840
add esp, 4
mov ebx, edi
test eax, eax
jne 0x5080cf
mov eax, dword [ebp - 0x24]
cmp eax, 0xffffffff
je 0x5080cc
mov ecx, dword [ebp - 0x34]
mov ebx, ecx
test ecx, ecx
jne 0x5080cf
xor eax, dword [esi + 0xa0]
xor ebx, ebx
or eax, dword [esi + 0xa4]
je 0x5080cf
xor eax, eax
test byte [ebp - 0x28], 8
mov ebx, 0xffffff99
cmovne ebx, eax
jmp 0x5080cf
mov ebx, dword [ebp - 0x34]
mov edx, dword [esi + 0x30]
lea eax, [ebp - 0x2c]
mov ecx, esi
push eax
call fcn.00508de0
add esp, 4
test eax, eax
jne 0x5080fd
mov edi, ebx
test ebx, ebx
jne 0x5080fd
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
cmp eax, dword [esi + 0xa8]
mov edi, 0xffffff99
cmove edi, ecx
mov ebx, dword [ebp - 0x2c]
mov edx, dword [esi + 0x30]
lea eax, [ebp - 0x30]
mov ecx, esi
push eax
call fcn.00508de0
add esp, 4
mov edx, dword [esi + 0xdc]
mov ecx, dword [esi + 0xd8]
mov dword [ebp - 0x34], ebx
add ecx, ebx
adc edx, 0
add ecx, 0x1e
adc edx, 0
or eax, edi
mov ebx, 0xffffff99
jne 0x507f16
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x38], ecx
mov ebx, dword [ebp - 0x30]
push 0xd0
call fcn.00464730
add esp, 4
test eax, eax
je 0x5081d9
mov edi, eax
push 0x4000
call fcn.00464730
add esp, 4
mov dword [edi], eax
mov ecx, dword [ebp - 0x3c]
mov dword [edi + 0x54], ecx
mov ecx, dword [ebp - 0x38]
mov dword [edi + 0x50], ecx
mov dword [ebp - 0x38], ebx
mov dword [edi + 0x58], ebx
mov ebx, dword [ebp + 0x14]
xor ecx, ecx
mov dword [edi + 0x64], ecx
mov dword [edi + 0x60], ecx
mov dword [edi + 0xc8], ebx
test eax, eax
je 0x5081d0
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov dword [edi + 0x48], 0
test ecx, ecx
je 0x5081a7
mov edx, dword [esi + 0x8c]
mov dword [ecx], edx
test eax, eax
je 0x5081ef
mov dword [eax], 6
mov ecx, dword [esi + 0x88]
and ecx, 6
cmp ecx, 2
je 0x5081e3
cmp ecx, 6
je 0x5081ea
cmp ecx, 4
jne 0x5081ef
mov ecx, 2
jmp 0x5081ed
push edi
call fcn.00464780
add esp, 4
mov ebx, 0xffffff98
jmp 0x507f16
mov ecx, 9
jmp 0x5081ed
xor ecx, ecx
inc ecx
mov dword [eax], ecx
mov eax, dword [esi + 0x94]
mov dword [edi + 0x74], eax
xor ecx, ecx
mov dword [edi + 0x70], ecx
mov dword [edi + 0x6c], ecx
mov dword [edi + 0x68], ecx
mov eax, dword [esi + 0x8c]
mov dword [edi + 0xb8], eax
mov edx, dword [esi + 0x30]
mov dword [edi + 0xb4], edx
movups xmm0, xmmword [esi]
movups xmm1, xmmword [esi + 0x10]
movups xmmword [edi + 0x88], xmm0
movups xmmword [edi + 0x98], xmm1
movups xmm0, xmmword [esi + 0x1c]
movups xmmword [edi + 0xa4], xmm0
movsd xmm0, qword [esi + 0x48]
movsd qword [edi + 0xc0], xmm0
mov dword [edi + 0x18], ecx
test ebx, ebx
jne 0x508482
cmp eax, 0xc
jne 0x508482
mov dword [edi + 0xc8], 1
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp - 0x34]
movsd xmm0, qword [esi + 0x98]
movsd qword [edi + 0x78], xmm0
movsd xmm0, qword [esi + 0xa0]
movsd qword [edi + 0x80], xmm0
xor ebx, ebx
add ecx, dword [esi + 0xd8]
mov eax, dword [esi + 0xdc]
adc eax, ebx
add ecx, 0x1e
mov dword [edi + 0x40], ecx
adc eax, ebx
mov dword [edi + 0x44], eax
mov dword [edi + 8], ebx
mov dword [esi + 0xe0], edi
mov eax, dword [ebp + 0x18]
mov dword [esi + 0xe4], ebx
test eax, eax
je 0x507f16
mov edi, eax
call fcn.004e2900
mov dword [ebp - 0x34], eax
mov dword [esi + 0xf8], eax
mov dword [esi + 0xec], 0x12345678
mov dword [esi + 0xf0], 0x23456789
mov dword [esi + 0xf4], 0x34567890
mov al, byte [edi]
test al, al
je 0x50835e
mov edx, edi
inc edx
mov ecx, 0x12345678
mov ebx, 0x23456789
mov edi, 0x34567890
mov dword [ebp - 0x38], edx
mov ah, cl
xor ah, al
movzx eax, ah
shr ecx, 8
mov edx, dword [ebp - 0x34]
xor ecx, dword [edx + eax*4]
mov eax, ecx
mov edx, 0xff
and eax, edx
add eax, ebx
imul ebx, eax, 0x8088405
inc ebx
mov eax, ebx
shr eax, 0x18
mov edx, edi
mov esi, 0xff
and edx, esi
mov esi, dword [ebp + 8]
xor edx, eax
mov dword [esi + 0xec], ecx
mov dword [esi + 0xf0], ebx
shr edi, 8
mov eax, dword [ebp - 0x34]
xor edi, dword [eax + edx*4]
mov edx, dword [ebp - 0x38]
mov dword [esi + 0xf4], edi
mov al, byte [edx]
inc edx
test al, al
jne 0x508301
mov eax, dword [esi + 0xe0]
mov ecx, dword [eax + 0xc0]
add ecx, dword [eax + 0x40]
mov edx, dword [eax + 0xc4]
adc edx, dword [eax + 0x44]
push 0
push edx
push ecx
push dword [esi + 0x30]
push esi
call fcn.00512720
add esp, 0x14
test eax, eax
jne 0x5081d9
mov edi, dword [esi + 0x30]
mov ecx, dword [esi + 4]
mov ebx, dword [esi + 0x1c]
call dword [section..00cfg]
lea eax, [ebp - 0x1c]
push 0xc
push eax
push edi
push ebx
call ecx
add esp, 0x10
mov ebx, 0xffffff98
cmp eax, 0xc
jb 0x507f16
mov eax, dword [esi + 0xf8]
mov dword [ebp - 0x38], eax
mov eax, dword [esi + 0xf4]
mov edx, dword [esi + 0xec]
mov edi, dword [esi + 0xf0]
mov dword [ebp - 0x34], 0
mov ecx, eax
and ecx, 0xfffd
mov ebx, eax
or ebx, 2
xor ecx, 3
imul ecx, ebx
mov ebx, dword [ebp - 0x34]
xor ch, byte [ebp + ebx - 0x1c]
mov byte [ebp + ebx - 0x1c], ch
mov ebx, edx
xor bl, ch
movzx ecx, bl
shr edx, 8
mov ebx, dword [ebp - 0x38]
xor edx, dword [ebx + ecx*4]
mov ecx, edx
mov ebx, 0xff
and ecx, ebx
add ecx, edi
imul edi, ecx, 0x8088405
inc edi
mov ecx, edi
shr ecx, 0x18
mov dword [ebp - 0x3c], ecx
mov ebx, eax
mov ecx, 0xff
and ebx, ecx
xor ebx, dword [ebp - 0x3c]
mov dword [esi + 0xec], edx
mov dword [esi + 0xf0], edi
shr eax, 8
mov ecx, dword [ebp - 0x38]
xor eax, dword [ecx + ebx*4]
mov dword [esi + 0xf4], eax
mov ecx, dword [ebp - 0x34]
inc ecx
mov dword [ebp - 0x34], ecx
cmp ecx, 0xc
jne 0x5083da
mov eax, dword [esi + 0xe0]
add dword [eax + 0x40], 0xc
adc dword [eax + 0x44], 0
mov eax, dword [esi + 0xe0]
add dword [eax + 0x78], 0xfffffff4
adc dword [eax + 0x7c], 0xffffffff
mov dword [esi + 0xe4], 1
xor ebx, ebx
jmp 0x507f16
test ebx, ebx
jne 0x508263
cmp eax, 8
jne 0x508263
mov eax, edi
add eax, 4
xor ecx, ecx
mov dword [edi + 0x24], ecx
mov dword [edi + 0x28], ecx
mov dword [edi + 0x2c], ecx
mov dword [edi + 4], ecx
mov dword [edi + 8], ecx
push 0x38
push str.1.2.13
push 0xfffffffffffffff1
push eax
call fcn.00417ab0
add esp, 0x10
test eax, eax
je 0x5084cf
mov ebx, eax
push edi
call fcn.00464780
add esp, 4
jmp 0x507f16
mov dword [edi + 0x48], 8
jmp 0x508263