Function at 0x401240
Capabilities:
Enumerate processes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x134
mov eax, dword [0x40a040]
xor eax, esp
mov dword [esp + 0x130], eax
push ebx
push esi
push edi
push 0
push 2
mov dword [esp + 0x18], 0x128
call dword [sym.imp.KERNEL32.dll_CreateToolhelp32Snapshot]
mov ebx, eax
mov dword [esp + 0xc], ebx
cmp ebx, 0xffffffff
je 0x4013d5
lea eax, [esp + 0x10]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_Process32First]
lea ecx, [esp + 0x34]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401291
mov edi, dword [ebp + 0x18]
lea esi, [esp + 0x34]
sub ecx, edx
cmp dword [ebp + 0x1c], 0xf
lea edx, [ebp + 8]
cmova edx, dword [ebp + 8]
cmp ecx, edi
cmovb edi, ecx
sub edi, 4
jb 0x4012c7
mov eax, dword [edx]
cmp eax, dword [esi]
jne 0x4012cc
add edx, 4
add esi, 4
sub edi, 4
jae 0x4012b6
cmp edi, 0xfffffffc
je 0x401300
mov al, byte [edx]
cmp al, byte [esi]
jne 0x4012f9
cmp edi, 0xfffffffd
je 0x401300
mov al, byte [edx + 1]
cmp al, byte [esi + 1]
jne 0x4012f9
cmp edi, 0xfffffffe
je 0x401300
mov al, byte [edx + 2]
cmp al, byte [esi + 2]
jne 0x4012f9
cmp edi, 0xffffffff
je 0x401300
mov al, byte [edx + 3]
cmp al, byte [esi + 3]
je 0x401300
sbb eax, eax
or eax, 1
jmp 0x401302
xor eax, eax
test eax, eax
jne 0x40131d
cmp dword [ebp + 0x18], ecx
jb 0x40131d
ja 0x40131d
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x18]
jmp 0x4013d7
lea eax, [esp + 0x10]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_Process32Next]
test eax, eax
je 0x4013ce
lea eax, [esp + 0x34]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401338
mov ebx, dword [ebp + 0x18]
lea esi, [esp + 0x34]
sub eax, edx
mov edi, ebx
cmp dword [ebp + 0x1c], 0xf
lea edx, [ebp + 8]
cmova edx, dword [ebp + 8]
cmp eax, ebx
cmovb edi, eax
sub edi, 4
jb 0x401371
nop
mov ecx, dword [edx]
cmp ecx, dword [esi]
jne 0x401376
add edx, 4
add esi, 4
sub edi, 4
jae 0x401360
cmp edi, 0xfffffffc
je 0x4013aa
mov cl, byte [edx]
cmp cl, byte [esi]
jne 0x4013a3
cmp edi, 0xfffffffd
je 0x4013aa
mov cl, byte [edx + 1]
cmp cl, byte [esi + 1]
jne 0x4013a3
cmp edi, 0xfffffffe
je 0x4013aa
mov cl, byte [edx + 2]
cmp cl, byte [esi + 2]
jne 0x4013a3
cmp edi, 0xffffffff
je 0x4013aa
mov cl, byte [edx + 3]
cmp cl, byte [esi + 3]
je 0x4013aa
sbb ecx, ecx
or ecx, 1
jmp 0x4013ac
xor ecx, ecx
test ecx, ecx
jne 0x4013b6
cmp ebx, eax
jb 0x4013b6
jbe 0x401403
mov ebx, dword [esp + 0xc]
lea eax, [esp + 0x10]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_Process32Next]
test eax, eax
jne 0x401331
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
mov ecx, dword [ebp + 0x1c]
cmp ecx, 0xf
jbe 0x40141d
mov edx, dword [ebp + 8]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x401413
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x401413
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x18]
jmp 0x4013d7
push ecx
push edx
call fcn.00405099
add esp, 8
mov ecx, dword [esp + 0x13c]
mov eax, esi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00405056
mov esp, ebp
pop ebp
ret