1#ifndef ROSE_BinaryAnalysis_PointerDetection_H
2#define ROSE_BinaryAnalysis_PointerDetection_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/Disassembler/BasicTypes.h>
7#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
8#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
12namespace BinaryAnalysis {
106namespace PointerDetection {
191 bool operator<(
const Access &other)
const {
247 : hasResults_(false), didConverge_(false) {}
253 : settings_(
settings), hasResults_(false), didConverge_(false) {
265 : settings_(
settings), cpu_(cpu), hasResults_(false), didConverge_(false) {}
308 return codePointers_;
316 return dataPointers_;
325 return initialState_;
Analysis(const Disassembler::BasePtr &d, const Settings &settings=Settings())
Construct an analysis using a specific disassembler.
void analyzeFunction(const Partitioner2::PartitionerConstPtr &, const Sawyer::SharedPointer< Partitioner2::Function > &)
Analyze one function.
InstructionSemantics::BaseSemantics::StatePtr initialState() const
Initial state for analysis.
const Settings & settings() const
Property: Analysis settings.
const PointerDescriptors & codePointers() const
Property: Code pointers.
void clearResults()
Clear analysis results.
InstructionSemantics::BaseSemantics::StatePtr finalState() const
Final state for analysis.
void clearNonResults()
Clears everything but results.
bool hasResults() const
Whether a function has been analyzed.
const PointerDescriptors & dataPointers() const
Property: Data pointers.
Analysis(const InstructionSemantics::BaseSemantics::DispatcherPtr &cpu, const Settings &settings=Settings())
Construct an analysis using a specified dispatcher.
Analysis()
Default constructor.
bool didConverge() const
Whether the analysis results are valid.
Description of one pointer.
std::set< Access > dereferences
Where pointer was dereferenced.
size_t nBits
Width of pointer in bits.
Direction
Information about how a pointer is dereferenced.
@ WRITE
Pointer is used to write to memory.
@ READ
Pointer is used to read from memory.
SymbolicExpression::Ptr pointerVa
Symbolic address where pointer variable is stored.
std::set< Access > pointerAccesses
Where pointer variable's value was accessed.
Settings to control the pointer analysis.
bool saveCodePointers
Save information about code pointers.
bool savePointerAccessValues
Save pointer accessed values if pointer accesses are saved.
uint64_t symbolicTrimThreshold
Threshold for replacing large symbolic expressions with new variables.
bool savePointerDereferenceValues
Save pointer dereferenced values if dereferences are saved.
bool saveDataPointers
Save information about data pointers.
bool ignoreConstIp
Whether to ignore branches to concrete addresses.
size_t maximumDataFlowIterationFactor
Maximum data-flow iteration factor.
bool ignoreStrangeSizes
Whether to ignore strange-sized pointers.
bool savePointerAccesses
Save information about where pointer variables are accessed.
bool savePointerVas
Save the pointer variable addresses in the results.
bool savePointerDereferences
Save information about where pointer values are dereferenced.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
std::list< PointerDescriptor > PointerDescriptors
Set of pointers.
void initDiagnostics()
Initialize diagnostics.
Sawyer::Message::Facility mlog
Facility for diagnostic output.
Description of accessing memory.
SymbolicExpression::Ptr value
Value read or written.
Direction direction
Whether memory is read or written.
rose_addr_t insnVa
Instruction location where memory is accessed.