Function at 0x10004099
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 0x10004373
mov ebp, eax
lea edi, [esp + 0x24]
mov dword [edi], 0x1c
push edi
push eax
call sub.KERNEL32.dll_Thread32First
test eax, eax
je 0x10004342
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp dword [esp + 0x24], 0x10
jb 0x10004187
mov ebx, dword [esp + 0x30]
call esi
cmp ebx, eax
jne 0x10004187
mov ebx, dword [esp + 0x2c]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp ebx, eax
je 0x10004187
mov edi, dword [esp]
mov eax, dword [edi]
test eax, eax
je 0x1000414c
mov ecx, dword [edi + 4]
cmp dword [edi + 8], ecx
jb 0x10004173
mov ebx, edi
lea edx, [ecx + ecx]
mov dword [edi + 4], edx
shl ecx, 3
push ecx
push eax
push 0
push dword [0x100064d0]
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
test eax, eax
je 0x1000434b
mov dword [ebx], eax
mov edi, ebx
jmp 0x10004173
mov dword [edi + 4], 0x80
push 0x200
push 0
push dword [0x100064d0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, dword [esp]
mov dword [edi], eax
test eax, eax
je 0x10004363
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 0x100040eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
mov ebx, dword [esp]
jne 0x1000434b
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx]
xor esi, esi
test eax, eax
je 0x10004373
cmp dword [ebx + 8], 0
je 0x10004373
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 0x10004332
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 0x10004320
mov eax, dword [esp + 0x14]
cmp dword [esp + 0xc], 0xffffffff
jne 0x1000422f
mov eax, dword [0x100064e0]
cmp dword [esp + 8], eax
jae 0x10004320
mov esi, dword [esp + 8]
mov dword [esp + 0x20], eax
cmp dword [esp + 0x304], 1
sete al
mov ecx, dword [0x100064d8]
imul ebx, esi, 0x2c
mov dword [esp + 4], ecx
mov cl, byte [ecx + ebx + 0x14]
test cl, 2
sete ah
xor ah, al
jne 0x10004313
mov ebp, dword [esp + 4]
lea edx, [ebx + ebp]
mov eax, dword [esp + 0xdc]
cmp dword [esp + 0x304], 1
jne 0x100042ac
mov edi, dword [ebp + ebx + 0x18]
and edi, 0xf
je 0x10004313
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 0x100042e4
inc ebp
dec edi
jne 0x1000429c
jmp 0x10004313
test cl, 1
je 0x100042ba
mov edi, dword [edx]
lea ecx, [edi - 5]
cmp ecx, eax
je 0x100042f9
mov dword [esp + 0x1c], edx
mov edi, dword [ebp + ebx + 0x18]
and edi, 0xf
je 0x10004313
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 0x100042ef
inc ebp
dec edi
jne 0x100042d4
jmp 0x10004313
mov eax, dword [esp + 4]
add eax, ebx
add eax, 8
jmp 0x100042f3
mov eax, dword [esp + 0x1c]
movzx edi, byte [ebp]
add edi, dword [eax]
test edi, edi
je 0x10004313
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 0x10004241
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 0x10004371
mov eax, dword [eax]
jmp 0x100041e1
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x10004373
mov eax, dword [ebx]
test eax, eax
je 0x10004363
xor esi, esi
push eax
push esi
push dword [0x100064d0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebx], esi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, 8
jmp 0x10004373
xor esi, esi
mov eax, esi
add esp, 0x2f0
pop esi
pop edi
pop ebx
pop ebp
ret