Function at 0x402ca0
Capabilities:
Enumerate processes

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x144
mov dword [ebp - 0x138], 0
mov eax, dword fs:[0x18]
mov esi, dword [eax + 0x20]
test byte [0x40d014], 8
jne 0x402e18
mov dword [esp + 4], 0
mov dword [esp], 2
call sub.kernel32.dll_CreateToolhelp32Snapshot
sub esp, 8
mov ebx, eax
cmp eax, 0xffffffff
je 0x402e48
mov dword [ebp - 0x134], 0x128
lea edi, [ebp - 0x134]
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.kernel32.dll_Process32First
sub esp, 8
test eax, eax
jne 0x402d37
jmp 0x402de0
mov dword [esp + 4], edi
mov dword [esp], ebx
call sub.kernel32.dll_Process32Next
sub esp, 8
test eax, eax
je 0x402de0
cmp esi, dword [ebp - 0x12c]
jne 0x402d20
mov eax, dword [ebp - 0x11c]
mov dword [esp + 4], 0
mov dword [esp], 0x100000
mov dword [esp + 8], eax
call dword [sym.imp.kernel32.dll_OpenProcess]
sub esp, 0xc
mov dword [ebp - 0x138], eax
test eax, eax
je 0x402ed8
lea eax, [ebp - 0x138]
mov dword [esp + 0x10], 0x1cff
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], 1
call dword [sym.imp.user32.dll_MsgWaitForMultipleObjects]
sub esp, 0x14
test eax, eax
jne 0x402e90
lea esi, [esi]
mov eax, dword [ebp - 0x138]
test eax, eax
je 0x402dc6
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
test ebx, ebx
jne 0x402e70
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x40d014], 4
je 0x402db0
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], str.Unable_to_find_current_process_id__ld_when_listing_processes_n
mov dword [esp + 8], str.WaitForParentProcess
mov dword [esp + 4], 0x40d014
mov dword [esp], 2
call fcn.00402c50
jmp 0x402db0
mov dword [esp + 0xc], str.Waiting_for_parent_process_n
mov dword [esp + 8], str.WaitForParentProcess
mov dword [esp + 4], 0x40d014
mov dword [esp], 3
call fcn.00402c50
jmp 0x402ccc
test byte [0x40d014], 2
jne 0x402f28
mov eax, dword [ebp - 0x138]
test eax, eax
je 0x402e70
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call esi
sub esp, 4
jmp 0x402e76
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], ebx
call esi
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x40d014], 2
je 0x402db0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.Unable_to_wait_for_parent_process__error__ld_n
mov dword [esp + 8], str.WaitForParentProcess
mov dword [esp + 4], 0x40d014
mov dword [esp], 1
mov dword [esp + 0x10], eax
call fcn.00402c50
jmp 0x402db0
test byte [0x40d014], 4
je 0x402dc6
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x11c]
mov dword [esp + 0xc], str.OpenProcess_failed_pid_ld__error__ld_n
mov dword [esp + 8], str.WaitForParentProcess
mov dword [esp + 4], 0x40d014
mov dword [esp + 0x10], eax
mov dword [esp], 2
call fcn.00402c50
jmp 0x402db0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.CreateToolhelp32Snapshot_failed__error__ld_n
mov dword [esp + 8], str.WaitForParentProcess
mov dword [esp + 4], 0x40d014
mov dword [esp], 1
mov dword [esp + 0x10], eax
call fcn.00402c50
mov eax, dword [ebp - 0x138]
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
test eax, eax
je 0x402e76
mov dword [esp], eax
call esi
sub esp, 4
jmp 0x402e76