Bypassing Anti Analysis Techniques

What’s the difference between normal Execution and a binary “under analysis” ?

One has a debugger attached to it, the other doesnt :slight_smile:

One (Windows-)function being isDebuggerPresent.

 if(IsDebuggerPresent())
 {
   TerminateProcess(GetCurrentProcess(), 1);
 }

IsDebuggerPresent reads the BeingDebugged byte from the PEB, so that could be another check.

These are just 2 possible checks that happen on Windows, there’s a lot more, and you can find some pretty good resources here too.

Like this one for example.

Well, it “knows” you attached a debugger, so you’re gonna have to tell it there’s no debugger there!
Lucky for you, a lot of debuggers have scripts to auto-hide your debugger against a lot of different features.

One such plugin, is ScyllaHide.

Well, I suppose a lot of people just copy pasta SO code, also, implementing something like “IsdebuggerPresent” is not that hard as you can see above.

Of course, the amount of effort you put into obfuscation and anti-debugging / anti-vm / … will result in higher effort on the other side (to reverse it back).

I’m not aware of any tools that automatically implement advanced anti-debugging, but this is of course without consideration of packers and crypters.

2 Likes