Skip to content

Commit

Permalink
300 IQ
Browse files Browse the repository at this point in the history
  • Loading branch information
can1357 committed May 3, 2018
1 parent 9034e6d commit fc41d94
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions PerfectInjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,22 @@ PUCHAR FindKernelPadSinglePage( PUCHAR Start, SIZE_T Size )
return 0;
}

uint32_t FindProcess( std::string Name )
uint32_t FindProcess( const std::string& Name )
{
PROCESSENTRY32 ProcessEntry;
ProcessEntry.dwSize = sizeof( PROCESSENTRY32 );
HANDLE ProcessSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, NULL );
if ( Process32First( ProcessSnapshot, &ProcessEntry ) == TRUE )
if ( Process32First( ProcessSnapshot, &ProcessEntry ) )
{
while ( Process32Next( ProcessSnapshot, &ProcessEntry ) == TRUE )
do
{
if ( !stricmp( ProcessEntry.szExeFile, Name.data() ) )
{
CloseHandle( ProcessSnapshot );
return ProcessEntry.th32ProcessID;
}
}
while ( Process32Next( ProcessSnapshot, &ProcessEntry ) )
}
CloseHandle( ProcessSnapshot );
return 0;
Expand Down

0 comments on commit fc41d94

Please sign in to comment.