Somone on IRC asked if there's a way to determine whether the
debugger is being used or not. Since there's no "#compilerif-flag"
for this purpose, I came up with this:
netmaestro wrote:Here on PB 3.94, AMD 64 proc, traumatic code reports correctly, gnozal code says 0 in all cases.
AFAIK, gnozal's code times execution speed (which is slower with enabled debuggers). You probably need to adjust the CMP Eax,$96 for a correct result, but probably it does not work with the PB debugger at all.
It simply looks at the byte in memory @the label. If the debugger is there it adds some instructions between your own, and then the result isnt the same. This of course only works with the pb debugger, as f.ex ollydbg does not add such stuff.
To detect other debuggers you can use the api command IsDebuggerPresent_().. :
SFSxOI wrote:What if you want to keep other debuggers from attaching?
Please read what i post
To detect other debuggers you can use the api command IsDebuggerPresent_().. :
Code:
If IsDebuggerPresent_()
MessageRequester("","Debugger is active!")
Else
MessageRequester("","No debugger")
EndIf
notice that its not hard to overrule that check so better hide it. And the api command isnt that hard to find, however its one method to get rid of totally newbie crackers.