Function at 0x100021db
Capabilities:
Enumerate threads
Suspend thread

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x2f0
mov dword [esp + 0xc], edx
xor eax, eax
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [esp], ecx
mov dword [ecx + 8], eax
push eax
push 4
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov esi, 8
cmp eax, 0xffffffff
je 0x100024b5
mov ebp, eax
lea edi, [esp + 0x24]
mov dword [edi], 0x1c
push edi
push eax
call sub.KERNEL32.dll_Thread32First
test eax, eax
je 0x10002484
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp dword [esp + 0x24], 0x10
jb 0x100022c9
mov ebx, dword [esp + 0x30]
call esi
cmp ebx, eax
jne 0x100022c9
mov ebx, dword [esp + 0x2c]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp ebx, eax
je 0x100022c9
mov edi, dword [esp]
mov eax, dword [edi]
test eax, eax
je 0x1000228e
mov ecx, dword [edi + 4]
cmp dword [edi + 8], ecx
jb 0x100022b5
mov ebx, edi
lea edx, [ecx + ecx]
mov dword [edi + 4], edx
shl ecx, 3
push ecx
push eax
push 0
push dword [0x10005324]
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
test eax, eax
je 0x1000248d
mov dword [ebx], eax
mov edi, ebx
jmp 0x100022b5
mov dword [edi + 4], 0x80
push 0x200
push 0
push dword [0x10005324]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, dword [esp]
mov dword [edi], eax
test eax, eax
je 0x100024a5
mov ecx, dword [esp + 0x2c]
mov edx, dword [edi + 8]
lea ebx, [edx + 1]
mov dword [edi + 8], ebx
lea edi, [esp + 0x24]
mov dword [eax + edx*4], ecx
mov dword [esp + 0x24], 0x1c
push edi
push ebp
call sub.KERNEL32.dll_Thread32Next
test eax, eax
jne 0x1000222d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
mov ebx, dword [esp]
jne 0x1000248d
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx]
xor esi, esi
test eax, eax
je 0x100024b5
cmp dword [ebx + 8], 0
je 0x100024b5
xor esi, esi
mov ecx, dword [esp + 0xc]
mov edx, ecx
inc edx
mov dword [esp + 0x14], edx
cmove ecx, esi
mov dword [esp + 8], ecx
push dword [eax + esi*4]
push 0
push 0x5a
call dword [sym.imp.KERNEL32.dll_OpenThread]
test eax, eax
je 0x10002474
mov ebx, eax
mov dword [esp + 0x18], esi
push eax
call dword [sym.imp.KERNEL32.dll_SuspendThread]
mov dword [esp + 0x24], 0x10001
push edi
mov dword [esp + 0x14], ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x10002462
mov eax, dword [esp + 0x14]
cmp dword [esp + 0xc], 0xffffffff
jne 0x10002371
mov eax, dword [0x10005334]
cmp dword [esp + 8], eax
jae 0x10002462
mov esi, dword [esp + 8]
mov dword [esp + 0x20], eax
cmp dword [esp + 0x304], 1
sete al
mov ecx, dword [0x1000532c]
imul ebx, esi, 0x2c
mov dword [esp + 4], ecx
mov cl, byte [ecx + ebx + 0x14]
test cl, 2
sete ah
xor ah, al
jne 0x10002455
mov ebp, dword [esp + 4]
lea edx, [ebx + ebp]
mov eax, dword [esp + 0xdc]
cmp dword [esp + 0x304], 1
jne 0x100023ee
mov edi, dword [ebp + ebx + 0x18]
and edi, 0xf
je 0x10002455
mov ecx, dword [edx]
mov edx, dword [esp + 4]
lea ebp, [edx + ebx]
add ebp, 0x24
movzx edx, byte [ebp - 8]
add edx, ecx
cmp edx, eax
je 0x10002426
inc ebp
dec edi
jne 0x100023de
jmp 0x10002455
test cl, 1
je 0x100023fc
mov edi, dword [edx]
lea ecx, [edi - 5]
cmp ecx, eax
je 0x1000243b
mov dword [esp + 0x1c], edx
mov edi, dword [ebp + ebx + 0x18]
and edi, 0xf
je 0x10002455
mov ecx, dword [esp + 4]
lea ebp, [ecx + ebx]
add ebp, 0x1c
mov edx, dword [ebp - 0x14]
movzx ecx, byte [ebp + 8]
add ecx, edx
cmp ecx, eax
je 0x10002431
inc ebp
dec edi
jne 0x10002416
jmp 0x10002455
mov eax, dword [esp + 4]
add eax, ebx
add eax, 8
jmp 0x10002435
mov eax, dword [esp + 0x1c]
movzx edi, byte [ebp]
add edi, dword [eax]
test edi, edi
je 0x10002455
mov dword [esp + 0xdc], edi
lea eax, [esp + 0x24]
push eax
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
inc esi
mov eax, dword [esp + 0x20]
cmp esi, eax
jne 0x10002383
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esp + 0x24]
mov esi, dword [esp + 0x18]
inc esi
mov eax, dword [esp]
cmp esi, dword [eax + 8]
jae 0x100024b3
mov eax, dword [eax]
jmp 0x10002323
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x100024b5
mov eax, dword [ebx]
test eax, eax
je 0x100024a5
xor esi, esi
push eax
push esi
push dword [0x10005324]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebx], esi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, 8
jmp 0x100024b5
xor esi, esi
mov eax, esi
add esp, 0x2f0
pop esi
pop edi
pop ebx
pop ebp
ret