Hello,
I try to write a Exception monitor, following is my code
//pykd 0.2
import pykd
class ExceptionHandler(pykd.eventHandler):
why exceptInfo.FirstChance is Always True?
and...
my test exception is
char * p=(char * )100;
but the addr is 0x100
addr = exceptInfo.Parameters[1]
I try to write a Exception monitor, following is my code
//pykd 0.2
import pykd
class ExceptionHandler(pykd.eventHandler):
def __init__(self):
pykd.eventHandler.__init__(self)
self.accessViolationOccured = False
self.bOver=0
def is_over(self):
return self.bOver
def onException(self, exceptInfo):
self.accessViolationOccured = exceptInfo.ExceptionCode == 0xC0000005
print exceptInfo
if exceptInfo.FirstChance:
return pykd.eventResult.NoChange
if self.accessViolationOccured:
type = exceptInfo.Parameters[0]
addr = exceptInfo.Parameters[1]
self.bOver=1
return pykd.eventResult.Break
return pykd.eventResult.NoChange
if name == 'main':startComamnd = 'test.exe'
pykd.startProcess(startComamnd)
expHandler = ExceptionHandler()
try:
while not expHandler.is_over():
pykd.go()
except Exception, err:
print err
==================why exceptInfo.FirstChance is Always True?
and...
my test exception is
char * p=(char * )100;
but the addr is 0x100
addr = exceptInfo.Parameters[1]