Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Programacion a Bajo Nivel. APIs, Hooking, ASM, C/C++, etc.
 » 

Analizar proceso



Autor Tema: Analizar proceso  (Leído 978 veces)

Desconectado P4|3L0

  • Asiduo
  • *
  • Mensajes: 75
  • TecnoHacker un nuevo proyecto.
    • http://www.tecnohacker.com
Analizar proceso
« en: Diciembre 29, 2009, 04:45:55 pm »
Código: You are not allowed to view links. Register or Login
#include <windows.h>
#include <winbase.h>
#include <iostream>
#include <string.h>
#include <tlhelp32.h>

using namespace std;


int main()
{

HANDLE hSnap;
PROCESSENTRY32 proceso;
DWORD dwPriorityClass;
int result=0;
hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( hSnap == INVALID_HANDLE_VALUE )
{
cout<<( TEXT("CreateToolhelp32Snapshot (of processes)") );
return( FALSE );
}

proceso.dwSize = sizeof( PROCESSENTRY32 );



if( !Process32First( hSnap, &proceso ) )
{
cout<<( TEXT("Process32First") );
CloseHandle( hSnap );
return( FALSE );
}


do
{

if(strcmp("cmd.exe",proceso.szExeFile )==0){
result=1;
break;
}

} while( Process32Next( hSnap, &proceso ) );

if(result==1)
cout<<"cmd.exe esta corriendo"<<endl;
else
cout<<"cmd.exe no esta corriendo"<<endl;
system("pause");

CloseHandle( hSnap );
}



Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal