Classes | Public Member Functions | Static Public Member Functions | List of all members
Rose::BinaryAnalysis::BinaryToSource Class Reference


Convert binary to low-level C source code.

This analysis generates very low-level C source code that is as close as possible to the binary. This is not a decompiler; the source that gets generated is hardly human readable, but it can be fed into source code analysis functions.

Definition at line 22 of file ToSource.h.

#include <Rose/BinaryAnalysis/ToSource.h>


class  Exception
 Exceptions thrown by this analysis. More...
struct  Settings
 Settings to control this translator's behavior. More...

Public Member Functions

 BinaryToSource ()
 Default constructor. More...
 BinaryToSource (const Settings &)
 Construct the analyzer with specified settings. More...
const Settingssettings () const
 Property: Configuration settings. More...
void generateSource (const Partitioner2::PartitionerConstPtr &, std::ostream &)
 Generate source code as text. More...

Static Public Member Functions

static Sawyer::CommandLine::SwitchGroup commandLineSwitches (Settings &)
 Command-line switch parsing. More...
static void initDiagnostics ()
 Initialize diagnostic streams. More...

Constructor & Destructor Documentation

Rose::BinaryAnalysis::BinaryToSource::BinaryToSource ( )

Default constructor.

Constructs an analysis object that is not tied to any particular architecture yet, and which uses default settings.

Rose::BinaryAnalysis::BinaryToSource::BinaryToSource ( const Settings )

Construct the analyzer with specified settings.

Constructs an analysis object that is not tied to any particular architecture yet, but which uses the specified settings.

Member Function Documentation

static Sawyer::CommandLine::SwitchGroup Rose::BinaryAnalysis::BinaryToSource::commandLineSwitches ( Settings )

Command-line switch parsing.

static void Rose::BinaryAnalysis::BinaryToSource::initDiagnostics ( )

Initialize diagnostic streams.

This is called automatically by Rose::Diagnostics::initialize.

const Settings& Rose::BinaryAnalysis::BinaryToSource::settings ( ) const

Property: Configuration settings.

This property is read-only. The settings must be specified in the constructor.

Definition at line 96 of file ToSource.h.

void Rose::BinaryAnalysis::BinaryToSource::generateSource ( const Partitioner2::PartitionerConstPtr ,
std::ostream &   

Generate source code as text.

Emits C source code to the specified output stream. The output will be one C compilation unit that represents the entire binary specimen contained in the partitioner. This method takes a partitioner rather than a binary AST because the partitioner's data structures are more efficient for anaysis. A partitioner can be constructed from an AST if necessary.

The documentation for this class was generated from the following file: