Function at 0x40fc90
Capabilities:
Encode data using xor

Disassembly:
sub esp, 8
push esi
push edi
mov edi, ecx
mov dword [esp + 0xc], edi
mov eax, dword [edi + 0x760]
cmp eax, 0xffffffff
je 0x40ff2f
push eax
call fcn.0045c0b0
add esp, 4
test eax, eax
je 0x40ff2f
lea esi, [eax + 0x14]
mov eax, dword [0x829478]
push 1
push eax
push 4
push esi
call fcn.0045cc80
push 1
lea ecx, [esp + 0x28]
push 4
push ecx
push esi
call fcn.0045cb20
push 0
call fcn.0045d120
mov eax, dword [0x81c700]
add esp, 0x24
inc eax
cmp eax, 0x186a0
mov dword [0x81c700], eax
jb 0x40ff2f
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, eax
mov dword [0x81c700], 0
sub edx, ecx
cmp edx, eax
jne 0x40fd30
inc dword [0x8294f0]
call fcn.0045dca0
mov ecx, dword [0x829478]
mov eax, dword [0x820dd0]
mov edx, ecx
sub edx, eax
cmp edx, ecx
jne 0x40fd43
inc dword [0x8294f0]
call fcn.0045dca0
mov al, byte [0x81c644]
test al, al
jne 0x40fd5d
mov ecx, 0x83f450
call fcn.005ddd50
mov byte [0x81c644], 1
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ecx, dword [0x83f450]
cmp eax, ecx
jbe 0x40fd71
sub eax, ecx
jmp 0x40fd79
mov ecx, dword [0x83f454]
add eax, ecx
mov ecx, dword [0x829468]
cmp eax, ecx
jb 0x40fd99
mov edx, ecx
or edx, eax
je 0x40fd99
mov edx, eax
sub edx, ecx
cmp edx, 0x3a98
jbe 0x40ff2f
mov cl, byte [0x81c6fc]
test cl, cl
jne 0x40ff2f
mov ecx, dword [0x8294e8]
mov dword [0x829468], eax
mov eax, dword [0x829478]
push ebx
test ecx, ecx
mov byte [0x81c6fc], 1
not eax
jle 0x40fe1c
push ebp
mov ebx, 0x820e44
mov dword [esp + 0x10], ecx
mov ecx, dword [ebx]
test ecx, ecx
je 0x40fe09
mov esi, dword [ecx + 4]
test esi, esi
jle 0x40fe09
mov edx, dword [ecx]
mov edi, dword [edx + 0xc]
sar edi, 2
test edx, edx
je 0x40fe09
test esi, esi
jle 0x40fe09
mov ebp, esi
mov ecx, dword [edx]
xor eax, ecx
lea ecx, [edx + 0x14]
test edi, edi
jle 0x40fe03
mov esi, edi
xor eax, dword [ecx]
add ecx, 4
dec esi
jne 0x40fdfb
mov edx, dword [edx + 4]
dec ebp
jne 0x40fdee
mov ecx, dword [esp + 0x10]
add ebx, 4
dec ecx
mov dword [esp + 0x10], ecx
jne 0x40fdcf
mov edi, dword [esp + 0x14]
pop ebp
cmp eax, dword [0x8294d8]
je 0x40fe2f
inc dword [0x8294f0]
call fcn.0045dca0
mov eax, dword [0x8294e8]
xor ebx, ebx
cmp eax, ebx
je 0x40ff27
mov eax, dword [0x829464]
cmp eax, ebx
je 0x40feb2
push eax
call fcn.0045c0b0
add esp, 4
cmp eax, ebx
je 0x40fea7
push ebx
add eax, 0x14
push 4
push eax
mov eax, dword [0x829488]
lea ecx, [eax*4 + 0x82948c]
push ecx
call fcn.0045cba0
mov eax, dword [0x829488]
add esp, 0x10
lea esi, [eax*4 + 0x82948c]
inc eax
cmp eax, 8
mov dword [0x829488], eax
jl 0x40fe8d
mov dword [0x829488], ebx
push ebx
call fcn.0045d120
add esp, 4
call fcn.004059e0
cmp esi, ebx
je 0x40fea7
cmp dword [esi], 0x29874362
je 0x40feb2
inc dword [0x8294f0]
call fcn.0045dca0
mov eax, dword [0x8294b0]
cmp eax, ebx
je 0x40ff27
push eax
call fcn.0045c0b0
add esp, 4
cmp eax, ebx
je 0x40ff1c
mov edx, dword [0x829488]
push ebx
add eax, 0x14
push 4
push eax
lea eax, [edx*4 + 0x82948c]
push eax
call fcn.0045cba0
mov eax, dword [0x829488]
add esp, 0x10
lea esi, [eax*4 + 0x82948c]
inc eax
cmp eax, 8
mov dword [0x829488], eax
jl 0x40ff02
mov dword [0x829488], ebx
push ebx
call fcn.0045d120
add esp, 4
call fcn.004059e0
cmp esi, ebx
je 0x40ff1c
cmp dword [esi], 0xbad0bad
je 0x40ff27
inc dword [0x8294f0]
call fcn.0045dca0
mov byte [0x81c6fc], 0
pop ebx
mov edx, dword [edi + 0xa0]
lea ecx, [edi + 0xa0]
push 1
push 7
call dword [edx + 0x38]
pop edi
pop esi
add esp, 8
ret 4