1 #ifndef ROSE_BinaryAnalysis_PointerDetection_H
2 #define ROSE_BinaryAnalysis_PointerDetection_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <BaseSemantics2.h>
7 #include <MemoryCellList.h>
8 #include <Sawyer/Set.h>
15 namespace Partitioner2 {
113 namespace PointerDetection {
142 : ignoreConstIp(true), ignoreStrangeSizes(true) {}
151 : lvalue(lvalue), nBits(nBits) {}
175 PointerDescriptors codePointers_;
176 PointerDescriptors dataPointers_;
187 : hasResults_(false), didConverge_(false) {}
193 : hasResults_(false), didConverge_(false) {
205 : cpu_(cpu), hasResults_(false), didConverge_(false) {}
248 return codePointers_;
256 return dataPointers_;
265 return initialState_;
293 size_t wordSize, PointerDescriptors &result);
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
Settings to control the pointer analysis.
Description of one pointer.
InstructionSemantics2::BaseSemantics::StatePtr finalState() const
Final state for analysis.
bool didConverge() const
Whether the analysis results are valid.
Analysis(Disassembler *d, const Settings &settings=Settings())
Construct an analysis using a specific disassembler.
InstructionSemantics2::BaseSemantics::StatePtr initialState() const
Initial state for analysis.
const Settings & settings() const
Property: Analysis settings.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
bool ignoreConstIp
Whether to ignore branches to concrete addresses.
void clearNonResults()
Clears everything but results.
Main namespace for the ROSE library.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
Analysis(const InstructionSemantics2::BaseSemantics::DispatcherPtr &cpu, const Settings &settings=Settings())
Construct an analysis using a specified dispatcher.
Sawyer::Message::Facility mlog
Facility for diagnostic output.
void initDiagnostics()
Initialize diagnostics.
Functor to compare two PointerLocation objects.
void clearResults()
Clear analysis results.
size_t nBits
Width of pointer in bits.
SymbolicExpr::Ptr lvalue
Symbolic address of pointer.
const PointerDescriptors & codePointers() const
Property: Code pointers.
Settings()
Default settings.
Analysis()
Default constructor.
std::set< PointerDescriptor, PointerDescriptorLessp > PointerDescriptors
Set of pointers.
const PointerDescriptors & dataPointers() const
Property: Data pointers.
bool ignoreStrangeSizes
Whether to ignore strange-sized pointers.
void analyzeFunction(const Partitioner2::Partitioner &, const Sawyer::SharedPointer< Partitioner2::Function > &)
Analyze one function.
Partitions instructions into basic blocks and functions.
bool hasResults() const
Whether a function has been analyzed.
Virtual base class for instruction disassemblers.