Quote:
Originally Posted by iArazGames
Hi, gibt es eine Möglichkeit ein Programm Uninjectable zu machen? Und wie kann man Prozesse automatisch schließen/sie einfrieren/unbenutzbar machen wenn das Programm geöffnet ist?
Mit freundlichen Grüßen,
Araz Games
|
Google ist dein Freund...
Aber ich will mal nicht so sein:
Code:
BOOL GetProcessList( )
{
HANDLE hProcessSnap;
HANDLE hProcess;
PROCESSENTRY32 pe32;
DWORD dwPriorityClass;
// Take a snapshot of all processes in the system.
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( hProcessSnap == INVALID_HANDLE_VALUE )
{
return( FALSE );
}
// Set the size of the structure before using it.
pe32.dwSize = sizeof( PROCESSENTRY32 );
// Retrieve information about the first process,
// and exit if unsuccessful
if( !Process32First( hProcessSnap, &pe32 ) )
{
CloseHandle( hProcessSnap ); // clean the snapshot object
return( FALSE );
}
// Now walk the snapshot of processes
do
{
string str(pe32.szExeFile);
if(str == "Das-Programm.exe") // put the name of your process you want to kill
{
TerminateMyProcess(pe32.th32ProcessID, 1);
}
} while( Process32Next( hProcessSnap, &pe32 ) );
CloseHandle( hProcessSnap );
return( TRUE );
}
BOOL TerminateMyProcess(DWORD dwProcessId, UINT uExitCode)
{
DWORD dwDesiredAccess = PROCESS_TERMINATE;
BOOL bInheritHandle = FALSE;
HANDLE hProcess = OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);
if (hProcess == NULL)
return FALSE;
BOOL result = TerminateProcess(hProcess, uExitCode);
CloseHandle(hProcess);
return result;
}
Source:
Uninjectable:
Einfach jegliche Eintrittspunkte aus der Datei entfernen, dadurch wird es praktisch unmöglich, ohne die Eintrittspunkte zu kennen (was ein dritter normalerweise nicht weiß) die Datei zu benutzen/injecten.