Function at 0x66e790
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x7ec06c]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0xc], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x2c], 0
jne 0x66e7c6
mov eax, 1
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0053bd3e
mov esp, ebp
pop ebp
ret
push ebx
call fcn.0062bd00
mov ebx, eax
test ebx, ebx
je 0x66eac0
push 0x66ec20
push 0x809744
call fcn.00633d40
add esp, 8
neg eax
sbb eax, eax
test dword [0x809750], eax
je 0x66eac0
cmp dword [0x809748], 0
push esi
je 0x66e839
call sub.KERNEL32.dll_GetCurrentThreadId
push dword [0x809740]
mov esi, eax
call fcn.00633d20
push esi
push dword [0x80974c]
call fcn.00633c50
push dword [0x809740]
mov esi, eax
mov dword [ebp - 0x20], esi
call fcn.00633db0
add esp, 0x10
test esi, esi
jne 0x66e84e
jmp 0x66e840
mov dword [ebp - 0x20], 0
push dword [0x80973c]
call fcn.00633d20
add esp, 4
mov eax, dword [0x809728]
mov ecx, dword [ebp + 0xc]
movups xmm0, xmmword [0x809714]
push edi
mov edi, dword [0x8092fc]
add ecx, edi
mov dword [ebp - 0x34], eax
mov eax, dword [0x80972c]
mov dword [ebp - 0x30], eax
mov eax, dword [0x809724]
mov dword [ebp - 8], eax
mov dword [0x8092fc], ecx
movups xmmword [ebp - 0x18], xmm0
cmp ecx, 0x3ff
jb 0x66e8b7
mov eax, 0x401005
mov dword [0x8092f8], 0x3ff
mul ecx
mov eax, ecx
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 9
imul eax, eax, 0x3ff
sub ecx, eax
mov dword [0x8092fc], ecx
jmp 0x66e8cd
mov eax, dword [0x8092f8]
cmp eax, 0x3ff
jae 0x66e8cd
cmp ecx, eax
cmova eax, ecx
mov dword [0x8092f8], eax
mov ecx, dword [ebp + 0xc]
mov eax, 0x66666667
imul ecx
sar edx, 3
mov esi, edx
shr esi, 0x1f
add esi, edx
lea eax, [esi + esi*4]
shl eax, 2
sub ecx, eax
xor eax, eax
test ecx, ecx
setg al
add eax, esi
mov esi, dword [ebp - 0x20]
add dword [0x80972c], eax
test esi, esi
jne 0x66e90d
push dword [0x80973c]
call fcn.00633db0
add esp, 4
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x24], 0
test eax, eax
jle 0x66ea3f
mov dword [ebp - 0x28], eax
mov ecx, 0x14
cmp eax, 0x14
mov esi, eax
push 0
cmovg esi, ecx
call fcn.0062acd0
push eax
push ebx
call fcn.0062b9d0
add esp, 0xc
test eax, eax
je 0x66eabe
push 0x14
lea eax, [ebp - 0x18]
push eax
push ebx
call fcn.0062bb70
add esp, 0xc
test eax, eax
je 0x66eabe
lea ecx, [edi - 0x3ff]
add ecx, esi
lea edx, [edi + 0x809300]
test ecx, ecx
jle 0x66e998
mov eax, esi
sub eax, ecx
push eax
push edx
push ebx
call fcn.0062bb70
add esp, 0xc
test eax, eax
je 0x66eabe
lea eax, [edi - 0x3ff]
add eax, esi
push eax
push 0x809300
jmp 0x66e99a
push esi
push edx
push ebx
call fcn.0062bb70
add esp, 0xc
test eax, eax
je 0x66eabe
push esi
push dword [ebp - 0x1c]
push ebx
call fcn.0062bb70
add esp, 0xc
test eax, eax
je 0x66eabe
push 8
lea eax, [ebp - 0x34]
push eax
push ebx
call fcn.0062bb70
add esp, 0xc
test eax, eax
je 0x66eabe
push 0
lea eax, [ebp - 0x18]
push eax
push ebx
call fcn.0062b950
add esp, 0xc
test eax, eax
je 0x66eabe
inc dword [ebp - 0x30]
xor ecx, ecx
add dword [ebp - 0x1c], esi
test esi, esi
jle 0x66ea1c
nop word [eax + eax]
mov al, byte [ebp + ecx - 0x18]
xor byte [edi + 0x809300], al
lea eax, [edi + 1]
xor edi, edi
cmp eax, 0x3ff
cmovl edi, eax
inc ecx
cmp ecx, esi
jl 0x66ea00
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x28]
add ecx, 0x14
sub eax, 0x14
mov dword [ebp - 0x24], ecx
cmp ecx, dword [ebp + 0xc]
mov ecx, 0x14
mov dword [ebp - 0x28], eax
jl 0x66e927
mov esi, dword [ebp - 0x20]
test esi, esi
jne 0x66ea51
push dword [0x80973c]
call fcn.00633d20
add esp, 4
movups xmm1, xmmword [0x809714]
xor ecx, ecx
mov edx, 4
movups xmm0, xmmword [ebp - 0x18]
pxor xmm1, xmm0
movups xmmword [0x809714], xmm1
nop
mov al, byte [ebp + ecx - 8]
lea ecx, [ecx + 1]
xor byte [ecx + 0x809723], al
sub edx, 1
jne 0x66ea70
movsd xmm0, qword [0x713660]
movsd xmm1, qword [0x809730]
comisd xmm0, xmm1
jbe 0x66eaa5
addsd xmm1, qword [ebp + 0x10]
movsd qword [0x809730], xmm1
test esi, esi
jne 0x66eab7
push dword [0x80973c]
call fcn.00633db0
add esp, 4
mov dword [ebp - 0x2c], 1
pop edi
pop esi
push ebx
call fcn.0062bce0
mov ecx, dword [ebp - 4]
add esp, 4
mov eax, dword [ebp - 0x2c]
xor ecx, ebp
pop ebx
call fcn.0053bd3e
mov esp, ebp
pop ebp
ret