Function at 0x1006ce20
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x48
mov bl, byte [esp + 0x5c]
mov edi, ecx
mov al, 1
mov dword [esp], edx
test bl, bl
je 0x1006d040
mov ecx, dword [esp]
mov eax, dword [ecx + 0x10]
movsd xmm0, qword [ecx]
movsd xmm1, qword [ecx + 8]
mov dword [esp + 0x18], eax
movsd qword [esp + 0x10], xmm1
movsd qword [esp + 8], xmm0
mov eax, dword [edi + 0x1c]
cmp eax, 1
je 0x1006ceed
test eax, eax
jne 0x1006cf91
cmp dword [edi + 0x2c], 3
je 0x1006cf91
lea ecx, [edi + 0x20]
call fcn.1005f910
mov ebp, dword [edi + 0x5c]
mov al, 1
mov bh, 1
xchg byte [ebp + 0x20], al
mov al, 1
xchg byte [ebp + 0x10], al
test al, al
jne 0x1006ceaf
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
xor edx, edx
mov dword [ebp + 0xc], 0
xchg byte [ebp + 0x10], dl
test eax, eax
je 0x1006ceaf
push ecx
call dword [eax + 4]
add esp, 4
xchg byte [ebp + 0x1c], bh
lea esi, [edi + 0x5c]
test bh, bh
jne 0x1006ced6
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x14]
mov dword [ebp + 0x18], 0
test eax, eax
je 0x1006ced1
push ecx
call dword [eax + 0xc]
add esp, 4
xor eax, eax
xchg byte [ebp + 0x1c], al
mov eax, dword [esi]
lock dec dword [eax]
jne 0x1006cf91
mov ecx, esi
call fcn.10064f90
jmp 0x1006cf91
cmp dword [edi + 0x20], 0
je 0x1006cf91
mov ebp, dword [edi + 0x24]
test ebp, ebp
je 0x1006cf91
mov eax, dword [0x104dec60]
test eax, eax
jne 0x1006cf29
mov ecx, 0x10421629
mov edx, 0x17
call fcn.100f2ce0
test eax, eax
mov eax, 0x100f30b0
cmovne eax, edx
mov dword [0x104dec60], eax
cmp eax, 0x100f30b0
jne 0x1006cf4b
mov esi, dword [ebp]
test esi, esi
je 0x1006cf4b
push esi
call sub.KERNEL32.dll_DeleteCriticalSection
call sub.KERNEL32.dll_GetProcessHeap
push esi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov esi, dword [edi + 0x24]
call sub.KERNEL32.dll_GetProcessHeap
push esi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov eax, dword [edi + 0x30]
push dword [edi + 0x2c]
call dword [eax]
add esp, 4
mov eax, dword [edi + 0x30]
cmp dword [eax + 4], 0
je 0x1006cf91
mov esi, dword [edi + 0x2c]
cmp dword [eax + 8], 9
jae 0x1006cf81
call sub.KERNEL32.dll_GetProcessHeap
push esi
jmp 0x1006cf89
call sub.KERNEL32.dll_GetProcessHeap
push dword [esi - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov dword [edi + 0x1c], 1
lea ecx, [edi + 0x18]
movsd xmm0, qword [esp + 8]
movsd xmm1, qword [esp + 0x10]
movsd qword [edi + 0x20], xmm0
movsd qword [edi + 0x28], xmm1
mov eax, dword [esp + 0x18]
mov dword [edi + 0x30], eax
movsd xmm0, qword [esp + 0x1c]
movsd xmm1, qword [esp + 0x24]
movsd qword [edi + 0x34], xmm0
movsd qword [edi + 0x3c], xmm1
movsd xmm0, qword [esp + 0x2c]
movsd qword [edi + 0x44], xmm0
movsd xmm0, qword [esp + 0x34]
movsd qword [edi + 0x4c], xmm0
movsd xmm0, qword [esp + 0x3c]
movsd qword [edi + 0x54], xmm0
mov eax, dword [esp + 0x44]
mov dword [edi + 0x5c], eax
mov eax, dword [edi]
nop dword [eax + eax]
mov edx, eax
xor edx, 3
lock cmpxchg dword [edi], edx
jne 0x1006d000
test al, 1
je 0x1006d1d6
test al, 2
jne 0x1006d1e7
test al, 8
jne 0x1006d026
call fcn.1006bf30
jmp 0x1006d03e
test al, 0x10
je 0x1006d03e
mov eax, dword [edi + 0x64]
test eax, eax
je 0x1006d1f8
push dword [edi + 0x60]
call dword [eax + 8]
add esp, 4
xor eax, eax
cmp dword [edi + 0x18], 0
lea ebp, [edi + 0x18]
mov dword [esp + 4], eax
je 0x1006d063
lea edx, [esp + 0x1c]
mov ecx, ebp
mov dword [esp + 0x1c], edi
call fcn.10108170
test eax, eax
setne cl
jmp 0x1006d065
xor ecx, ecx
mov eax, dword [edi]
jmp 0x1006d076
lock cmpxchg dword [edi], esi
je 0x1006d0b5
test bl, bl
je 0x1006d090
test al, 2
mov edx, eax
jne 0x1006d095
jmp 0x1006d1bd
mov edx, eax
or edx, 2
cmp edx, 0x3f
jbe 0x1006d1ac
lea esi, [edx - 0x40]
test cl, cl
je 0x1006d070
cmp esi, 0x3f
jbe 0x1006d1ac
add edx, 0xffffff80
mov esi, edx
jmp 0x1006d070
cmp esi, 0x3f
ja 0x1006d0f3
mov eax, dword [ebp]
test eax, eax
je 0x1006d0cd
lock dec dword [eax]
jne 0x1006d0cd
mov ecx, ebp
call fcn.1006d220
lea ecx, [edi + 0x1c]
call fcn.1006c4d0
mov eax, dword [edi + 0x64]
test eax, eax
je 0x1006d0e5
push dword [edi + 0x60]
call dword [eax + 0xc]
add esp, 4
call sub.KERNEL32.dll_GetProcessHeap
push edi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
cmp byte [esp + 4], 0
je 0x1006d1a4
mov eax, dword [esp]
cmp dword [eax], 0
je 0x1006d1a4
mov eax, dword [esp]
mov edi, dword [eax + 4]
test edi, edi
je 0x1006d1a4
mov eax, dword [0x104dec60]
test eax, eax
jne 0x1006d13f
mov ecx, 0x10421629
mov edx, 0x17
call fcn.100f2ce0
test eax, eax
mov eax, 0x100f30b0
cmovne eax, edx
mov dword [0x104dec60], eax
cmp eax, 0x100f30b0
jne 0x1006d160
mov esi, dword [edi]
test esi, esi
je 0x1006d160
push esi
call sub.KERNEL32.dll_DeleteCriticalSection
call sub.KERNEL32.dll_GetProcessHeap
push esi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov ebx, dword [esp]
mov esi, dword [ebx + 4]
call sub.KERNEL32.dll_GetProcessHeap
push esi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov edi, dword [ebx + 0xc]
mov esi, dword [ebx + 0x10]
push edi
call dword [esi]
add esp, 4
cmp dword [esi + 4], 0
je 0x1006d1a4
cmp dword [esi + 8], 9
jae 0x1006d194
call sub.KERNEL32.dll_GetProcessHeap
push edi
jmp 0x1006d19c
call sub.KERNEL32.dll_GetProcessHeap
push dword [edi - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
add esp, 0x48
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, str.assertion_failed:_self.ref_count_____0
mov edx, 0x26
push 0x10423c50
jmp 0x1006d1cc
mov ecx, str.assertion_failed:_snapshot.is_complete____B
mov edx, 0x28
push 0x10423c18
call fcn.100ff9a0
add esp, 4
ud2
mov ecx, str.assertion_failed:_prev.is_running__
mov edx, 0x23
push 0x10423b88
jmp 0x1006d1cc
mov ecx, str.assertion_failed:__prev.is_complete__
mov edx, 0x25
push 0x10423bc0
jmp 0x1006d1cc
mov ecx, str.waker_missing
mov edx, 0xd
push 0x10423be0
call fcn.1004d560
add esp, 4
ud2