monitor.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:vivisect-py3 作者: bat-serjo 项目源码 文件源码
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())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号