Function at 0x671750
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 0x671a35
mov esi, dword [edx + 0x9c]
test esi, esi
je 0x671a35
cmp dword [esi], ebx
jne 0x67178c
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 0x6717a8
cmp dword [esi + 0x8c], ebx
jne 0x6717a8
mov dword [esi + 0x14], eax
mov edx, eax
mov eax, dword [esi + 8]
add eax, dword [esi + 0x58]
cmp edi, eax
jbe 0x6717bf
cmp dword [esi + 0x8c], ebx
je 0x6717bf
mov dword [esi + 0x14], eax
mov edx, eax
test edx, edx
je 0x671991
nop word [eax + eax]
mov ebx, dword [esi + 8]
test ebx, ebx
jne 0x6718ff
mov eax, dword [esi + 0x58]
test eax, eax
je 0x6718ff
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 [0x747368]
call edi
add esp, 0x10
test eax, eax
jne 0x671a18
mov edi, dword [esi + 0x64]
mov ecx, edi
push ebx
push dword [esi]
push dword [esi + 0x80]
push dword [esi + 0x7c]
call dword [0x747368]
call edi
add esp, 0x10
cmp eax, ebx
jne 0x671a18
mov edx, dword [ebp - 8]
cmp dword [edx + 0xa0], 0
je 0x6718f1
xor edi, edi
mov dword [ebp - 0xc], edi
test ebx, ebx
je 0x6718f1
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 0x671861
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 0x67199a
cmp dword [esi + 0x8c], 0
jne 0x67199a
cmp eax, 0xc
je 0x671984
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.00643850
mov edi, eax
test edi, edi
js 0x67194a
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 0x671965
mov ecx, dword [esi + 0x50]
mov edx, eax
push ebx
call fcn.0064ef40
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 0x671a3a
test edi, edi
jne 0x671a22
mov ebx, dword [ebp - 4]
cmp dword [esi + 0x14], 0
ja 0x6717d0
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
test ebx, ebx
jne 0x6719a7
cmp dword [esi + 0x58], ebx
je 0x671a2b
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 0x6719da
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 0x6719c0
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 8]
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0x10]
test eax, eax
je 0x6719ef
mov ecx, dword [esi + 0x50]
mov edx, eax
push edi
call fcn.0064ef40
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 0x671987
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