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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov eax, edx
xor ebx, ebx
mov edx, ecx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], edx
push esi
push edi
mov edi, dword [ebp + 8]
test edx, edx
je 0x10124075
mov esi, dword [edx + 0x9c]
test esi, esi
je 0x10124075
cmp dword [esi], ebx
jne 0x10123dcc
pop edi
pop esi
lea eax, [ebx - 0x64]
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [esi + 0x10], eax
mov edx, edi
mov eax, dword [esi + 0x5c]
mov dword [esi + 0x14], edi
cmp edi, eax
jbe 0x10123de8
cmp dword [esi + 0x8c], ebx
jne 0x10123de8
mov dword [esi + 0x14], eax
mov edx, eax
mov eax, dword [esi + 8]
add eax, dword [esi + 0x58]
cmp edi, eax
jbe 0x10123dff
cmp dword [esi + 0x8c], ebx
je 0x10123dff
mov dword [esi + 0x14], eax
mov edx, eax
test edx, edx
je 0x10123fd1
nop word [eax + eax]
mov ebx, dword [esi + 8]
test ebx, ebx
jne 0x10123f3f
mov eax, dword [esi + 0x58]
test eax, eax
je 0x10123f3f
mov edi, dword [esi + 0x70]
mov ebx, 0x4000
cmp eax, ebx
mov ecx, edi
push 0
cmovb ebx, eax
mov eax, dword [esi + 0x88]
add eax, dword [esi + 0x3c]
push eax
push dword [esi + 0x80]
mov dword [ebp - 0x10], ebx
push dword [esi + 0x7c]
call dword [0x1019a4f8]
call edi
add esp, 0x10
test eax, eax
jne 0x10124058
mov edi, dword [esi + 0x64]
mov ecx, edi
push ebx
push dword [esi]
push dword [esi + 0x80]
push dword [esi + 0x7c]
call dword [0x1019a4f8]
call edi
add esp, 0x10
cmp eax, ebx
jne 0x10124058
mov edx, dword [ebp - 8]
cmp dword [edx + 0xa0], 0
je 0x10123f31
xor edi, edi
mov dword [ebp - 0xc], edi
test ebx, ebx
je 0x10123f31
mov ecx, dword [edx + 0xac]
mov eax, dword [esi]
and ecx, 0xfffd
or ecx, 2
mov ebx, ecx
xor ebx, 1
imul ebx, ecx
shr ebx, 8
xor bl, byte [eax + edi]
mov byte [eax + edi], bl
mov edi, dword [edx + 0xb0]
mov edx, dword [edx + 0xa4]
mov eax, edx
movsx ecx, bl
xor eax, ecx
shr edx, 8
movzx eax, al
mov eax, dword [edi + eax*4]
xor eax, edx
mov edx, dword [ebp - 8]
mov ecx, dword [edx + 0xac]
mov dword [edx + 0xa4], eax
movzx eax, al
add eax, dword [edx + 0xa8]
imul eax, eax, 0x8088405
inc eax
mov dword [edx + 0xa8], eax
shr eax, 0x18
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [edi + eax*4]
mov edi, dword [ebp - 0xc]
mov dword [edx + 0xac], ecx
mov eax, dword [esi]
mov byte [edi + eax], bl
inc edi
mov ebx, dword [ebp - 0x10]
mov dword [ebp - 0xc], edi
cmp edi, ebx
jb 0x10123ea1
add dword [esi + 0x3c], ebx
mov eax, dword [esi]
sub dword [esi + 0x58], ebx
mov dword [esi + 4], eax
mov dword [esi + 8], ebx
mov eax, dword [esi + 0x84]
test eax, eax
je 0x10123fda
cmp dword [esi + 0x8c], 0
jne 0x10123fda
cmp eax, 0xc
je 0x10123fc4
mov eax, dword [esi + 0x18]
lea ecx, [esi + 4]
mov dword [ebp - 0x10], eax
mov edx, 2
mov eax, dword [esi + 0x10]
mov dword [ebp - 0xc], eax
call fcn.101248d0
mov edi, eax
test edi, edi
js 0x10123f8a
cmp dword [esi + 0x1c], 0
mov eax, 0xfffffffd
cmovne edi, eax
mov ebx, dword [esi + 0x18]
sub ebx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x10123fa5
mov ecx, dword [esi + 0x50]
mov edx, eax
push ebx
call fcn.10128e60
add esp, 4
sub dword [esi + 0x5c], ebx
mov dword [esi + 0x50], eax
mov eax, dword [ebp - 4]
add eax, ebx
mov dword [ebp - 4], eax
cmp edi, 1
je 0x1012407a
test edi, edi
jne 0x10124062
mov ebx, dword [ebp - 4]
cmp dword [esi + 0x14], 0
ja 0x10123e10
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
test ebx, ebx
jne 0x10123fe7
cmp dword [esi + 0x58], ebx
je 0x1012406b
mov eax, dword [esi + 0x14]
cmp eax, ebx
mov edi, eax
mov dword [ebp - 0xc], eax
cmovae edi, ebx
xor edx, edx
test edi, edi
je 0x1012401a
nop word [eax + 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, edi
jb 0x10124000
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 8]
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0x10]
test eax, eax
je 0x1012402f
mov ecx, dword [esi + 0x50]
mov edx, eax
push edi
call fcn.10128e60
add esp, 4
sub dword [esi + 0x5c], edi
sub ebx, edi
add dword [esi + 0x10], edi
add dword [esi + 4], edi
add dword [esi + 0x18], edi
mov dword [esi + 0x50], eax
mov eax, dword [ebp - 0xc]
mov dword [esi + 8], ebx
sub eax, edi
mov ebx, dword [ebp - 4]
add ebx, edi
mov dword [esi + 0x14], eax
mov dword [ebp - 4], ebx
jmp 0x10123fc7
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0xffffff9a
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret