Function at 0x1009e790
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x148
mov bl, byte [ebp + 8]
mov edi, ecx
mov al, 1
mov dword [esp + 8], edx
test bl, bl
je 0x1009e958
mov ecx, dword [esp + 8]
lea esi, [edi + 0x18]
mov eax, dword [ecx + 0x10]
movsd xmm0, qword [ecx]
movsd xmm1, qword [ecx + 8]
mov dword [esp + 0x20], eax
movsd qword [esp + 0x18], xmm1
movsd qword [esp + 0x10], xmm0
mov eax, dword [edi + 0x18]
cmp eax, 1
je 0x1009e807
test eax, eax
jne 0x1009e8cb
mov eax, dword [edi + 0x20]
cmp eax, 4
je 0x1009e8cb
and eax, 2
jne 0x1009e8cb
lea ecx, [edi + 0x20]
call fcn.10080dd0
jmp 0x1009e8cb
cmp dword [esi + 4], 0
je 0x1009e8cb
mov ecx, dword [edi + 0x20]
test ecx, ecx
je 0x1009e8cb
mov eax, dword [0x10551f24]
test eax, eax
jne 0x1009e84b
mov dword [esp + 4], ecx
mov ecx, 0x103a03b9
mov edx, 0x17
call fcn.100f2fc0
mov ecx, dword [esp + 4]
test eax, eax
mov eax, 0x100f3390
cmovne eax, edx
mov dword [0x10551f24], eax
cmp eax, 0x100f3390
jne 0x1009e873
mov eax, dword [ecx]
test eax, eax
je 0x1009e873
push eax
mov dword [esp + 8], eax
call sub.KERNEL32.dll_DeleteCriticalSection
call sub.KERNEL32.dll_GetProcessHeap
push dword [esp + 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov eax, dword [edi + 0x20]
mov dword [esp + 4], eax
call sub.KERNEL32.dll_GetProcessHeap
push dword [esp + 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov eax, dword [edi + 0x2c]
push dword [edi + 0x28]
call dword [eax]
add esp, 4
mov eax, dword [edi + 0x2c]
cmp dword [eax + 4], 0
je 0x1009e8cb
mov ecx, dword [edi + 0x28]
cmp dword [eax + 8], 9
mov dword [esp + 4], ecx
jae 0x1009e8b7
call sub.KERNEL32.dll_GetProcessHeap
push dword [esp + 4]
jmp 0x1009e8c3
call sub.KERNEL32.dll_GetProcessHeap
mov ecx, dword [esp + 4]
push dword [ecx - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov dword [edi + 0x18], 1
lea ecx, [esp + 0x28]
mov eax, dword [esp + 0x20]
mov dword [esi + 0x14], eax
lea eax, [edi + 0x30]
movsd xmm0, qword [esp + 0x10]
movsd xmm1, qword [esp + 0x18]
movsd qword [esi + 0xc], xmm1
movsd qword [esi + 4], xmm0
push pe_nt_image_headers32
push ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov eax, dword [edi]
nop word [eax + eax]
mov ecx, eax
xor ecx, 3
lock cmpxchg dword [edi], ecx
jne 0x1009e910
test al, 1
je 0x1009eb06
test al, 2
jne 0x1009eb17
test al, 8
jne 0x1009e938
mov ecx, esi
call fcn.1009e690
jmp 0x1009e956
test al, 0x10
je 0x1009e956
mov eax, dword [edi + 0x154]
test eax, eax
je 0x1009eb28
push dword [edi + 0x150]
call dword [eax + 8]
add esp, 4
xor eax, eax
cmp dword [edi + 0x148], 0
lea ecx, [edi + 0x148]
mov dword [esp + 4], eax
mov dword [esp + 0xc], ecx
je 0x1009e983
lea edx, [esp + 0x28]
mov dword [esp + 0x28], edi
call fcn.10108450
test eax, eax
setne cl
jmp 0x1009e985
xor ecx, ecx
mov eax, dword [edi]
jmp 0x1009e996
lock cmpxchg dword [edi], esi
je 0x1009e9d5
test bl, bl
je 0x1009e9b0
test al, 2
mov edx, eax
jne 0x1009e9b5
jmp 0x1009eaed
mov edx, eax
or edx, 2
cmp edx, 0x3f
jbe 0x1009eadc
lea esi, [edx - 0x40]
test cl, cl
je 0x1009e990
cmp esi, 0x3f
jbe 0x1009eadc
add edx, 0xffffff80
mov esi, edx
jmp 0x1009e990
cmp esi, 0x3f
ja 0x1009ea20
mov eax, dword [edi + 0x148]
lea esi, [edi + 0x18]
test eax, eax
je 0x1009e9f5
lock dec dword [eax]
jne 0x1009e9f5
mov ecx, dword [esp + 0xc]
call fcn.1006d4e0
mov ecx, esi
call fcn.100810f0
mov eax, dword [edi + 0x154]
test eax, eax
je 0x1009ea12
push dword [edi + 0x150]
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 0x1009ead4
mov eax, dword [esp + 8]
cmp dword [eax], 0
je 0x1009ead4
mov eax, dword [esp + 8]
mov esi, dword [eax + 4]
test esi, esi
je 0x1009ead4
mov eax, dword [0x10551f24]
test eax, eax
jne 0x1009ea6e
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 0x1009ea8f
mov esi, dword [esi]
test esi, esi
je 0x1009ea8f
push esi
call sub.KERNEL32.dll_DeleteCriticalSection
call sub.KERNEL32.dll_GetProcessHeap
push esi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov edi, dword [esp + 8]
mov esi, dword [edi + 4]
call sub.KERNEL32.dll_GetProcessHeap
push esi
push 0
push eax
call sub.KERNEL32.dll_HeapFree
mov esi, dword [edi + 0xc]
mov edi, dword [edi + 0x10]
push esi
call dword [edi]
add esp, 4
cmp dword [edi + 4], 0
je 0x1009ead4
cmp dword [edi + 8], 9
jae 0x1009eac4
call sub.KERNEL32.dll_GetProcessHeap
push esi
jmp 0x1009eacc
call sub.KERNEL32.dll_GetProcessHeap
push dword [esi - 4]
push 0
push eax
call sub.KERNEL32.dll_HeapFree
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, str.assertion_failed:_self.ref_count_____0
mov edx, 0x26
push 0x103a29e0
jmp 0x1009eafc
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 0x1009eafc
mov ecx, str.assertion_failed:__prev.is_complete__
mov edx, 0x25
push 0x103a2950
jmp 0x1009eafc
mov ecx, str.waker_missing
mov edx, 0xd
push 0x103a2970
call fcn.1004d820
add esp, 4
ud2