Forums >> IDA Pro >> IsDebuggerPresent and other such access violations
Topic created on: August 9, 2005 12:42 CDT by dwarkeeper.
hi,
I am trying to figure out how to disable access violations due to isdeubbggerpresent and other such violations, I am new to this any help and direction would be helpful.
First of all i don't know what do you mean by "how to disable access violations due to isdeubbggerpresent" sentence. IsDebugerPresent is an API function exported by KERNEL32.DLL library, many people use this to detect running debugger (well this will only work with so called SEH debuggers). Generally this function do following things:
As you can see this code only gets BeingDebugged value from the PEB block. Anyway if you don't want to write some more complicated software, and you don't like to use softice (it is not the SEH debugger so the trick will not work) and you are using OllyDebug i advice you to download script called HideDebugger (google should help).
If you have any further question feel free to mail me.
I *believe* he is talking about protection schemes that check the debuggerPresent flag, and cause exceptions if a debugger is detected. If you're looking to get around a protection, you'll want to set Olly(i'm assuming you're usuing olly...if not, then look up how to do this on your debugger) to pass exceptions to the program. You can do this in the Options -> Debugging Options -> Exceptions menu.
Also, i'd recommend getting the plugin to set/unset the debuggerPresent flag. Which is available here http://ollydbg.win32asmcommunity.net/stuph/ along with many other useful goodies.
using ollydbg and want your application be hidden from
IsDebuggerPresent() api ??
if yes
when your app is loaded
hit alt+f1 and invoke commandline
type
set byte ptr ds:[fs:[30]+2]] = 0
and hit enter
and olly is hidden from IsPresentDebuggerApi
all it does is change the return value of the api to always be 0 this also works if some coder ripped the code and inserted it inline
but this is a pretty old trick no body uses it as a main weapon
they resort to more deeper ways like
ZwQueryProcessInformation() with info class 7 InfoClass = ProcessDebugPort
or some of the latest
CheckIsRemoteDebuggerPresent()
etc
Thanks everyone for the responses. I should have mentioned I am able to successfully use isDebugPresent plugin in ollydbg to hide the request.
I am attempting to learn the IDA pro 4.8 which has a debugger included in its new interface and wondered if there was a way to do the same in IDA Pro.
In fact, I want to try and learn some basic techniques on using IDA pro both the decompiler part and debugger, any good sources or advice is greatly appreciated.
There's probably an IDA plug-in to do it, but in case you don't have it, or can't find it, you can use the PatchByte IDC command to change the 3rd byte in the PEB structure to 0.
When a process starts, EBX points to the PEB structure, so if you set a breakpoint at the first instruction, you can then do:
File->IDC Command and enter the Text:
PatchByte(EBX+0x2, 0x0);
Not sure if this will help you at all, I've done a bit of research in removing anti-debugger routines automatically and developed a piece of python code that can detect and remove many common anti-debugger routines from a binary. I'm also working on an article for the site on debugger routines and how to work around them, so keep an eye out for that if you're interested. My work in progress is located at http://www.datarescue.com/cgi-local/ultimatebb.cgi?ubb=get_topic;f=4;t=000320;p=0