Leave INT3 breaks to application's exception handler on visual studio

646 Views Asked by At

I'm actually developing a DLL that is injected into a process. This DLL sets several INT3 breaks around the executable's code which is called a lot. My DLL's exception handler catches those INT3 to change several register values and stuff like this, then it resumes the process so it can continue working.

The problem is: when I need to debug the DLL (by launching the application within visual studio) all those INT3 are being processes by visual studio. Is there any way to tell visual studio to pass those exceptions to the application's (dll) exception handler?

Important notes:

  • I can't disable those INT3s, because the actual dll code happens when those exceptions occur (on the handler).
  • The executable is compiled. I don't have the source code.

Thanks

1

There are 1 best solutions below

1
On

INT3 is the debug break instruction, so your DLL is a debugger. You've just discovered the joy of debugging a debugger.

And no, Windows has no idea who added the INT3, you or Visual Studio. So it delivers all interrupts to Visual Studio. Visual Studio does keep track, but all unexpected breakpoints (i.e. not set by Visual Studio itself) are handed off to the user. The reason is that this catches asserts and the like.