-
Search Text in Process
i want search 1 text in process Wow.exe but it memory verry big,i want fast search
Code:
#include <windows.h>
#include <tlhelp32.h>
#include <tchar.h>
#include <stdio.h>
BOOL GetProcessList( )
{
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( hProcessSnap == INVALID_HANDLE_VALUE )
{
return( FALSE );
}
pe32.dwSize = sizeof( PROCESSENTRY32 );
if( !Process32First( hProcessSnap, &pe32 ) )
{
CloseHandle( hProcessSnap ); // clean the snapshot object
return( FALSE );
}
do
{
if (lstrcmp(pe32.szExeFile,L"TestReadProcessMemory.exe") == 0)
{//____________________________doc bo nho tai gia tri 0x0040C0A0
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);
if(hProcess ==NULL)
{
printf("\nLoi ham OpenProcess\n");
return 0;
}
char buff[1024];
int BytesRead;
if (ReadProcessMemory(hProcess, (LPDWORD)(0x0040C0A0),buff, sizeof(buff),(LPDWORD)&BytesRead) ==0)
{
printf("\nerror ReadProcessMemory\n");
return 0;
}
printf("\n%s",buff);
}//________________________________
} while( Process32Next( hProcessSnap, &pe32 ) );
CloseHandle( hProcessSnap );
return( TRUE );
}
int main()
{
GetProcessList( );
Sleep(10000);
return 0;
}