Es gibt viele Möglichkeiten einen Debugger zu finden. Ich würde das mit dem Hide Plugin versuchen. Wenn das jedoch nicht funktioniert musst du dich wohl mit der AntiDebug Protection auseinander setzten (; .
Hier noch ein paar snips um Debugger zu detecten um klar zu machen wie vielfältig sowas aussehen kann :
Code:
unsigned long NtGlobalFlags = 0;
__asm
{
mov eax, fs:[30h]
mov eax, [eax + 68h]
mov NtGlobalFlags, eax
}
if(NtGlobalFlags & 0x70)
{
cout << " - Debugger was found\n";
}
else
{
cout << " - Debugger was not found\n";
}
Code:
BOOL IsRemoteDbgPresent = FALSE;
CheckRemoteDebuggerPresent(GetCurrentProcess(), &IsRemoteDbgPresent);
if(IsRemoteDbgPresent)
{
cout << " - Debugger was found\n";
}
else
{
cout << " - Debugger was not found\n";
}
Code:
char IsDbgPresent = 0;
__asm
{
mov eax, fs:[30h] // PEB structure address
mov al, [eax + 02h] // BeginDebugged variable address
mov IsDbgPresent, al
}
if(IsDbgPresent)
{
cout << " - Debugger was found\n";
}
else
{
cout << " - Debugger was not found\n";
}
Code:
if(IsDebuggerPresent())
{
cout << " - Debugger was found\n";
}
else
{
cout << " - Debugger was not found\n";
}
Code:
//
// Function NtQueryInformationProcessTest
// Return: true - if debugger exists; false - if debugger does not exist;
//
bool NtQueryInformationProcessTest()
{
typedef NTSTATUS (WINAPI *pNtQueryInformationProcess)
(HANDLE ,UINT ,PVOID ,ULONG , PULONG);
HANDLE hDebugObject = NULL;
NTSTATUS Status;
// Getting function address
pNtQueryInformationProcess NtQueryInformationProcess = (pNtQueryInformationPro
cess)
GetProcAddress(GetModuleHandle(TEXT("ntdll.dll")), "NtQueryInformationPro
cess" );
Status = NtQueryInformationProcess(GetCurrentProcess(),7, &hDebugObject, 4,
NULL);
if(Status == 0x00000000 && hDebugObject == (HANDLE)-1)
return true;
else
return false;
}
Code:
//
// Function ParentProcessTest
// Return: true if debugger exists; false if debugger does not exist.
//
bool ParentProcessTest()
{
DWORD ExplorerPID = 0;
GetWindowThreadProcessId(GetShellWindow(), &ExplorerPID);
DWORD CurrentPID = GetCurrentProcessId();
DWORD ParentPID = 0;
HANDLE SnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32 pe = { 0 };
pe.dwSize = sizeof(PROCESSENTRY32);
if(Process32First(SnapShot, &pe))
{
do
{
if(CurrentPID == pe.th32ProcessID)
ParentPID = pe.th32ParentProcessID;
}while( Process32Next(SnapShot, &pe));
}
CloseHandle(SnapShot);
if(ExplorerPID == ParentPID)
return false;
else
return true;
}