// class method RiscOperatorsPtr RiscOperators::instance(const RegisterDictionary *regdict) { BaseSemantics::SValuePtr protoval = SValue::instance(); BaseSemantics::RegisterStatePtr registers = BaseSemantics::RegisterStateX86::instance(protoval, regdict); BaseSemantics::MemoryStatePtr memory = BaseSemantics::MemoryCellList::instance(protoval); BaseSemantics::StatePtr state = BaseSemantics::State::instance(registers, memory); SMTSolver *solver = NULL; return RiscOperatorsPtr(new RiscOperators(state, solver)); }
RiscOperatorsPtr RiscOperators::instance(const RegisterDictionary *regdict) { BaseSemantics::SValuePtr protoval = PartialSymbolicSemantics::SValue::instance(); BaseSemantics::RegisterStatePtr registers = BaseSemantics::RegisterStateGeneric::instance(protoval, regdict); BaseSemantics::MemoryCellListPtr memory = BaseSemantics::MemoryCellList::instance(protoval, protoval); memory->set_byte_restricted(false); // because extracting bytes from a word results in new variables for this domain BaseSemantics::StatePtr state = PartialSymbolicSemantics::State::instance(registers, memory); SMTSolver *solver = NULL; RiscOperatorsPtr ops = RiscOperatorsPtr(new RiscOperators(state, solver)); return ops; }
RiscOperatorsPtr RiscOperators::instance(const Partitioner2::Partitioner *partitioner, const RegisterDictionary *regdict, const SmtSolver::Ptr &solver) { BaseSemantics::SValuePtr protoval = SValue::instance(); BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict); BaseSemantics::MemoryStatePtr memory; switch (settings.searchMode) { case SEARCH_MULTI: // If we're sending multiple paths at a time to the SMT solver then we need to provide the SMT solver with // detailed information about how memory is affected on those different paths. memory = BaseSemantics::SymbolicMemory::instance(protoval, protoval); break; case SEARCH_SINGLE_DFS: case SEARCH_SINGLE_BFS: // We can perform memory-related operations and simplifications inside ROSE, which results in more but smaller // expressions being sent to the SMT solver. memory = SymbolicSemantics::MemoryState::instance(protoval, protoval); break; } ASSERT_not_null(memory); BaseSemantics::StatePtr state = State::instance(registers, memory); return RiscOperatorsPtr(new RiscOperators(partitioner, state, solver)); }