Function at 0x2104b15f
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov dword [ebp - 0x1c], ecx
cmp dword [ebp + 0x10], 0
je 0x2104b177
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
cmp dword [ebp + 0x14], 0
je 0x2104b186
mov ecx, dword [ebp + 0x14]
mov dword [ecx], 0
mov ecx, dword [ebp - 0x1c]
call fcn.2104aceb
test eax, eax
je 0x2104b19c
mov eax, 1
jmp 0x2104b37b
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 8], 0
jne 0x2104b1ac
xor eax, eax
jmp 0x2104b37b
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0
push 4
push 0
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x1c]
push eax
push 0x2104b381
call fcn.21064235
mov ecx, dword [ebp - 0x1c]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 4], 0
jne 0x2104b1e7
xor eax, eax
jmp 0x2104b37b
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 4]
mov edx, dword [ebp + 0xc]
mov dword [ecx + 0x24], edx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 0x44], ecx
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0x44], 0
je 0x2104b2a5
cmp dword [ebp + 0x10], 0
je 0x2104b243
push 0x18
call fcn.210636c3
add esp, 4
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 4]
mov dword [eax + 0x48], ecx
cmp dword [ebp - 4], 0
je 0x2104b243
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x48]
mov dword [ecx], eax
cmp dword [ebp + 0x14], 0
je 0x2104b268
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov ecx, dword [ebp - 0x1c]
mov dword [ecx + 0x4c], eax
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x4c]
mov dword [edx], ecx
push 0x2108bbf8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 4]
mov ecx, dword [eax + 0x28]
mov dword [ebp - 0x10], ecx
mov edx, dword [0x2108bc20]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
mov ecx, 0x2108bc18
call fcn.21062e0c
push 0x2108bbf8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 4]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x2104b376
mov eax, dword [ebp - 0x1c]
cmp dword [eax + 0x44], 0
je 0x2104b372
push 0x2108bbf8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ecx + 4]
mov eax, dword [edx + 0x28]
push eax
push 0x2108bc18
call fcn.2103035c
push 0x2108bbf8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x1c]
cmp dword [ecx + 0x4c], 0
je 0x2104b31f
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x1c]
mov dword [ecx + 0x4c], 0
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0x48], 0
je 0x2104b354
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x48]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.210636ec
add esp, 4
mov edx, dword [ebp - 0x1c]
mov dword [edx + 0x48], 0
cmp dword [ebp + 0x10], 0
je 0x2104b363
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
cmp dword [ebp + 0x14], 0
je 0x2104b372
mov ecx, dword [ebp + 0x14]
mov dword [ecx], 0
xor eax, eax
jmp 0x2104b37b
mov eax, 1
mov esp, ebp
pop ebp
ret 0x10