Function at 0x405700
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Hash data with crc32
Resolve function by parsing pe exports

Disassembly:
push ecx
mov eax, dword [esp + 0xc]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x18]
mov ecx, dword [edi + 0x8c]
mov dword [edi + 0x74], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x10], 0
cmp eax, ecx
jbe 0x405728
mov eax, ecx
mov dword [edi + 0x78], eax
test eax, eax
je 0x405915
cmp dword [edi + 0x6c], 0
jne 0x405817
mov eax, dword [edi + 0x88]
test eax, eax
je 0x405817
mov ebp, 0x4000
cmp eax, ebp
jae 0x405756
mov ebp, eax
mov edx, dword [edi + 0x64]
mov eax, ebp
mov esi, edi
call fcn.00402fb0
test eax, eax
je 0x40591f
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 0x405817
xor edx, edx
test ebp, ebp
jbe 0x405817
lea ecx, [ecx]
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 + 0x547068]
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 + 0x547068]
inc edx
mov dword [edi + 0x98], ecx
cmp edx, ebp
jb 0x405790
mov eax, dword [edi + 0x9c]
mov ecx, dword [edi + 0x6c]
cmp eax, ecx
jbe 0x405826
mov eax, ecx
test eax, eax
je 0x405855
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 0x405855
cmp dl, byte [edi + 0xa0]
jne 0x40592e
cmp word [edi + 0x3e], 0
jne 0x4058b4
mov eax, dword [edi + 0x78]
mov esi, dword [edi + 0x6c]
cmp eax, esi
jae 0x405868
mov esi, eax
mov eax, dword [edi + 0x68]
mov ecx, dword [edi + 0x74]
push esi
push eax
push ecx
call fcn.0051a400
mov ebp, dword [edi + 0x74]
mov eax, dword [edi + 0x84]
add esp, 0xc
mov edx, esi
mov ecx, ebp
call fcn.00402eb0
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 + 0x10], esi
mov dword [edi + 0x84], eax
mov eax, dword [edi + 0x8c]
mov dword [edi + 0x74], ebp
jmp 0x405907
mov edx, dword [edi + 0x74]
mov ebx, dword [edi + 0x7c]
push 2
lea esi, [edi + 0x68]
mov dword [esp + 0x1c], edx
call fcn.004053c0
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x4058d6
cmp ebp, 1
jne 0x40593d
mov esi, dword [edi + 0x7c]
mov ecx, dword [esp + 0x18]
mov eax, dword [edi + 0x84]
sub esi, ebx
mov edx, esi
call fcn.00402eb0
sub dword [edi + 0x8c], esi
add dword [esp + 0x10], esi
mov dword [edi + 0x84], eax
mov eax, dword [edi + 0x8c]
cmp ebp, 1
je 0x405915
test eax, eax
je 0x405915
cmp dword [edi + 0x78], 0
jne 0x405733
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
mov dword [edi + 8], 7
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
mov dword [edi + 8], 0x13
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
mov dword [edi + 8], 0x12
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret