mirror of
https://github.com/a0rtega/pafish
synced 2024-11-24 23:29:39 +03:00
Add BeingDebugged debugger detection
This commit is contained in:
parent
d69f67157f
commit
c6c28ab896
@ -4,6 +4,7 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "debuggers.h"
|
||||
#include "utils.h"
|
||||
#include "types.h"
|
||||
|
||||
int debug_isdebuggerpresent() {
|
||||
@ -26,3 +27,9 @@ int debug_outputdebugstring() {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
int debug_beingdebugged_peb() {
|
||||
struct _PEB_wine * PEB;
|
||||
PEB = pafish_get_PEB();
|
||||
return PEB->BeingDebugged == 1 ? TRUE : FALSE;
|
||||
}
|
||||
|
@ -6,4 +6,6 @@ int debug_isdebuggerpresent();
|
||||
|
||||
int debug_outputdebugstring();
|
||||
|
||||
int debug_beingdebugged_peb();
|
||||
|
||||
#endif
|
||||
|
@ -99,6 +99,9 @@ int main(void)
|
||||
exec_check("Using IsDebuggerPresent()", &debug_isdebuggerpresent,
|
||||
"Debugger traced using IsDebuggerPresent()",
|
||||
"hi_debugger_isdebuggerpresent");
|
||||
exec_check("Using BeingDebugged via PEB access", &debug_beingdebugged_peb,
|
||||
"Debugger traced using PEB BeingDebugged",
|
||||
"hi_debugger_beingdebugged_PEB");
|
||||
/* This is only working on MS Windows systems prior to Vista */
|
||||
if (winver.dwMajorVersion < 6) {
|
||||
exec_check("Using OutputDebugString()",
|
||||
|
Loading…
Reference in New Issue
Block a user