Function at 0x415700
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Hash data with crc32
Read file on windows

Disassembly:
sub esp, 0xc
push ebx
mov dword [edi + 0x74], ecx
mov ecx, dword [edi + 0x8c]
push ebp
push esi
mov dword [esp + 0xc], 0
cmp eax, ecx
jbe 0x41571d
mov eax, ecx
mov dword [edi + 0x78], eax
test eax, eax
je 0x415950
cmp dword [edi + 0x6c], 0
jne 0x415857
mov eax, dword [edi + 0x88]
test eax, eax
je 0x415857
mov ebp, 0x4000
cmp eax, ebp
jae 0x41574b
mov ebp, eax
test byte [edi], 1
mov edx, dword [edi + 0x64]
mov esi, ebp
jne 0x41577d
mov ecx, dword [edi + 4]
push 0
lea eax, [esp + 0x14]
push eax
push ebp
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x415777
mov dword [edi + 8], 7
mov dword [esp + 0x10], eax
mov esi, dword [esp + 0x10]
jmp 0x4157a1
mov ecx, dword [edi + 0x14]
mov eax, dword [edi + 0x10]
lea ebx, [ecx + ebp]
cmp ebx, eax
jbe 0x41578e
sub eax, ecx
mov esi, eax
mov eax, dword [edi + 4]
push esi
add eax, ecx
push eax
push edx
call fcn.0049b8f0
add esp, 0xc
add dword [edi + 0x14], esi
test esi, esi
je 0x41595b
sub dword [edi + 0x88], ebp
test byte [edi + 0x3c], 1
mov ecx, dword [edi + 0x64]
mov dword [edi + 0x68], ecx
mov dword [edi + 0x6c], ebp
je 0x415857
xor edx, edx
test ebp, ebp
je 0x415857
lea esp, [esp]
mov eax, dword [edi + 0x98]
mov ecx, dword [edi + 0x64]
lea esi, [edx + ecx]
and eax, 0xfffd
or eax, 2
mov ecx, eax
xor ecx, 1
imul ecx, eax
shr ecx, 8
xor byte [esi], cl
mov ecx, dword [edi + 0x64]
movsx ecx, byte [edx + ecx]
mov eax, dword [edi + 0x90]
xor ecx, eax
shr eax, 8
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x4a96d8]
xor ecx, eax
movzx eax, cl
add eax, dword [edi + 0x94]
mov dword [edi + 0x90], ecx
mov ecx, dword [edi + 0x98]
imul eax, eax, 0x8088405
inc eax
mov dword [edi + 0x94], eax
shr eax, 0x18
xor eax, ecx
and eax, 0xff
shr ecx, 8
xor ecx, dword [eax*4 + 0x4a96d8]
inc edx
mov dword [edi + 0x98], ecx
cmp edx, ebp
jb 0x4157d0
mov eax, dword [edi + 0x9c]
mov ecx, dword [edi + 0x6c]
cmp eax, ecx
jbe 0x415866
mov eax, ecx
test eax, eax
je 0x415895
mov edx, dword [edi + 0x68]
lea esi, [edx + eax]
mov dl, byte [esi - 1]
sub dword [edi + 0x8c], eax
sub ecx, eax
sub dword [edi + 0x9c], eax
mov dword [edi + 0x6c], ecx
mov dword [edi + 0x68], esi
jne 0x415895
cmp dl, byte [edi + 0xa0]
jne 0x41596b
cmp word [edi + 0x3e], 0
jne 0x4158f4
mov eax, dword [edi + 0x78]
mov esi, dword [edi + 0x6c]
cmp eax, esi
jae 0x4158a8
mov esi, eax
mov eax, dword [edi + 0x68]
mov ecx, dword [edi + 0x74]
push esi
push eax
push ecx
call fcn.0049b8f0
mov ebp, dword [edi + 0x74]
mov eax, dword [edi + 0x84]
add esp, 0xc
mov edx, esi
mov ecx, ebp
call fcn.00414ed0
sub dword [edi + 0x8c], esi
sub dword [edi + 0x6c], esi
sub dword [edi + 0x78], esi
add dword [edi + 0x68], esi
add dword [edi + 0x7c], esi
add ebp, esi
add dword [esp + 0xc], esi
mov dword [edi + 0x84], eax
mov eax, dword [edi + 0x8c]
mov dword [edi + 0x74], ebp
jmp 0x415942
mov edx, dword [edi + 0x74]
mov ebx, dword [edi + 0x7c]
lea esi, [edi + 0x68]
mov dword [esp + 0x14], edx
call fcn.00414fc0
mov ebp, eax
test ebp, ebp
je 0x415911
cmp ebp, 1
jne 0x41597b
mov esi, dword [edi + 0x7c]
mov ecx, dword [esp + 0x14]
mov eax, dword [edi + 0x84]
sub esi, ebx
mov edx, esi
call fcn.00414ed0
sub dword [edi + 0x8c], esi
add dword [esp + 0xc], esi
mov dword [edi + 0x84], eax
mov eax, dword [edi + 0x8c]
cmp ebp, 1
je 0x415950
test eax, eax
je 0x415950
cmp dword [edi + 0x78], 0
jne 0x415728
mov eax, dword [esp + 0xc]
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov dword [edi + 8], 7
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov dword [edi + 8], 0x13
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
pop esi
pop ebp
mov dword [edi + 8], 0x12
xor eax, eax
pop ebx
add esp, 0xc
ret