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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x412004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, edx
mov dword [ebp - 0x24], eax
xor edx, edx
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], edx
test eax, eax
je 0x4048e9
mov byte [eax], dl
test ecx, ecx
je 0x404bc8
mov esi, dword [ecx + 0x54]
test esi, esi
je 0x404bc8
cmp dword [esi], edx
jne 0x404916
mov eax, 0xffffff9c
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405955
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
test eax, eax
je 0x404bb5
mov ecx, dword [esi + 0x5c]
mov dword [esi + 0x10], edi
mov dword [esi + 0x14], eax
cmp eax, ecx
jbe 0x404933
mov dword [esi + 0x14], ecx
mov eax, ecx
test eax, eax
je 0x404ba2
lea eax, [esi + 4]
mov ecx, eax
cmp dword [esi + 8], 0
mov dword [ebp - 0xc], ecx
jne 0x404a4f
mov edx, dword [esi + 0x58]
mov ecx, eax
mov dword [ebp - 0xc], ecx
test edx, edx
je 0x404a4f
mov ecx, dword [esi + 0x68]
mov eax, 0x4000
cmp edx, eax
push 0
cmovb eax, edx
mov edx, dword [esi + 0x60]
add ecx, dword [esi + 0x3c]
push 0
push 0
mov dword [ebp - 8], eax
mov eax, dword [edx]
push ecx
push edx
call dword [eax + 0x14]
test eax, eax
jne 0x404b57
mov eax, dword [esi + 0x60]
lea edx, [ebp - 8]
push edx
push dword [ebp - 8]
push dword [esi]
mov ecx, dword [eax]
push eax
call dword [ecx + 0xc]
test eax, eax
jne 0x404b57
mov ecx, dword [esi]
mov eax, dword [ebp - 8]
add dword [esi + 0x3c], eax
sub dword [esi + 0x58], eax
cmp byte [esi + 0x6c], 0
mov dword [ebp - 0x20], ecx
mov dword [esi + 4], ecx
lea ecx, [esi + 4]
mov dword [esi + 8], eax
mov dword [ebp - 0xc], ecx
je 0x404a4f
mov dword [ebp - 0x1c], 0
lea ecx, [esi + 4]
mov dword [ebp - 0xc], ecx
test eax, eax
je 0x404a4f
mov ebx, dword [ebp - 0x1c]
nop word [eax + eax]
mov edi, dword [esi + 0x78]
mov eax, edi
mov ecx, dword [esi + 0x70]
and eax, 0xfffd
or eax, 2
mov edx, eax
xor edx, 1
imul edx, eax
mov eax, dword [ebp - 0x20]
shr edx, 8
xor dl, byte [ebx + eax]
movsx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [eax*4 + 0x40ec00]
movzx eax, cl
add eax, dword [esi + 0x74]
imul eax, eax, 0x8088405
mov dword [esi + 0x70], ecx
inc eax
mov dword [esi + 0x74], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x40ec00]
mov eax, dword [ebp - 0x20]
mov dword [esi + 0x78], edi
mov byte [ebx + eax], dl
inc ebx
cmp ebx, dword [ebp - 8]
jb 0x4049e0
lea ebx, [esi + 4]
mov ecx, ebx
mov dword [ebp - 0xc], ebx
mov ebx, dword [esi + 0x7c]
mov edx, dword [esi + 8]
cmp ebx, edx
mov edi, edx
cmovbe edi, ebx
test edi, edi
je 0x404a8e
mov eax, dword [ecx]
sub edx, edi
mov cl, byte [eax + edi - 1]
add eax, edi
sub dword [esi + 0x5c], edi
sub ebx, edi
mov byte [ebp - 0xd], cl
mov ecx, dword [ebp - 0xc]
mov dword [esi + 8], edx
mov dword [esi + 0x7c], ebx
mov dword [ecx], eax
jne 0x404a8e
mov al, byte [ebp - 0xd]
cmp al, byte [esi + 0x80]
jne 0x404b6b
cmp dword [esi + 0x64], 0
jne 0x404afd
mov ebx, dword [esi + 0x14]
cmp ebx, edx
cmovae ebx, edx
xor edx, edx
test ebx, ebx
je 0x404ab5
mov eax, dword [ecx]
mov ecx, dword [esi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
mov ecx, dword [ebp - 0xc]
cmp edx, ebx
jb 0x404aa2
mov edi, dword [esi + 0x10]
mov edx, edi
mov ecx, dword [esi + 0x50]
push ebx
call fcn.00403680
mov ecx, dword [ebp - 0xc]
add esp, 4
mov edx, dword [ebp - 0x14]
sub dword [esi + 0x5c], ebx
add edx, ebx
sub dword [esi + 8], ebx
sub dword [esi + 0x14], ebx
add dword [ecx], ebx
add dword [esi + 0x18], ebx
cmp dword [esi + 0x5c], 0
mov dword [esi + 0x50], eax
lea eax, [edi + ebx]
mov dword [esi + 0x10], eax
mov dword [ebp - 0x14], edx
jne 0x404af8
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x404af8
mov byte [eax], 1
mov ebx, dword [ebp - 0x18]
jmp 0x404b49
mov edi, dword [esi + 0x18]
mov ebx, dword [esi + 0x10]
call fcn.00403bc0
mov ecx, dword [esi + 0x50]
mov edx, ebx
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x18]
sub eax, edi
push eax
mov dword [ebp - 0x1c], eax
call fcn.00403680
mov ecx, dword [esi + 0x5c]
add esp, 4
mov edx, dword [ebp - 0x14]
sub ecx, dword [ebp - 0x1c]
add edx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x18]
mov dword [esi + 0x50], eax
mov dword [esi + 0x5c], ecx
mov dword [ebp - 0x14], edx
cmp ebx, 1
je 0x404b98
test ecx, ecx
je 0x404b98
mov ecx, dword [ebp - 0xc]
test ebx, ebx
jne 0x404b85
cmp dword [esi + 0x14], 0
jbe 0x404b81
lea eax, [esi + 4]
jmp 0x404940
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405955
mov esp, ebp
pop ebp
ret
mov eax, 0xffffff96
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405955
mov esp, ebp
pop ebp
ret
test ebx, ebx
je 0x404ba2
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405955
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x404ba2
mov byte [eax], 1
mov eax, edx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405955
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405955
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 0xffffff9a
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00405955
mov esp, ebp
pop ebp
ret