Function at 0x100987e0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
mov bl, byte [esp + 0x30]
mov edi, ecx
mov al, 1
mov dword [esp], edx
test bl, bl
je 0x10098980
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 0x10098873
test eax, eax
jne 0x10098917
cmp byte [edi + 0x2c], 2
je 0x1009885c
lea ebp, [edi + 0x20]
mov ecx, ebp
call fcn.10026a90
mov eax, dword [ebp]
lock dec dword [eax]
jne 0x10098848
mov ecx, ebp
call fcn.10064ec0
mov eax, dword [edi + 0x30]
test eax, eax
je 0x1009885c
lock dec dword [eax]
jne 0x1009885c
lea ecx, [edi + 0x30]
call fcn.10064e20
cmp dword [edi + 0x34], 2
je 0x10098917
lea ecx, [edi + 0x34]
call fcn.100648f0
jmp 0x10098917
cmp dword [edi + 0x20], 0
je 0x10098917
mov ebp, dword [edi + 0x24]
test ebp, ebp
je 0x10098917
mov eax, dword [0x10551f24]
test eax, eax
jne 0x100988af
mov ecx, 0x103a03b9
mov edx, 0x17
call fcn.100f2fc0
test eax, eax
mov eax, 0x100f3390
cmovne eax, edx
mov dword [0x10551f24], eax
cmp eax, 0x100f3390
jne 0x100988d1
mov esi, dword [ebp]
test esi, esi
je 0x100988d1
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 0x10098917
mov esi, dword [edi + 0x2c]
cmp dword [eax + 8], 9
jae 0x10098907
call sub.KERNEL32.dll_GetProcessHeap
push esi
jmp 0x1009890f
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
mov eax, dword [edi]
mov edx, eax
xor edx, 3
lock cmpxchg dword [edi], edx
jne 0x10098940
test al, 1
je 0x10098b16
test al, 2
jne 0x10098b27
test al, 8
jne 0x10098966
call fcn.10096550
jmp 0x1009897e
test al, 0x10
je 0x1009897e
mov eax, dword [edi + 0x40]
test eax, eax
je 0x10098b38
push dword [edi + 0x3c]
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 0x100989a3
lea edx, [esp + 8]
mov ecx, ebp
mov dword [esp + 8], edi
call fcn.10108450
test eax, eax
setne cl
jmp 0x100989a5
xor ecx, ecx
mov eax, dword [edi]
jmp 0x100989b6
lock cmpxchg dword [edi], esi
je 0x100989f5
test bl, bl
je 0x100989d0
test al, 2
mov edx, eax
jne 0x100989d5
jmp 0x10098afd
mov edx, eax
or edx, 2
cmp edx, 0x3f
jbe 0x10098aec
lea esi, [edx - 0x40]
test cl, cl
je 0x100989b0
cmp esi, 0x3f
jbe 0x10098aec
add edx, 0xffffff80
mov esi, edx
jmp 0x100989b0
cmp esi, 0x3f
ja 0x10098a33
mov eax, dword [ebp]
test eax, eax
je 0x10098a0d
lock dec dword [eax]
jne 0x10098a0d
mov ecx, ebp
call fcn.1006d4e0
lea ecx, [edi + 0x1c]
call fcn.10096a00
mov eax, dword [edi + 0x40]
test eax, eax
je 0x10098a25
push dword [edi + 0x3c]
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 0x10098ae4
mov eax, dword [esp]
cmp dword [eax], 0
je 0x10098ae4
mov eax, dword [esp]
mov edi, dword [eax + 4]
test edi, edi
je 0x10098ae4
mov eax, dword [0x10551f24]
test eax, eax
jne 0x10098a7f
mov ecx, 0x103a03b9
mov edx, 0x17
call fcn.100f2fc0
test eax, eax
mov eax, 0x100f3390
cmovne eax, edx
mov dword [0x10551f24], eax
cmp eax, 0x100f3390
jne 0x10098aa0
mov esi, dword [edi]
test esi, esi
je 0x10098aa0
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 0x10098ae4
cmp dword [esi + 8], 9
jae 0x10098ad4
call sub.KERNEL32.dll_GetProcessHeap
push edi
jmp 0x10098adc
call sub.KERNEL32.dll_GetProcessHeap
push dword [edi - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, str.assertion_failed:_self.ref_count_____0
mov edx, 0x26
push 0x103a29e0
jmp 0x10098b0c
mov ecx, str.assertion_failed:_snapshot.is_complete__
mov edx, 0x28
push 0x103a29a8
call fcn.100ffc80
add esp, 4
ud2
mov ecx, str.assertion_failed:_prev.is_running__
mov edx, 0x23
push 0x103a2918
jmp 0x10098b0c
mov ecx, str.assertion_failed:__prev.is_complete__
mov edx, 0x25
push 0x103a2950
jmp 0x10098b0c
mov ecx, str.waker_missing
mov edx, 0xd
push 0x103a2970
call fcn.1004d820
add esp, 4
ud2