Function at 0x401240
Capabilities:
Enumerate processes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x148
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push 2
call dword [sym.imp.KERNEL32.dll_CreateToolhelp32Snapshot]
mov esi, eax
mov dword [ebp - 0x1c], esi
cmp esi, 0xffffffff
je 0x401284
lea eax, [ebp - 0x144]
push eax
push esi
mov dword [ebp - 0x144], 0x128
call dword [sym.imp.KERNEL32.dll_Process32First]
test eax, eax
jne 0x40128d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor edi, edi
xor esi, esi
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], esi
jmp 0x4012a2
xor ebx, ebx
mov ecx, dword [ebp - 0x13c]
push ecx
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x10], ebx
call fcn.00401170
add esp, 4
test al, al
je 0x40131b
lea ebx, [esi + 4]
test ebx, ebx
je 0x4012fe
push ebx
test esi, esi
jle 0x4012dc
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
jmp 0x4012eb
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov esi, ebx
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], edi
test edi, edi
jne 0x4012fe
mov dword [ebp - 8], eax
jmp 0x401305
mov edx, dword [ebp - 0x10]
mov dword [esi + edi - 4], edx
lea eax, [ebp - 0x14]
lea esi, [ebp - 0xc]
call fcn.00403e10
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
jmp 0x4013d9
lea eax, [ebp - 0x120]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401324
sub eax, edx
lea ebx, [esi + 4]
mov dword [ebp - 0x18], eax
test ebx, ebx
je 0x401375
push ebx
test esi, esi
jle 0x40134e
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
jmp 0x40135d
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov eax, dword [ebp - 0x18]
mov esi, ebx
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], edi
test edi, edi
jne 0x401375
xor esi, esi
mov dword [ebp - 8], esi
jmp 0x401379
mov dword [esi + edi - 4], eax
test eax, eax
je 0x4013d9
lea ebx, [esi + eax]
test ebx, ebx
je 0x4013c2
push ebx
test esi, esi
jle 0x40139b
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
jmp 0x4013aa
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov esi, ebx
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], edi
test edi, edi
jne 0x4013bf
xor esi, esi
mov dword [ebp - 8], esi
jmp 0x4013d9
mov eax, dword [ebp - 0x18]
push eax
mov edx, esi
lea ecx, [ebp - 0x120]
sub edx, eax
push ecx
add edx, edi
push edx
call sub.ntdll.dll_memcpy
add esp, 0xc
xor ebx, ebx
cmp dword [ebp - 0x10], ebx
jle 0x4013f2
mov eax, dword [ebp - 0x14]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edx, dword [ebp - 0x1c]
lea ecx, [ebp - 0x144]
push ecx
push edx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_Process32Next]
test eax, eax
jne 0x4012a0
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0xc]
push ecx
push 1
call section..text
add esp, 8
cmp dword [ebp - 8], ebx
jle 0x401444
mov edx, dword [ebp - 0xc]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret