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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5ac
mov eax, dword [0x43b050]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push esi
xor esi, esi
push edi
mov dword [ebp - 0x5a4], eax
cmp dword [ebx + 0x14], esi
je 0x40bf8c
mov eax, 0x40000
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
cmp byte [ebx + 0x2c], 0
je 0x40bfa9
mov eax, 0x50000
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
mov dword [ebp - 0x5ac], esi
cmp dword [ebx], esi
je 0x40bfbd
mov dword [ebp - 0x5ac], 0xc
push 0x5c
push eax
call fcn.00420596
add esp, 8
cmp eax, esi
jne 0x40bfe3
mov eax, 0x10000
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
add eax, 2
lea edx, [ebp - 0x23c]
sub edx, eax
mov edi, edi
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
cmp cx, si
jne 0x40bff0
lea eax, [ebp - 0x23c]
cmp word [ebp - 0x23c], si
je 0x40c026
mov edi, edi
cmp word [eax], 0x5c
jne 0x40c01e
mov ecx, 0x2f
mov word [eax], cx
add eax, 2
cmp word [eax], si
jne 0x40c010
mov edi, 8
lea edx, [ebp - 0x23c]
mov dword [ebp - 0x5a8], edi
call fcn.0040b510
test al, al
je 0x40c048
mov dword [ebp - 0x5a8], esi
mov edi, esi
mov eax, dword [ebp - 0x5a4]
mov ecx, ebx
call fcn.0040bb00
cmp eax, esi
jne 0x40c767
push esi
push esi
push 0x104
lea edx, [ebp - 0x454]
push edx
push 0xffffffffffffffff
lea eax, [ebp - 0x23c]
push eax
push esi
push 0xfde9
mov dword [ebp - 0x240], esi
mov byte [ebp - 0x564], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea eax, [ebp - 0x454]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c096
sub eax, edx
mov dword [ebp - 0x584], eax
mov byte [ebp - 0x350], cl
xor ecx, ecx
mov eax, 0x14
mov word [ebp - 0x572], cx
mov ecx, dword [ebx + 0x68]
mov word [ebp - 0x59a], ax
mov edx, 0xb17
mov eax, 8
mov dword [ebp - 0x458], esi
mov dword [ebp - 0x578], esi
mov dword [ebp - 0x24c], 1
mov dword [ebp - 0x244], esi
mov word [ebp - 0x59c], dx
mov dword [ebp - 0x594], ecx
mov dword [ebp - 0x590], esi
mov word [ebp - 0x598], ax
cmp dword [ebx], esi
je 0x40c113
mov eax, 9
mov word [ebp - 0x598], ax
mov word [ebp - 0x570], ax
mov word [ebp - 0x596], di
cmp edi, esi
jne 0x40c13c
mov eax, dword [ebx + 0x70]
cmp eax, esi
jl 0x40c13c
mov edx, dword [ebp - 0x5ac]
add eax, edx
mov dword [ebp - 0x58c], eax
jmp 0x40c142
mov dword [ebp - 0x58c], esi
mov eax, dword [ebx + 0x70]
mov edx, dword [ebx + 0x4c]
mov esi, dword [ebx + 0x58]
mov edi, dword [ebx + 0x5c]
mov dword [ebp - 0x588], eax
mov eax, dword [ebx + 0x18]
add eax, dword [ebx + 0x10]
xor ecx, ecx
mov word [ebp - 0x574], cx
mov dword [ebp - 0x56c], edx
mov dword [ebp - 0x568], eax
mov al, byte [ebx + 0x58]
lea ecx, [ebp - 0x28]
lea edx, [ebp - 0x34]
mov dword [ebp - 0x460], ecx
mov dword [ebp - 0x45c], edx
mov byte [ebp - 0x23], al
mov eax, esi
mov edx, edi
mov cl, 8
mov dword [ebp - 0x580], 0x11
mov dword [ebp - 0x57c], 9
mov byte [ebp - 0x28], 0x55
mov byte [ebp - 0x27], 0x54
mov byte [ebp - 0x26], 0xd
mov byte [ebp - 0x25], 0
mov byte [ebp - 0x24], 7
call fcn.00421eb0
mov byte [ebp - 0x22], al
mov eax, esi
mov edx, edi
mov cl, 0x10
call fcn.00421eb0
mov byte [ebp - 0x21], al
mov eax, esi
mov edx, edi
mov cl, 0x18
call fcn.00421eb0
mov cl, byte [ebx + 0x50]
mov esi, dword [ebx + 0x50]
mov edi, dword [ebx + 0x54]
mov byte [ebp - 0x20], al
mov byte [ebp - 0x1f], cl
mov eax, esi
mov edx, edi
mov cl, 8
call fcn.00421eb0
mov byte [ebp - 0x1e], al
mov eax, esi
mov edx, edi
mov cl, 0x10
call fcn.00421eb0
mov byte [ebp - 0x1d], al
mov eax, esi
mov edx, edi
mov cl, 0x18
call fcn.00421eb0
movzx edx, byte [ebx + 0x60]
mov esi, dword [ebx + 0x60]
mov edi, dword [ebx + 0x64]
mov byte [ebp - 0x1c], al
mov byte [ebp - 0x1b], dl
mov eax, esi
mov edx, edi
mov cl, 8
call fcn.00421eb0
mov byte [ebp - 0x1a], al
mov eax, esi
mov edx, edi
mov cl, 0x10
call fcn.00421eb0
mov byte [ebp - 0x19], al
mov eax, esi
mov edx, edi
mov cl, 0x18
call fcn.00421eb0
mov ecx, dword [ebp - 0x24]
mov byte [ebp - 0x18], al
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], ecx
movzx edx, byte [ebp - 0x20]
mov esi, ebx
lea edi, [ebp - 0x59c]
mov byte [ebp - 0x2c], dl
mov byte [ebp - 0x32], 5
call fcn.0040aa20
test eax, eax
je 0x40c28a
call fcn.0040bd70
mov eax, 0x400
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
mov eax, dword [ebp - 0x580]
mov ecx, dword [ebp - 0x584]
lea edx, [eax + ecx + 0x1e]
add dword [ebx + 0x18], edx
cmp dword [ebx + 0x14], 0
je 0x40c2bd
call fcn.0040bd70
mov eax, dword [ebx + 0x14]
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
mov edi, dword [ebx]
lea esi, [ebx + 0x30]
mov dword [esi], 0x12345678
mov dword [ebx + 0x34], 0x23456789
mov dword [ebx + 0x38], 0x34567890
test edi, edi
je 0x40c2ec
mov cl, byte [edi]
test cl, cl
je 0x40c2ec
mov edx, esi
call fcn.0040b4c0
add edi, 1
jne 0x40c2da
cmp byte [0x43f5d8], 0
jne 0x40c304
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.00421628
add esp, 4
xor edi, edi
call fcn.0042163a
sar eax, 7
mov byte [ebp + edi - 0x14], al
inc edi
cmp edi, 0xc
jl 0x40c306
mov eax, dword [ebp - 0x594]
shr eax, 8
mov byte [ebp - 9], al
mov dword [ebp - 0x5a4], 0
mov ecx, dword [ebp - 0x5a4]
mov cl, byte [ebp + ecx - 0x14]
movsx ecx, cl
mov edi, dword [esi]
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x436290]
mov dword [ebp - 0x5a0], ecx
mov eax, dword [esi + 8]
shr edi, 8
xor dword [ebp - 0x5a0], edi
mov ecx, dword [ebp - 0x5a0]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edx, eax
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
and edx, 0xfffd
or edx, 2
shr eax, 8
xor eax, dword [ecx*4 + 0x436290]
mov edi, dword [esi]
mov ecx, edx
xor ecx, 1
imul ecx, edx
shr ecx, 8
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x5a4]
xor cl, byte [ebp + eax - 0x14]
mov byte [ebp + eax - 0x14], cl
mov cl, byte [ebp + eax - 0x13]
movsx ecx, cl
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x436290]
mov dword [ebp - 0x5a0], ecx
mov eax, dword [esi + 8]
shr edi, 8
xor dword [ebp - 0x5a0], edi
mov ecx, dword [ebp - 0x5a0]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edx, eax
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
and edx, 0xfffd
mov edi, dword [esi]
or edx, 2
shr eax, 8
xor eax, dword [ecx*4 + 0x436290]
mov ecx, edx
xor ecx, 1
imul ecx, edx
shr ecx, 8
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x5a4]
xor cl, byte [ebp + eax - 0x13]
mov byte [ebp + eax - 0x13], cl
mov cl, byte [ebp + eax - 0x12]
mov eax, dword [esi + 8]
movsx ecx, cl
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x436290]
mov edx, eax
and edx, 0xfffd
mov dword [ebp - 0x5a0], ecx
shr edi, 8
or edx, 2
xor dword [ebp - 0x5a0], edi
mov ecx, dword [ebp - 0x5a0]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edi, dword [esi]
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
shr eax, 8
xor eax, dword [ecx*4 + 0x436290]
mov ecx, edx
xor ecx, 1
imul ecx, edx
shr ecx, 8
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x5a4]
xor cl, byte [ebp + eax - 0x12]
mov byte [ebp + eax - 0x12], cl
mov cl, byte [ebp + eax - 0x11]
movsx ecx, cl
xor ecx, edi
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x436290]
mov dword [ebp - 0x5a0], ecx
mov eax, dword [esi + 8]
shr edi, 8
xor dword [ebp - 0x5a0], edi
mov ecx, dword [ebp - 0x5a0]
mov dword [esi], ecx
movzx ecx, cl
add ecx, dword [esi + 4]
mov edx, eax
imul ecx, ecx, 0x8088405
inc ecx
mov dword [esi + 4], ecx
shr ecx, 0x18
xor ecx, eax
and ecx, 0xff
shr eax, 8
xor eax, dword [ecx*4 + 0x436290]
and edx, 0xfffd
or edx, 2
mov ecx, edx
xor ecx, 1
imul ecx, edx
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x5a4]
shr ecx, 8
xor cl, byte [ebp + eax - 0x11]
add eax, 4
cmp eax, 0xc
mov byte [ebp + eax - 0x15], cl
mov dword [ebp - 0x5a4], eax
jl 0x40c32e
cmp dword [ebx], 0
je 0x40c554
push 0xc
lea edx, [ebp - 0x14]
push edx
mov ecx, ebx
call fcn.0040b8e0
add dword [ebx + 0x18], 0xc
mov edx, dword [ebp - 0x5a8]
xor esi, esi
xor eax, eax
cmp dword [ebx], esi
setne al
mov byte [ebx + 0x2d], al
cmp edx, 8
jne 0x40c57b
lea eax, [ebp - 0x59c]
push eax
mov edi, ebx
call fcn.0040bdd0
jmp 0x40c586
test edx, edx
jne 0x40c58e
mov edi, ebx
call fcn.0040bee0
mov edx, dword [ebp - 0x5a8]
mov esi, eax
cmp byte [ebx + 0x80], 0
mov byte [ebx + 0x2d], 0
je 0x40c5af
mov eax, dword [ebx + 0x7c]
test eax, eax
je 0x40c5af
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x5a8]
mov ecx, dword [ebx + 0x90]
mov eax, dword [ebx + 0x14]
mov edi, dword [ebx + 0x74]
add dword [ebx + 0x18], ecx
mov dword [ebx + 0x7c], 0
mov dword [ebx + 0x70], edi
test eax, eax
jne 0x40c767
test esi, esi
jne 0x40c273
mov eax, dword [ebp - 0x5ac]
mov esi, dword [ebx + 0x78]
add eax, ecx
cmp dword [ebp - 0x58c], eax
mov dword [ebp - 0x590], esi
sete cl
cmp byte [ebx + 0x1c], 0
mov dword [ebp - 0x58c], eax
mov dword [ebp - 0x588], edi
je 0x40c681
cmp dword [ebx], 0
jne 0x40c681
test byte [ebp - 0x598], 1
mov word [ebp - 0x596], dx
jne 0x40c625
mov ecx, 0xfff7
and word [ebp - 0x598], cx
mov dx, word [ebp - 0x598]
mov word [ebp - 0x570], dx
mov edx, dword [ebp - 0x568]
sub edx, dword [ebx + 0x10]
mov eax, ebx
call fcn.0040ba40
test al, al
je 0x40c66a
mov esi, ebx
lea edi, [ebp - 0x59c]
call fcn.0040aa20
test eax, eax
jne 0x40c273
mov edx, dword [ebx + 0x18]
mov eax, ebx
call fcn.0040ba40
test al, al
jne 0x40c6d0
mov eax, 0x2000000
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
cmp word [ebp - 0x596], dx
je 0x40c6a1
mov eax, 0x4000000
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
test edx, edx
jne 0x40c6a9
test cl, cl
je 0x40c68a
mov esi, ebx
lea edi, [ebp - 0x59c]
call fcn.0040acc0
test eax, eax
jne 0x40c273
mov ax, word [ebp - 0x570]
add dword [ebx + 0x18], 0x10
mov word [ebp - 0x598], ax
mov eax, dword [ebx + 0x14]
test eax, eax
jne 0x40c767
mov ecx, dword [ebp - 0x57c]
push ecx
call fcn.0041f855
mov edx, dword [ebp - 0x57c]
add esp, 4
mov esi, eax
mov eax, dword [ebp - 0x45c]
push edx
push eax
push esi
call fcn.00422100
add esp, 0xc
push 0x360
mov dword [ebp - 0x45c], esi
call fcn.0041fae2
mov ecx, 0xd8
lea esi, [ebp - 0x59c]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebx + 0x44]
add esp, 4
test ecx, ecx
jne 0x40c743
mov dword [ebx + 0x44], eax
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4
cmp dword [ecx + 0x35c], 0
je 0x40c75f
lea esp, [esp]
mov ecx, dword [ecx + 0x35c]
cmp dword [ecx + 0x35c], 0
jne 0x40c750
mov dword [ecx + 0x35c], eax
xor eax, eax
mov ecx, dword [ebp - 8]
pop edi
xor ecx, ebp
pop esi
call fcn.0041f86b
mov esp, ebp
pop ebp
ret 4