def prehook(self, emu, op, starteip):
if not self.onceop.get(starteip):
self.onceop[starteip] = True
for i, o in enumerate(op.opers):
if o.isDeref():
discrete = o.isDiscrete()
operva = o.getOperAddr(op, emu)
# keep track of the max here, but save it for later too...
stackoff = emu.getStackOffset(operva)
if stackoff is not None: # py 2->3 specific
if stackoff >= 0:
self.stackmax = max(self.stackmax, stackoff)
self.operrefs.append((starteip, i, operva, o.tsize, stackoff, discrete))
if op.iflags & BRANCH_FLAGS:
oper = op.opers[0]
if oper.isDeref() or oper.isReg():
for cb in self._dynamic_branch_handlers:
try:
cb(self, emu, op, starteip)
except:
sys.excepthook(*sys.exc_info())
评论列表
文章目录