AttonRand
February 20th, 2010, 09:04
hi all
I am asking here because i know there are many good coders around.
I'd like to know something about vectored exception handling especially how to use it in masm.
I have searched in google but there are no example in masm and msdn, which is often very helpful, doesnt give so many info.
i understand that i need to call AddVectoredExceptionHandler but i am unsure about parameters:
FirstHandler: if i am correct this equals to a number (0=last handler)
VectoredHandler:here i get lost! is this the address where i must solve the exception like in seh? example:
can you make me an example in masm on how to use veh? like this:
when program comes accross exception i want it to show a msgbox and exit:
Thanks in advance
EDIT: Oh, forgot to say that i am a newbie plz keep things simple
I am asking here because i know there are many good coders around.
I'd like to know something about vectored exception handling especially how to use it in masm.
I have searched in google but there are no example in masm and msdn, which is often very helpful, doesnt give so many info.
i understand that i need to call AddVectoredExceptionHandler but i am unsure about parameters:
FirstHandler: if i am correct this equals to a number (0=last handler)
VectoredHandler:here i get lost! is this the address where i must solve the exception like in seh? example:
Code:
push xxxxx <---- address where to solve exception
push dword ptr fs:[0]
mov dword ptr fs:[0],esp
...
can you make me an example in masm on how to use veh? like this:
Code:
.386
.model flat,stdcall
option casemap:none
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
include windows.inc
.data
text db "Problem!",0
caption db "Help Me",0
.data?
hInstance HINSTANCE ?
.const
.code
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke AddVectoredExceptionHandler,1,??? <--- here what does it go?
xor ecx,ecx
mov al,3
idiv ecx <-- exception
end start
when program comes accross exception i want it to show a msgbox and exit:
Code:
invoke MessageBox,hInstance,addr text,addr caption,MB_OK
invoke ExitProcess,0
Thanks in advance
EDIT: Oh, forgot to say that i am a newbie plz keep things simple
