Function at 0x10031c50
Capabilities:
Resume thread
Suspend thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2f8
mov eax, dword [0x100911c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push edi
xor edi, edi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadPriority]
push 0xf
mov dword [ebp - 0x2f8], eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 4
call dword [0x100ba190]
mov ebx, eax
mov dword [ebp - 0x2f4], ebx
cmp ebx, 0xffffffff
je 0x10031e78
test ebx, ebx
je 0x10031e78
push esi
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x1c
push eax
push ebx
xor esi, esi
call dword [0x100ba18c]
test eax, eax
je 0x10031e70
nop dword [eax]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp dword [ebp - 0x14], eax
jne 0x10031ce7
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [ebp - 0x18], eax
je 0x10031ce7
inc esi
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x1c
push eax
push ebx
call dword [0x100ba194]
test eax, eax
jne 0x10031cd0
test esi, esi
je 0x10031e70
xor ecx, ecx
mov eax, esi
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.10051c68
mov ecx, eax
add esp, 4
mov dword [0x100ba1c0], ecx
test ecx, ecx
je 0x10031e70
lea eax, [esi*4]
push eax
push 0
push ecx
call fcn.1004a6f0
add esp, 0xc
mov dword [ebp - 0x20], 0x1c
lea eax, [ebp - 0x20]
xor esi, esi
mov dword [ebp - 0x2f0], esi
push eax
push ebx
call dword [0x100ba18c]
test eax, eax
je 0x10031e65
mov ebx, dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp dword [ebp - 0x14], eax
jne 0x10031e3a
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [ebp - 0x18]
cmp ecx, eax
je 0x10031e3a
push ecx
push 0
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenThread]
mov esi, eax
cmp esi, 0xffffffff
je 0x10031e1c
test esi, esi
je 0x10031e1c
push esi
call dword [sym.imp.KERNEL32.dll_SuspendThread]
cmp eax, 0xffffffff
je 0x10031e13
lea eax, [ebp - 0x2ec]
mov dword [ebp - 0x2ec], 0x10001
push eax
push esi
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x10031e1c
nop dword [eax + eax]
mov ecx, dword [ebp - 0x234]
cmp ecx, ebx
jb 0x10031e1c
mov eax, dword [ebp + 0xc]
add eax, ebx
cmp ecx, eax
jae 0x10031e1c
push esi
call dword [sym.imp.KERNEL32.dll_ResumeThread]
cmp edi, 3
jge 0x10031e13
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
push esi
call dword [sym.imp.KERNEL32.dll_SuspendThread]
lea eax, [ebp - 0x2ec]
inc edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
jne 0x10031dd0
jmp 0x10031e1c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
mov eax, dword [0x100ba1c0]
mov ecx, dword [ebp - 0x2f0]
mov dword [eax + ecx*4], esi
cmp esi, 0xffffffff
je 0x10031e3a
test esi, esi
je 0x10031e3a
inc ecx
mov dword [ebp - 0x2f0], ecx
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], 0x1c
push eax
push dword [ebp - 0x2f4]
call dword [0x100ba194]
test eax, eax
jne 0x10031d68
mov ebx, dword [ebp - 0x2f4]
mov esi, dword [ebp - 0x2f0]
mov dword [0x100ba1c4], esi
mov edi, 1
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop esi
push dword [ebp - 0x2f8]
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
test edi, edi
jne 0x10031e94
call fcn.10031b50
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
xor ecx, ebp
pop ebx
call fcn.10030059
mov esp, ebp
pop ebp
ret