flat assembler
Message board for the users of flat assembler.

Index > Windows > Need help about SEH.

Author
Thread Post new topic Reply to topic
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz 01 Jul 2011, 20:07
Hi, I'm learning SEH things and I'm bit stuck on it.. I have some questions and can anybody help me with it ?
1) How SEH works ?
2) How can I initialize SEH chain ?

I have written little proggy here but I don't understand alot from there Smile
Code:
proc main
     push msgbox
     push dword [fs:0]
     mov [fs:0],esp
     mov eax,0
     mov eax,[eax]
     ret
endp

proc msgbox
invoke MessageBox,0,msg,ttl,MB_OK+MB_ICONINFORMATION
jmp fixa
ret
endp

proc fixa
invoke MessageBox,0,msg1,ttl,MB_OK+MB_ICONINFORMATION
ret
endp    

I found some example on web and trying to understand things..
I'm pushing procedure which will occured when exception will happen, after that pushing [fs:0] which is SEH I guess and then moving ESP (SEH address) to [fs:0] but I don't understand why... Also, I'm trying to not destroy stack but after adding these instructions forward from mov [fs:0],esp and then add esp,8 - exception says can't read address from 00000..
Can someone explain me how to do it without destroying stack and how it works ? Thank you.. Smile
Post 01 Jul 2011, 20:07
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 02 Jul 2011, 08:11
Internet is full of SEH tutorials, did you try following one?
Post 02 Jul 2011, 08:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz 02 Jul 2011, 08:18
Yes, I already tried but I don't understand a lot from there.
P.S First of all, I'm trying to find something in google and if nothing useful found, I'm posting here..
If you know better tutorial, can you give me link ? Thanks.
Post 02 Jul 2011, 08:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.