Function at 0x10016e40
Capabilities:
Resume thread
Suspend thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2f0
mov eax, dword [0x1004e054]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x2ec], ecx
xor edi, edi
mov dword [ebp - 0x2d4], esi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadPriority]
push 0xf
mov dword [ebp - 0x2f0], eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, dword [esi + 4]
mov ebx, eax
mov edx, esi
mov dword [ebp - 0x2d8], ebx
neg edx
lea eax, [esi - 1]
sbb edx, edx
and edx, eax
je 0x1001708a
xor ecx, ecx
mov eax, edx
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.10023004
mov ecx, eax
add esp, 4
mov dword [0x100745a0], ecx
test ecx, ecx
je 0x10017085
lea eax, [esi*4 - 4]
neg esi
sbb esi, esi
and esi, eax
push esi
push edi
push ecx
call fcn.1001a930
mov eax, dword [ebp - 0x2d4]
xor ecx, ecx
add esp, 0xc
mov dword [ebp - 0x2e0], ecx
mov dword [ebp - 0x2dc], edi
cmp dword [eax + 4], ecx
jbe 0x10017078
mov esi, dword [sym.imp.KERNEL32.dll_GetThreadContext]
add eax, 0xdc
mov edx, dword [ebp - 0x2d4]
mov dword [ebp - 0x2e4], eax
mov eax, dword [eax]
cmp eax, ebx
je 0x10017059
push eax
push 0
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenThread]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x10016fb4
test ebx, ebx
je 0x10016fb4
push ebx
call dword [sym.imp.KERNEL32.dll_SuspendThread]
cmp eax, 0xffffffff
je 0x10017034
lea eax, [ebp - 0x2d0]
mov dword [ebp - 0x2d0], 0x10001
push eax
push ebx
mov dword [ebp - 0x2e8], 0
call esi
test eax, eax
je 0x10016fb4
nop dword [eax + eax]
mov eax, dword [ebp - 0x2ec]
xor esi, esi
mov edi, dword [ebp - 0x218]
nop
mov edx, dword [eax]
cmp edi, edx
jb 0x10016f9f
mov ecx, dword [eax + 8]
add ecx, edx
cmp edi, ecx
jb 0x10016fe4
inc esi
add eax, 0x70
cmp esi, 1
jl 0x10016f90
mov esi, dword [sym.imp.KERNEL32.dll_GetThreadContext]
mov edi, dword [ebp - 0x2dc]
mov eax, dword [0x100745a0]
mov ecx, dword [ebp - 0x2e0]
mov dword [eax + ecx*4], ebx
cmp ebx, 0xffffffff
je 0x1001704d
mov edx, dword [ebp - 0x2d4]
test ebx, ebx
mov ebx, dword [ebp - 0x2d8]
je 0x10017059
inc ecx
mov dword [ebp - 0x2e0], ecx
jmp 0x10017059
mov esi, dword [ebp - 0x2e8]
push ebx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
cmp esi, 3
jge 0x10017026
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
call dword [sym.imp.KERNEL32.dll_SuspendThread]
lea eax, [ebp - 0x2d0]
inc esi
push eax
mov dword [ebp - 0x2e8], esi
mov esi, dword [sym.imp.KERNEL32.dll_GetThreadContext]
push ebx
call esi
test eax, eax
jne 0x10016f80
jmp 0x10016fae
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
jmp 0x10016fa8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x100745a0]
mov ecx, dword [ebp - 0x2e0]
mov dword [eax + ecx*4], 0
mov ebx, dword [ebp - 0x2d8]
mov edx, dword [ebp - 0x2d4]
mov eax, dword [ebp - 0x2e4]
inc edi
add eax, 0x40
mov dword [ebp - 0x2dc], edi
mov dword [ebp - 0x2e4], eax
cmp edi, dword [edx + 4]
jb 0x10016f26
mov dword [0x10074580], ecx
mov edi, 1
jmp 0x1001708a
call fcn.10016ce0
push dword [ebp - 0x2f0]
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10018a16
mov esp, ebp
pop ebp
ret