Function at 0x41fa60
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Hash data with crc32

Disassembly:
sub esp, 0x14
mov edx, dword [esp + 0x20]
xor eax, eax
mov dword [esp + 4], eax
mov dword [esp + 8], eax
mov eax, dword [esp + 0x18]
push ebx
mov dword [edi + 0xb8], eax
mov eax, dword [edi + 0xec]
push ebp
push esi
mov esi, dword [edi + 0xe8]
cmp edx, eax
jb 0x41fa9e
ja 0x41fa98
mov ecx, dword [esp + 0x28]
cmp ecx, esi
jbe 0x41faa2
mov ecx, esi
mov edx, eax
jmp 0x41faa2
mov ecx, dword [esp + 0x28]
mov dword [edi + 0xc0], ecx
or ecx, edx
mov dword [edi + 0xc4], edx
je 0x41fdbc
mov ecx, dword [edi + 0xa8]
or ecx, dword [edi + 0xac]
jne 0x41fbe9
mov ecx, dword [edi + 0xe0]
mov eax, dword [edi + 0xe4]
mov edx, ecx
or edx, eax
je 0x41fbe9
xor ebp, ebp
mov ebx, 0x4000
test eax, eax
ja 0x41faf3
jb 0x41faef
cmp ecx, ebx
jae 0x41faf3
mov ebx, ecx
mov ebp, eax
mov edx, dword [edi + 0x98]
mov eax, ebx
mov esi, edi
call fcn.0041ef20
test eax, eax
je 0x41fdcb
sub dword [edi + 0xe0], ebx
mov eax, dword [edi + 0x98]
mov dword [edi + 0xa0], eax
sbb dword [edi + 0xe4], ebp
test byte [edi + 0x54], 1
mov dword [edi + 0xa8], ebx
mov dword [edi + 0xac], ebp
je 0x41fbe9
xor edx, edx
test ebp, ebp
jb 0x41fbe9
ja 0x41fb50
test ebx, ebx
je 0x41fbe9
lea esp, [esp]
mov eax, dword [edi + 0xf8]
mov ecx, dword [edi + 0x98]
and eax, 0xfffd
lea esi, [edx + ecx]
or eax, 2
mov ecx, eax
xor ecx, 1
imul ecx, eax
shr ecx, 8
xor byte [esi], cl
mov ecx, dword [edi + 0x98]
movsx ecx, byte [edx + ecx]
mov eax, dword [edi + 0xf0]
xor ecx, eax
shr eax, 8
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x4d0b98]
xor ecx, eax
movzx eax, cl
add eax, dword [edi + 0xf4]
mov dword [edi + 0xf0], ecx
mov ecx, dword [edi + 0xf8]
imul eax, eax, 0x8088405
inc eax
mov dword [edi + 0xf4], eax
shr eax, 0x18
xor eax, ecx
and eax, 0xff
shr ecx, 8
xor ecx, dword [eax*4 + 0x4d0b98]
xor eax, eax
inc edx
mov dword [edi + 0xf8], ecx
cmp eax, ebp
jb 0x41fb50
ja 0x41fbe9
cmp edx, ebx
jb 0x41fb50
mov ebp, dword [edi + 0x104]
mov eax, dword [edi + 0xac]
mov edx, dword [edi + 0x100]
mov esi, dword [edi + 0xa8]
mov dword [esp + 0x1c], ebp
mov ecx, edx
cmp ebp, eax
jb 0x41fc15
ja 0x41fc11
cmp ecx, esi
jbe 0x41fc15
mov ecx, esi
mov ebp, eax
mov ebx, ecx
or ebx, ebp
je 0x41fc6a
mov ebx, dword [edi + 0xa0]
add ebx, ecx
sub esi, ecx
sbb eax, ebp
mov dword [esp + 0x24], ebx
mov bl, byte [ebx - 1]
mov dword [edi + 0xac], eax
mov eax, dword [esp + 0x24]
sub edx, ecx
mov dword [edi + 0xa0], eax
mov eax, dword [esp + 0x1c]
sbb eax, ebp
mov ecx, edx
or ecx, eax
mov dword [edi + 0xa8], esi
mov dword [edi + 0x100], edx
mov dword [edi + 0x104], eax
jne 0x41fc6a
cmp bl, byte [edi + 0x108]
jne 0x41fddd
cmp word [edi + 0x56], 0
jne 0x41fd24
mov eax, dword [edi + 0xc4]
mov ebp, dword [edi + 0xac]
mov ecx, dword [edi + 0xc0]
mov esi, dword [edi + 0xa8]
cmp eax, ebp
ja 0x41fc9b
jb 0x41fc97
cmp ecx, esi
jae 0x41fc9b
mov esi, ecx
mov ebp, eax
mov edx, dword [edi + 0xa0]
mov eax, dword [edi + 0xb8]
push esi
push edx
push eax
call sub.MSVCR100.dll_memcpy
mov ebx, dword [edi + 0xb8]
mov eax, dword [edi + 0xd8]
add esp, 0xc
mov edx, esi
mov ecx, ebx
call fcn.0041ea40
sub dword [edi + 0xe8], esi
mov ecx, dword [edi + 0xe8]
mov dword [edi + 0xd8], eax
sbb dword [edi + 0xec], ebp
sub dword [edi + 0xa8], esi
sbb dword [edi + 0xac], ebp
sub dword [edi + 0xc0], esi
sbb dword [edi + 0xc4], ebp
add dword [edi + 0xa0], esi
add ebx, esi
add dword [edi + 0xc8], esi
mov dword [edi + 0xb8], ebx
adc dword [edi + 0xcc], ebp
add dword [esp + 0x10], esi
adc dword [esp + 0x14], ebp
or ecx, dword [edi + 0xec]
jmp 0x41fda8
mov edx, dword [edi + 0xb8]
mov ebp, dword [edi + 0xc8]
mov ebx, dword [edi + 0xcc]
lea esi, [edi + 0xa0]
mov dword [esp + 0x24], edx
call fcn.0041eb30
mov dword [esp + 0x28], eax
test eax, eax
je 0x41fd56
cmp eax, 1
jne 0x41fdef
mov esi, dword [edi + 0xc8]
mov ecx, dword [edi + 0xcc]
mov eax, dword [edi + 0xd8]
sub esi, ebp
sbb ecx, ebx
mov ebp, ecx
mov ecx, dword [esp + 0x24]
mov edx, esi
call fcn.0041ea40
sub dword [edi + 0xe8], esi
mov dword [edi + 0xd8], eax
mov eax, ebp
sbb dword [edi + 0xec], eax
add dword [esp + 0x10], esi
adc dword [esp + 0x14], ebp
cmp dword [esp + 0x28], 1
je 0x41fdbc
mov eax, dword [edi + 0xe8]
or eax, dword [edi + 0xec]
je 0x41fdbc
mov ecx, dword [edi + 0xc0]
or ecx, dword [edi + 0xc4]
jne 0x41fab6
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
xor eax, eax
mov dword [edi + 8], 7
xor edx, edx
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
xor eax, eax
mov dword [edi + 8], 0x13
xor edx, edx
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
pop esi
pop ebp
xor eax, eax
mov dword [edi + 8], 0x12
xor edx, edx
pop ebx
add esp, 0x14
ret