how to make a trap in a process or a thread
Posted on 2003-06-22 08:58:02 by feizhongshvi
What you mean?
Posted on 2003-06-22 12:12:20 by bazik
SEH ?
Posted on 2003-06-22 12:25:03 by donkey

SEH ?


Or cheese :grin:
Posted on 2003-06-22 12:37:17 by bazik
i think he ment BPX =) (breakpoint)..
probably if the process has been loaded with DEBUG flags, u can set a int 3 in order of single step ur process
Posted on 2003-06-22 13:20:15 by wizzra
or the simplest way for me - use MessageBox :) . I don't use any debugger other than VKDebug :)
Posted on 2003-07-19 02:18:54 by Ultrano
I think I know what he means and SEH seems like the good candidate. Set up your exception-handler, raise the exception whenever you want your 'trap', at end of proc, don't forget to restore old exception handler and such...

I made a *very* primitive set of macros for this



ThreadExceptionHandler MACRO handler
PUSH OFFSET handler
PUSH FS:[0]
MOV FS:[0],ESP
ENDM

EndThreadException MACRO
POP FS:[0]
ADD ESP,4h
ENDM


..Anywhays, you should read this
http://spiff.tripnet.se/~iczelion/Exceptionhandling.html
and the Win32Api about RaiseException. I *JUST* started SEH, but I know it can do what I think you want it to do :/ Sort of a trap, called immediately when you raise exception.

If anyone likes my macros, tell me ;) I can work on them more, or if you have an addition, don't be shy! I know the ERR structure can be more descriptive but... I'm new...
Posted on 2003-07-19 03:03:23 by FearHQ