how to make a trap in a process or a thread
What you mean?
SEH ?
Or cheese :grin:
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
probably if the process has been loaded with DEBUG flags, u can set a int 3 in order of single step ur process
or the simplest way for me - use MessageBox :) . I don't use any debugger other than VKDebug :)
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
..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...
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...