(self, successors: SimSuccessors)
Do return emulation and call-less stuff.
Do return emulation and call-less stuff.
Do return emulation and call - less stuff .
def _process_successor_exits(self, successors: SimSuccessors) -> None:
        """
        Do return emulation and call-less stuff.
        """
        for exit_state in list(successors.all_successors):
            exit_jumpkind = exit_state.history.jumpkind
            if exit_jumpkind is None:
                exit_jumpkind = ""

            if o.CALLLESS in self.state.options and exit_jumpkind == "Ijk_Call":
                exit_state.registers.store(
                    exit_state.arch.ret_offset,
                    exit_state.solver.Unconstrained(
                        "fake_ret_value", exit_state.arch.bits
                    ),
                )
                exit_state.scratch.target = exit_state.solver.BVV(
                    successors.addr + self.state.scratch.irsb.size, exit_state.arch.bits
                )
                exit_state.history.jumpkind = "Ijk_Ret"
                exit_state.regs.ip = exit_state.scratch.target
                if exit_state.arch.call_pushes_ret:
                    exit_state.regs.sp = exit_state.regs.sp + exit_state.arch.bytes

            elif o.DO_RET_EMULATION in exit_state.options and (
                exit_jumpkind == "Ijk_Call" or exit_jumpkind.startswith("Ijk_Sys")
            ):
                l.debug("%s adding postcall exit.", self)

                ret_state = exit_state.copy()
                guard = (
                    ret_state.solver.true
                    if o.TRUE_RET_EMULATION_GUARD in self.state.options
                    else ret_state.solver.false
                )
                ret_target = ret_state.solver.BVV(
                    successors.addr + self.state.scratch.irsb.size, ret_state.arch.bits
                )
                if ret_state.arch.call_pushes_ret and not exit_jumpkind.startswith(
                    "Ijk_Sys"
                ):
                    ret_state.regs.sp = ret_state.regs.sp + ret_state.arch.bytes
                successors.add_successor(
                    ret_state,
                    ret_target,
                    guard,
                    "Ijk_FakeRet",
                    exit_stmt_idx=DEFAULT_STATEMENT,
                    exit_ins_addr=self.state.scratch.ins_addr,
                )
def _process_successor_exits ( self , successors : SimSuccessors ) -> None : for exit_state in list ( successors . all_successors ) : exit_jumpkind = exit_state . history . jumpkind if exit_jumpkind is None : exit_jumpkind = "" if o . CALLLESS in self . state . options and exit_jumpkind == "Ijk_Call" : exit_state . registers . store ( exit_state . arch . ret_offset , exit_state . solver . Unconstrained ( "fake_ret_value" , exit_state . arch . bits ) , ) exit_state . scratch . target = exit_state . solver . BVV ( successors . addr + self . state . scratch . irsb . size , exit_state . arch . bits ) exit_state . history . jumpkind = "Ijk_Ret" exit_state . regs . ip = exit_state . scratch . target if exit_state . arch . call_pushes_ret : exit_state . regs . sp = exit_state . regs . sp + exit_state . arch . bytes elif o . DO_RET_EMULATION in exit_state . options and ( exit_jumpkind == "Ijk_Call" or exit_jumpkind . startswith ( "Ijk_Sys" ) ) : l . debug ( "%s adding postcall exit." , self ) ret_state = exit_state . copy ( ) guard = ( ret_state . solver . true if o . TRUE_RET_EMULATION_GUARD in self . state . options else ret_state . solver . false ) ret_target = ret_state . solver . BVV ( successors . addr + self . state . scratch . irsb . size , ret_state . arch . bits ) if ret_state . arch . call_pushes_ret and not exit_jumpkind . startswith ( "Ijk_Sys" ) : ret_state . regs . sp = ret_state . regs . sp + ret_state . arch . bytes successors . add_successor ( ret_state , ret_target , guard , "Ijk_FakeRet" , exit_stmt_idx = DEFAULT_STATEMENT , exit_ins_addr = self . state . scratch . ins_addr , )