Quantcast

Jump to content

» «
Photo

Hacking exceptions

1 reply to this topic
Swoorup
  • Swoorup

    innovator

  • Feroci Racing
  • Joined: 28 Oct 2008
  • Nepal

#1

Posted 07 March 2012 - 05:04 AM

I think this is a general topic so I am posting here.
Whenever a program tries to execute invalid instructions
For instance: Supposing esi is 0x00000000
mov ecx, [esi]

This would cause crash and display an error handler message. And the program would end.
My question is: Is there a way to replace the standard crash handler with one of my own?
I would like to include much crash messages as possible. Values of registers, Stack, etc

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 07 March 2012 - 01:16 PM

There are some kind of errors you can handle using try/catch blocks, but specifically what you are talking about is a segmentation fault, and no sane OS would let your program maintain control if it seg faults, so the error message you get will contain what OS devs thought you should have and nothing more.

If you aren't familiar with protected mode and its specifics, read up on differences between protected and real modes of x86 family of CPUs.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users