#include <include/boomerang.h>
This is the main class of the decompiler.
Definition at line 90 of file boomerang.h.
Public Member Functions | |
void | addWatcher (Watcher *watcher) |
Add a Watcher to the set of Watchers for this Boomerang object. | |
void | alert_baddecode (ADDRESS pc) |
Alert the watchers of a bad decode of an instruction at pc. | |
void | alert_complete () |
Alert the watchers that decompilation has completed. | |
virtual void | alert_considering (Proc *parent, Proc *p) |
void | alert_decode (Proc *p, ADDRESS pc, ADDRESS last, int nBytes) |
Alert the watchers we have succesfully decoded this function. | |
void | alert_decode (ADDRESS pc, int nBytes) |
Alert the watchers we are currently decoding nBytes bytes at address pc. | |
virtual void | alert_decompile_afterPropagate (UserProc *p, int depth) |
virtual void | alert_decompile_afterRemoveStmts (UserProc *p, int depth) |
virtual void | alert_decompile_beforePropagate (UserProc *p, int depth) |
virtual void | alert_decompile_debug_point (UserProc *p, const char *description) |
virtual void | alert_decompile_SSADepth (UserProc *p, int depth) |
virtual void | alert_decompiling (UserProc *p) |
void | alert_end_decode () |
Alert the watchers we finished decoding. | |
virtual void | alert_end_decompile (UserProc *p) |
void | alert_load (Proc *p) |
Alert the watchers we have loaded the Proc. | |
void | alert_new (Proc *p) |
Alert the watchers we have found a new Proc. | |
virtual void | alert_proc_status_change (UserProc *p) |
void | alert_remove (Proc *p) |
Alert the watchers we have removed a Proc. | |
void | alert_start_decode (ADDRESS start, int nBytes) |
Alert the watchers we are starting to decode. | |
virtual void | alert_start_decompile (UserProc *p) |
void | alert_update_signature (Proc *p) |
Alert the watchers we have updated this Procs signature. | |
int | commandLine (int argc, const char **argv) |
The main function for the command line mode. | |
int | decompile (const char *fname, const char *pname=NULL) |
The program will be subsequently be loaded, decoded, decompiled and written to a source file. | |
HLLCode * | getHLLCode (UserProc *p=NULL) |
Returns the HLLCode for the given proc. | |
const std::string & | getOutputPath () |
Returns the path to where the output files are saved. | |
const std::string & | getProgPath () |
Get the path to the Boomerang executable. | |
Prog * | loadAndDecode (const char *fname, const char *pname=NULL) |
Loads the executable file and decodes it. | |
Prog * | loadFromXML (const char *fname) |
Log & | log () |
Returns the Log object associated with the object. | |
void | logTail () |
Prints the last lines of the log file. | |
void | objcDecode (std::map< std::string, ObjcModule > &modules, Prog *prog) |
Adds information about functions and classes from Objective-C modules to the Prog object. | |
void | persistToXML (Prog *prog) |
void | setLogger (Log *l) |
bool | setOutputDirectory (const char *path) |
Sets the directory in which Boomerang creates its output files. | |
void | setOutputPath (const char *p) |
Set the path where the output files are saved. | |
void | setProgPath (const char *p) |
Set the path to the Boomerang executable. | |
Static Public Member Functions | |
static Boomerang * | get () |
static char * | getVersionStr () |
Public Attributes | |
bool | assumeABI |
Assume ABI compliance. | |
bool | conTypeAnalysis |
bool | debugDecoder |
bool | debugGen |
bool | debugLiveness |
bool | debugProof |
bool | debugSwitch |
bool | debugTA |
bool | debugUnused |
bool | decodeMain |
When true, attempt to decode main, all children, and all procs. | |
bool | decodeThruIndCall |
bool | dfaTypeAnalysis |
const char * | dotFile |
The file in which the dotty graph is saved. | |
bool | dumpXML |
std::vector< ADDRESS > | entrypoints |
A vector which contains all know entrypoints for the Prog. | |
bool | experimental |
Activate experimental code. Caution! | |
bool | generateCallGraph |
bool | generateSymbols |
bool | loadBeforeDecompile |
int | maxMemDepth |
int | minsToStopAfter |
bool | noBranchSimplify |
bool | noChangeSignatures |
bool | noDataflow |
bool | noDecodeChildren |
bool | noDecompile |
bool | noGlobals |
bool | noLocals |
bool | noParameterNames |
bool | noPromote |
bool | noProve |
bool | noRemoveLabels |
bool | noRemoveNull |
bool | noRemoveReturns |
int | numToPropagate |
std::ofstream * | ofsIndCallReport |
bool | printAST |
bool | printRtl |
int | propMaxDepth |
Max depth of expression that will be propagated to more than one dest. | |
bool | propOnlyToAll |
bool | saveBeforeDecompile |
bool | stopAtDebugPoints |
bool | stopBeforeDecompile |
std::vector< std::string > | symbolFiles |
A vector containing the names off all symbolfiles to load. | |
std::map< ADDRESS, std::string > | symbols |
A map to find a name by a given address. | |
bool | traceDecoder |
bool | vFlag |
Private Member Functions | |
Boomerang () | |
Initializes the Boomerang object. | |
int | cmdLine () |
Displays a command line and processes the commands entered. | |
void | help () |
Prints help about the command line switches. | |
void | helpcmd () |
Prints help for the interactive mode. | |
int | parseCmd (int argc, const char **argv) |
Parse and execute a command supplied in interactive mode. | |
int | splitLine (char *line, char ***pargv) |
Splits a string up in different words. | |
void | usage () |
Prints a short usage statement. | |
virtual | ~Boomerang () |
The destructor is virtual to force this object to be created on the heap (with new). | |
Private Attributes | |
Log * | logger |
Takes care of the log messages. | |
std::string | outputPath |
The path where all output files are created. | |
std::string | progPath |
String with the path to the boomerang executable. | |
std::set< Watcher * > | watchers |
The watchers which are interested in this decompilation. | |
Static Private Attributes | |
static Boomerang * | boomerang = NULL |
|
Initializes the Boomerang object. The default settings are:
Definition at line 42 of file testExpStubs.cpp. Referenced by get(). |
|
The destructor is virtual to force this object to be created on the heap (with new).
Definition at line 117 of file boomerang.h. |
|
Add a Watcher to the set of Watchers for this Boomerang object.
Definition at line 148 of file boomerang.h. References watchers. Referenced by DecompilerThread::run(). |
|
Alert the watchers of a bad decode of an instruction at pc.
Definition at line 180 of file boomerang.h. References watchers. Referenced by FrontEnd::processProc(). |
|
Alert the watchers that decompilation has completed.
Definition at line 155 of file boomerang.h. References watchers. |
|
Definition at line 232 of file boomerang.h. References watchers. Referenced by UserProc::decompile(). |
|
Alert the watchers we have succesfully decoded this function.
Definition at line 185 of file boomerang.h. References watchers. |
|
Alert the watchers we are currently decoding nBytes bytes at address pc.
Definition at line 175 of file boomerang.h. References watchers. Referenced by FrontEnd::processProc(). |
|
Definition at line 220 of file boomerang.h. References watchers. |
|
Definition at line 224 of file boomerang.h. References watchers. Referenced by UserProc::remUnusedStmtEtc(). |
|
Definition at line 216 of file boomerang.h. References watchers. |
|
|
Definition at line 212 of file boomerang.h. References watchers. Referenced by UserProc::middleDecompile(). |
|
Definition at line 236 of file boomerang.h. References watchers. Referenced by UserProc::fromSSAform(), UserProc::recursionGroupAnalysis(), UserProc::removeRedundantReturns(), UserProc::remUnusedStmtEtc(), and UserProc::updateArguments(). |
|
Alert the watchers we finished decoding.
Definition at line 200 of file boomerang.h. References watchers. |
|
Definition at line 228 of file boomerang.h. References watchers. |
|
Alert the watchers we have loaded the Proc.
Definition at line 190 of file boomerang.h. References watchers. |
|
Alert the watchers we have found a new Proc.
Definition at line 160 of file boomerang.h. References watchers. Referenced by FrontEnd::processProc(). |
|
Definition at line 208 of file boomerang.h. References watchers. Referenced by UserProc::setStatus(). |
|
Alert the watchers we have removed a Proc.
Definition at line 165 of file boomerang.h. References watchers. Referenced by Prog::removeProc(). |
|
Alert the watchers we are starting to decode.
Definition at line 195 of file boomerang.h. References watchers. Referenced by FrontEnd::decode(). |
|
Definition at line 204 of file boomerang.h. References watchers. Referenced by UserProc::initialiseDecompile(). |
|
Alert the watchers we have updated this Procs signature.
Definition at line 170 of file boomerang.h. References watchers. Referenced by Prog::rereadLibSignatures(). |
|
Displays a command line and processes the commands entered.
Definition at line 643 of file boomerang.cpp. References parseCmd(), and splitLine(). |
|
The main function for the command line mode. Parses switches and runs decompile(filename).
Definition at line 664 of file boomerang.cpp. References addr(), assumeABI, conTypeAnalysis, debugDecoder, debugGen, debugLiveness, debugProof, debugSwitch, debugTA, debugUnused, decodeMain, decodeThruIndCall, dfaTypeAnalysis, dotFile, dumpXML, entrypoints, experimental, generateCallGraph, generateSymbols, getOutputPath(), help(), helpcmd(), loadBeforeDecompile, maxMemDepth, minsToStopAfter, noBranchSimplify, noDataflow, noDecodeChildren, noDecompile, noGlobals, noLocals, noParameterNames, noPromote, noRemoveLabels, noRemoveNull, noRemoveReturns, numToPropagate, ofsIndCallReport, outputPath, printAST, printRtl, progPath, propMaxDepth, propOnlyToAll, saveBeforeDecompile, stopAtDebugPoints, stopBeforeDecompile, symbolFiles, symbols, traceDecoder, usage(), VERSION, and vFlag. |
|
The program will be subsequently be loaded, decoded, decompiled and written to a source file. After decompilation the elapsed time is printed to std::cerr.
Definition at line 1119 of file boomerang.cpp. References Prog::decompile(), dotFile, Prog::generateDotFile(), Prog::getFirstProc(), Prog::getNextProc(), loadAndDecode(), loadBeforeDecompile, minsToStopAfter, NULL, XMLProgParser::parse(), XMLProgParser::persistToXML(), printAST, saveBeforeDecompile, stopBeforeDecompile, and stopProcess(). |
|
|
Returns the HLLCode for the given proc.
Definition at line 27 of file testRtlStubs.cpp. Referenced by Prog::generateCode(). |
|
Returns the path to where the output files are saved.
Definition at line 143 of file boomerang.h. References outputPath. Referenced by commandLine(), Cluster::makeDirs(), Prog::printCallGraph(), Prog::printCallGraphXML(), and Prog::printSymbolsToFile(). |
|
Get the path to the Boomerang executable.
Definition at line 139 of file boomerang.h. References progPath. Referenced by PentiumDecoder::PentiumDecoder(), PPCDecoder::PPCDecoder(), FrontEnd::readLibraryCatalog(), SparcDecoder::SparcDecoder(), and ST20Decoder::ST20Decoder(). |
|
Definition at line 1282 of file boomerang.cpp. References VERSION. Referenced by MainWindow::on_actionAbout_activated(). |
|
Prints help about the command line switches.
Definition at line 146 of file boomerang.cpp. Referenced by commandLine(). |
|
Prints help for the interactive mode.
Definition at line 118 of file boomerang.cpp. Referenced by commandLine(). |
|
Loads the executable file and decodes it.
Definition at line 1019 of file boomerang.cpp. References FrontEnd::AddSymbol(), FrontEnd::Load(), NULL, Prog::setFrontEnd(), and symbols. Referenced by decompile(), and parseCmd(). |
|
|
|
Returns the Log object associated with the object.
Definition at line 89 of file boomerang.cpp. References logger. |
|
Prints the last lines of the log file.
Definition at line 1230 of file boomerang.cpp. References logger, and Log::tail(). |
|
Adds information about functions and classes from Objective-C modules to the Prog object.
Definition at line 979 of file boomerang.cpp. References Cluster::addChild(), Prog::getRootCluster(), LOG, m, Prog::newProc(), Proc::setCluster(), and VERBOSE. |
|
Parse and execute a command supplied in interactive mode.
Definition at line 297 of file boomerang.cpp. References Prog::decompile(), Prog::findProc(), Proc::isLib(), loadAndDecode(), NULL, outputPath, XMLProgParser::parse(), and XMLProgParser::persistToXML(). Referenced by cmdLine(). |
|
|
|
Definition at line 129 of file boomerang.h. References logger. Referenced by setOutputDirectory(), StatementTest::setUp(), TypeTest::testCompound(), StatementTest::testEmpty(), and DfaTest::testMeetSize(). |
|
Sets the directory in which Boomerang creates its output files. The directory will be created if it doesn't exist.
Definition at line 960 of file boomerang.cpp. References createDirectory(), logger, NULL, outputPath, and setLogger(). Referenced by Decompiler::changeOutputPath(), DecompilerThread::run(), and StatementTest::testEmpty(). |
|
Set the path where the output files are saved.
Definition at line 141 of file boomerang.h. References outputPath. |
|
Set the path to the Boomerang executable.
Definition at line 137 of file boomerang.h. References progPath. |
|
Splits a string up in different words. use like: argc = splitLine(line, &argv);
Definition at line 273 of file boomerang.cpp. References NULL. Referenced by cmdLine(). |
|
Prints a short usage statement.
Definition at line 109 of file boomerang.cpp. Referenced by commandLine(). |
|
Assume ABI compliance.
Definition at line 295 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 92 of file boomerang.h. Referenced by get(). |
|
Definition at line 289 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 279 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 260 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 264 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 283 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 262 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 266 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 284 of file boomerang.h. Referenced by commandLine(). |
|
When true, attempt to decode main, all children, and all procs. decodeMain is set when there are no -e or -E switches given Definition at line 275 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 280 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 290 of file boomerang.h. Referenced by commandLine(), and Decompiler::setUseDFTA(). |
|
The file in which the dotty graph is saved.
Definition at line 256 of file boomerang.h. Referenced by commandLine(), and decompile(). |
|
Definition at line 277 of file boomerang.h. Referenced by commandLine(). |
|
A vector which contains all know entrypoints for the Prog.
Definition at line 268 of file boomerang.h. Referenced by commandLine(). |
|
Activate experimental code. Caution!
Definition at line 296 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 292 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 293 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 285 of file boomerang.h. Referenced by commandLine(), and decompile(). |
|
Takes care of the log messages.
Definition at line 98 of file boomerang.h. Referenced by log(), logTail(), setLogger(), and setOutputDirectory(). |
|
Definition at line 261 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 297 of file boomerang.h. Referenced by commandLine(), and decompile(). |
|
Definition at line 247 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 288 of file boomerang.h. |
|
Definition at line 251 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 282 of file boomerang.h. Referenced by commandLine(), and Decompiler::setNoDecodeChildren(). |
|
Definition at line 252 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 294 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 249 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 263 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 258 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 287 of file boomerang.h. |
|
Definition at line 250 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 248 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 278 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 257 of file boomerang.h. Referenced by commandLine(), and Statement::doPropagateTo(). |
|
Definition at line 281 of file boomerang.h. Referenced by commandLine(). |
|
The path where all output files are created.
Definition at line 96 of file boomerang.h. Referenced by commandLine(), getOutputPath(), parseCmd(), setOutputDirectory(), and setOutputPath(). |
|
Definition at line 276 of file boomerang.h. Referenced by commandLine(), and decompile(). |
|
Definition at line 246 of file boomerang.h. Referenced by commandLine(). |
|
String with the path to the boomerang executable.
Definition at line 94 of file boomerang.h. Referenced by commandLine(), getProgPath(), and setProgPath(). |
|
Max depth of expression that will be propagated to more than one dest.
Definition at line 291 of file boomerang.h. Referenced by commandLine(), and Statement::propagateTo(). |
|
Definition at line 259 of file boomerang.h. Referenced by commandLine(). |
|
Definition at line 286 of file boomerang.h. Referenced by commandLine(), and decompile(). |
|
Definition at line 265 of file boomerang.h. Referenced by alert_decompile_debug_point(), and commandLine(). |
|
Definition at line 253 of file boomerang.h. Referenced by commandLine(), and decompile(). |
|
A vector containing the names off all symbolfiles to load.
Definition at line 270 of file boomerang.h. Referenced by commandLine(). |
|
A map to find a name by a given address.
Definition at line 272 of file boomerang.h. Referenced by commandLine(), and loadAndDecode(). |
|
Definition at line 254 of file boomerang.h. Referenced by commandLine(), SparcFrontEnd::processProc(), and FrontEnd::processProc(). |
|
Definition at line 245 of file boomerang.h. Referenced by commandLine(), and StatementTest::testEmpty(). |
|
The watchers which are interested in this decompilation.
Definition at line 100 of file boomerang.h. Referenced by addWatcher(), alert_baddecode(), alert_complete(), alert_considering(), alert_decode(), alert_decompile_afterPropagate(), alert_decompile_afterRemoveStmts(), alert_decompile_beforePropagate(), alert_decompile_SSADepth(), alert_decompiling(), alert_end_decode(), alert_end_decompile(), alert_load(), alert_new(), alert_proc_status_change(), alert_remove(), alert_start_decode(), alert_start_decompile(), and alert_update_signature(). |