How to use the pyvex.stmt.WrTmp function in pyvex

To help you get started, we’ve selected a few pyvex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angr / angr / angr / analyses / reaching_definitions.py View on Github external
def _handle_LoadG(self, stmt):
            guard = self._expr(stmt.guard)
            if guard is True:
                # FIXME: full conversion support
                if stmt.cvt.find('Ident') < 0:
                    l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
                load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
                wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, load_expr)
                self._handle_WrTmp(wr_tmp_stmt)
            elif guard is False:
                wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, stmt.alt)
                self._handle_WrTmp(wr_tmp_stmt)
            else:
                if stmt.cvt.find('Ident') < 0:
                    l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
                load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
                data = DataSet(set(), load_expr.result_size(self.tyenv))
                data.update(self._expr(load_expr))
                data.update(self._expr(stmt.alt))
                data = data.compact()
                self._handle_WrTmpData(stmt.dst, data)
github dhxkgozj / DirEngine / build / lib.linux-x86_64-2.7 / DirEngine / Functions / FunctionsManager.py View on Github external
def _Get_Statement(self,s): # 태그마다 나눠서 처리 해야함 (미구현)
        stat = {}
        stat['tag'] = s.tag
        stat['pp'] = str(s)
        if isinstance(s,pyvex.stmt.IMark):
            self.old_addr = s.addr
            self.stat_count = 0
        stat['count'] = self.stat_count
        stat['addr'] = self.old_addr

        if isinstance(s,pyvex.stmt.WrTmp):
            stat['data'] = {}
            stat['data']['tag'] = s.data.tag
            if('op' in s.data.__dict__.keys()):
                stat['data']['op'] = s.data.op

        self.stat_count += 1
        return stat
github angr / angr / angr / analyses / reaching_definitions.py View on Github external
def _handle_LoadG(self, stmt):
            guard = self._expr(stmt.guard)
            if guard is True:
                # FIXME: full conversion support
                if stmt.cvt.find('Ident') < 0:
                    l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
                load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
                wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, load_expr)
                self._handle_WrTmp(wr_tmp_stmt)
            elif guard is False:
                wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, stmt.alt)
                self._handle_WrTmp(wr_tmp_stmt)
            else:
                if stmt.cvt.find('Ident') < 0:
                    l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
                load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
                data = DataSet(set(), load_expr.result_size(self.tyenv))
                data.update(self._expr(load_expr))
                data.update(self._expr(stmt.alt))
                data = data.compact()
                self._handle_WrTmpData(stmt.dst, data)
github angr / angr / angr / analyses / reaching_definitions / engine_vex.py View on Github external
def _handle_LoadG(self, stmt):
        guard = self._expr(stmt.guard)
        if guard.data == {True}:
            # FIXME: full conversion support
            if stmt.cvt.find('Ident') < 0:
                l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
            load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
            wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, load_expr)
            self._handle_WrTmp(wr_tmp_stmt)
        elif guard.data == {False}:
            wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, stmt.alt)
            self._handle_WrTmp(wr_tmp_stmt)
        else:
            if stmt.cvt.find('Ident') < 0:
                l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
            load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
            data = set()
            data.update(self._expr(load_expr).data)
            data.update(self._expr(stmt.alt).data)
            self._handle_WrTmpData(stmt.dst, DataSet(data, load_expr.result_size(self.tyenv)))
github angr / angr / angr / analyses / reaching_definitions / engine_vex.py View on Github external
def _handle_LoadG(self, stmt):
        guard = self._expr(stmt.guard)
        if guard.data == {True}:
            # FIXME: full conversion support
            if stmt.cvt.find('Ident') < 0:
                l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
            load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
            wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, load_expr)
            self._handle_WrTmp(wr_tmp_stmt)
        elif guard.data == {False}:
            wr_tmp_stmt = pyvex.stmt.WrTmp(stmt.dst, stmt.alt)
            self._handle_WrTmp(wr_tmp_stmt)
        else:
            if stmt.cvt.find('Ident') < 0:
                l.warning('Unsupported conversion %s in LoadG.', stmt.cvt)
            load_expr = pyvex.expr.Load(stmt.end, stmt.cvt_types[1], stmt.addr)
            data = set()
            data.update(self._expr(load_expr).data)
            data.update(self._expr(stmt.alt).data)
            self._handle_WrTmpData(stmt.dst, DataSet(data, load_expr.result_size(self.tyenv)))