Function at 0x5a1e4c
Capabilities:
Resume thread
Terminate thread

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffec
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x5a1e6d
mov dword [ebp - 0x10], 0xffffffff
jmp 0x5a2081
cmp dword [ebp - 8], 0xffffffff
jne 0x5a1e7c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
call fcn.005a1838
dec eax
je 0x5a1e98
dec eax
je 0x5a200d
dec eax
sub eax, 2
jae 0x5a206c
mov edx, 1
mov eax, dword [ebp - 4]
call fcn.005a173c
cmp dword [ebp - 0xc], 0
jne 0x5a1ebb
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 8]
test eax, eax
je 0x5a206c
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
mov dword [eax*8 + 0x5f95c0], 0xffffffff
mov eax, dword [ebp - 4]
call fcn.005a2088
call sub.kernel32.dll_GetCurrentThreadId_1
mov edx, dword [ebp - 4]
mov edx, dword [edx + 8]
add edx, edx
lea edx, [edx + edx*2]
cmp eax, dword [edx*8 + 0x5f95c8]
jne 0x5a1eff
xor eax, eax
mov dword [ebp - 0x14], eax
jmp 0x5a1f6a
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
call fcn.005a1764
test eax, eax
je 0x5a1f6a
xor eax, eax
push ebp
push 0x5a1f63
push dword fs:[eax]
mov dword fs:[eax], esp
cmp dword [ebp - 8], 0
jbe 0x5a1f4d
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x28]
mov edx, dword [ebp - 8]
call fcn.0059eb1c
test eax, eax
je 0x5a1f4d
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
xor edx, edx
mov dword [eax*8 + 0x5f95c0], edx
xor eax, eax
mov dword [ebp - 0x14], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5a1f6a
mov eax, dword [ebp - 4]
call fcn.005a18e0
ret
cmp dword [ebp - 0x14], 0
je 0x5a206c
push 0x7b5
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
mov eax, dword [eax*8 + 0x5f95c4]
push eax
call sub.kernel32.dll_TerminateThread
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
xor edx, edx
mov dword [eax*8 + 0x5f95b8], edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
xor edx, edx
mov dword [eax*8 + 0x5f95c0], edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
cmp dword [eax*8 + 0x5f95c4], 0
je 0x5a1fe6
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
mov eax, dword [eax*8 + 0x5f95c4]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
xor edx, edx
call fcn.005a13c8
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
add eax, eax
lea eax, [eax + eax*2]
mov eax, dword [eax*8 + 0x5f95cc]
push eax
call sub.kernel32.dll_SetEvent
jmp 0x5a206c
mov eax, dword [ebp - 4]
call fcn.005a1948
test eax, eax
je 0x5a205f
mov eax, dword [ebp - 4]
call fcn.005a1838
cmp eax, 2
je 0x5a2035
xor ecx, ecx
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
call fcn.005a1e4c
jmp 0x5a206c
mov eax, dword [ebp - 4]
call fcn.005a17c0
push eax
call sub.kernel32.dll_ResumeThread
mov edx, 3
mov eax, dword [ebp - 4]
call fcn.005a173c
xor ecx, ecx
or edx, 0xffffffff
mov eax, dword [ebp - 4]
call fcn.005a1e4c
jmp 0x5a206c
mov edx, 1
mov eax, dword [ebp - 4]
call fcn.005a173c
mov eax, dword [ebp - 4]
call fcn.005a1838
sub eax, 2
setb al
neg al
sbb eax, eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret