Function at 0x40d600
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 + 0x76c]
cmp eax, 0xffffffff
je 0x40d89f
push eax
call fcn.0045c0b0
add esp, 4
test eax, eax
je 0x40d89f
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 0x40d89f
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, eax
mov dword [0x81c700], 0
sub edx, ecx
cmp edx, eax
jne 0x40d6a0
inc dword [0x8294f0]
call fcn.0045dca0
mov ecx, dword [0x829478]
mov eax, dword [0x820dd0]
mov edx, ecx
sub edx, eax
cmp edx, ecx
jne 0x40d6b3
inc dword [0x8294f0]
call fcn.0045dca0
mov al, byte [0x81c644]
test al, al
jne 0x40d6cd
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 0x40d6e1
sub eax, ecx
jmp 0x40d6e9
mov ecx, dword [0x83f454]
add eax, ecx
mov ecx, dword [0x829468]
cmp eax, ecx
jb 0x40d709
mov edx, ecx
or edx, eax
je 0x40d709
mov edx, eax
sub edx, ecx
cmp edx, 0x3a98
jbe 0x40d89f
mov cl, byte [0x81c6fc]
test cl, cl
jne 0x40d89f
mov ecx, dword [0x8294e8]
mov dword [0x829468], eax
mov eax, dword [0x829478]
push ebx
test ecx, ecx
mov byte [0x81c6fc], 1
not eax
jle 0x40d78c
push ebp
mov ebx, 0x820e44
mov dword [esp + 0x10], ecx
mov ecx, dword [ebx]
test ecx, ecx
je 0x40d779
mov esi, dword [ecx + 4]
test esi, esi
jle 0x40d779
mov edx, dword [ecx]
mov edi, dword [edx + 0xc]
sar edi, 2
test edx, edx
je 0x40d779
test esi, esi
jle 0x40d779
mov ebp, esi
mov ecx, dword [edx]
xor eax, ecx
lea ecx, [edx + 0x14]
test edi, edi
jle 0x40d773
mov esi, edi
xor eax, dword [ecx]
add ecx, 4
dec esi
jne 0x40d76b
mov edx, dword [edx + 4]
dec ebp
jne 0x40d75e
mov ecx, dword [esp + 0x10]
add ebx, 4
dec ecx
mov dword [esp + 0x10], ecx
jne 0x40d73f
mov edi, dword [esp + 0x14]
pop ebp
cmp eax, dword [0x8294d8]
je 0x40d79f
inc dword [0x8294f0]
call fcn.0045dca0
mov eax, dword [0x8294e8]
xor ebx, ebx
cmp eax, ebx
je 0x40d897
mov eax, dword [0x829464]
cmp eax, ebx
je 0x40d822
push eax
call fcn.0045c0b0
add esp, 4
cmp eax, ebx
je 0x40d817
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 0x40d7fd
mov dword [0x829488], ebx
push ebx
call fcn.0045d120
add esp, 4
call fcn.004059e0
cmp esi, ebx
je 0x40d817
cmp dword [esi], 0x29874362
je 0x40d822
inc dword [0x8294f0]
call fcn.0045dca0
mov eax, dword [0x8294b0]
cmp eax, ebx
je 0x40d897
push eax
call fcn.0045c0b0
add esp, 4
cmp eax, ebx
je 0x40d88c
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 0x40d872
mov dword [0x829488], ebx
push ebx
call fcn.0045d120
add esp, 4
call fcn.004059e0
cmp esi, ebx
je 0x40d88c
cmp dword [esi], 0xbad0bad
je 0x40d897
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