1#ifndef ROSE_BinaryAnalysis_ToSource_H
2#define ROSE_BinaryAnalysis_ToSource_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/SourceAstSemantics.h>
9#include <Rose/BinaryAnalysis/InstructionSemantics/TraceSemantics.h>
10#include <Rose/Diagnostics.h>
11#include <Rose/Exception.h>
13#include <Sawyer/CommandLine.h>
16namespace BinaryAnalysis {
112 void generateSource(const Partitioner2::PartitionerConstPtr&, SgSourceFile *sourceAst);
123 void declareGlobalRegisters(std::ostream&);
126 void defineInterrupts(std::ostream&);
129 void emitEffects(std::ostream&);
Exceptions thrown by this analysis.
Exception(const std::string &mesg)
Constructs an exception with the specified message.
Convert binary to low-level C source code.
static Sawyer::CommandLine::SwitchGroup commandLineSwitches(Settings &)
Command-line switch parsing.
static void initDiagnostics()
Initialize diagnostic streams.
BinaryToSource(const Settings &)
Construct the analyzer with specified settings.
const Settings & settings() const
Property: Configuration settings.
BinaryToSource()
Default constructor.
void generateSource(const Partitioner2::PartitionerConstPtr &, std::ostream &)
Generate source code as text.
Base class for all ROSE exceptions.
A collection of related switch declarations.
Holds a value or nothing.
Base class for machine instructions.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer for basic semantic operations.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to trace-semantics RISC operations.
Settings to control this translator's behavior.
Sawyer::Optional< rose_addr_t > initialStackPointer
Optional initial value for the stack pointer.
Settings()
Constructs the default settings.
Sawyer::Optional< rose_addr_t > initialInstructionPointer
Optional initial value for the instruction pointer.
bool zeroMemoryArray
Whether to zero the memory array, or just allocated with malloc.
Sawyer::Optional< rose_addr_t > allocateMemoryArray
Whether to allocate the global memory array.
bool traceRiscOps
Trace the RISC operators for debugging.
bool traceInsnExecution
Generate code that prints instructions.