ROSE  0.11.83.1
JvmEngine.h
1 #ifndef ROSE_BinaryAnalysis_Partitioner2_JvmEngine_H
2 #define ROSE_BinaryAnalysis_Partitioner2_JvmEngine_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/Disassembler.h>
7 #include <Rose/BinaryAnalysis/Partitioner2/Partitioner.h>
8 #include <Rose/Progress.h>
9 #include <Rose/Exception.h>
10 #include <stdexcept>
11 
12 namespace Rose {
13 namespace BinaryAnalysis {
14 namespace Partitioner2 {
15 
95 class ROSE_DLL_API JvmEngine: private boost::noncopyable {
96 public:
100  struct Settings {
105  };
106 
108  class Exception: public Rose::Exception {
109  public:
110  Exception(const std::string &mesg)
111  : Rose::Exception(mesg) {}
112  ~Exception() throw () {}
113  };
114 
116  // Internal data structures
118 private:
119 
121  // Data members
123 private:
124  Settings settings_; // Settings for the partitioner.
125  Disassembler *disassembler_; // not ref-counted yet, but don't destroy it since user owns it
126  Progress::Ptr progress_; // optional progress reporting
127 
129  // Constructors
131 public:
134  : disassembler_(nullptr),
135  progress_(Progress::instance()) {
136  init();
137  }
138 
140  explicit JvmEngine(const Settings &settings)
141  : settings_(settings), disassembler_(nullptr),
142  progress_(Progress::instance()) {
143  init();
144  }
145 
146  virtual ~JvmEngine() {}
147 
149  // The very top-level use case
151 public:
176  SgAsmBlock* frontend(int argc, char *argv[],
177  const std::string &purpose, const std::string &description);
178  virtual SgAsmBlock* frontend(const std::vector<std::string> &args,
179  const std::string &purpose, const std::string &description);
182  // Basic top-level steps
185 public:
191  void reset();
192 
219  Sawyer::CommandLine::ParserResult parseCommandLine(int argc, char *argv[],
220  const std::string &purpose, const std::string &description) /*final*/;
221  virtual Sawyer::CommandLine::ParserResult parseCommandLine(const std::vector<std::string> &args,
222  const std::string &purpose, const std::string &description);
243  SgAsmInterpretation* parseContainers(const std::string &fileName) /*final*/;
265  virtual Partitioner partition(const std::vector<std::string> &fileNames = std::vector<std::string>());
266  Partitioner partition(const std::string &fileName) /*final*/;
283  SgAsmBlock* buildAst(const std::vector<std::string> &fileNames = std::vector<std::string>()) /*final*/;
284  SgAsmBlock* buildAst(const std::string &fileName) /*final*/;
287  // Command-line parsing
289  //
290  // top-level: parseCommandLine
292 public:
296  virtual Sawyer::CommandLine::SwitchGroup disassemblerSwitches();
297  static Sawyer::CommandLine::SwitchGroup disassemblerSwitches(DisassemblerSettings&);
303  virtual Sawyer::CommandLine::SwitchGroup partitionerSwitches();
304  static Sawyer::CommandLine::SwitchGroup partitionerSwitches(PartitionerSettings&);
310  virtual Sawyer::CommandLine::SwitchGroup engineSwitches();
311  static Sawyer::CommandLine::SwitchGroup engineSwitches(EngineSettings&);
317  virtual Sawyer::CommandLine::SwitchGroup astConstructionSwitches();
318  static Sawyer::CommandLine::SwitchGroup astConstructionSwitches(AstConstructionSettings&);
322  static std::string specimenNameDocumentation();
323 
335  virtual Sawyer::CommandLine::Parser commandLineParser(const std::string &purpose, const std::string &description);
336 
343  virtual void checkSettings();
344 
346  // Disassembler
348 public:
367  virtual Disassembler* obtainDisassembler(Disassembler *hint=NULL);
371  // Partitioner high-level functions
373  //
374  // top-level: partition
376 public:
380  virtual Partitioner createPartitioner();
381 
387  virtual void runPartitioner(Partitioner&);
388 
389 
391  // Partitioner mid-level functions
392  //
393  // These are the functions called by the partitioner high-level stuff. These are sometimes overridden in subclasses,
394  // although it is more likely that the high-level stuff is overridden.
396 public:
401  virtual void labelAddresses(Partitioner&, const Configuration&);
402 
409  virtual void discoverBasicBlocks(Partitioner&);
410 
412  // Partitioner low-level functions
413  //
414  // These are functions that a subclass seldom overrides, and maybe even shouldn't override because of their complexity or
415  // the way the interact with one another.
417 public:
418 
420  // Build AST
422 public:
423  // Used internally by ROSE's ::frontend disassemble instructions to build the AST that goes under each SgAsmInterpretation.
424  static void disassembleForRoseFrontend(SgAsmInterpretation*);
425 
426 
428  // Settings and properties
430 public:
437  const Settings& settings() const /*final*/ { return settings_; }
438  Settings& settings() /*final*/ { return settings_; }
449  bool exitOnError() const /*final*/ { return settings_.engine.exitOnError; }
450  virtual void exitOnError(bool b) { settings_.engine.exitOnError = b; }
458  Progress::Ptr progress() const /*final*/ { return progress_; }
459  virtual void progress(const Progress::Ptr &progress) { progress_ = progress; }
467  bool doDisassemble() const /*final*/ { return settings_.disassembler.doDisassemble; }
468  virtual void doDisassemble(bool b) { settings_.disassembler.doDisassemble = b; }
477  Disassembler *disassembler() const /*final*/ { return disassembler_; }
478  virtual void disassembler(Disassembler *d) { disassembler_ = d; }
487  const std::string& isaName() const /*final*/ { return settings_.disassembler.isaName; }
488  virtual void isaName(const std::string &s) { settings_.disassembler.isaName = s; }
497  const std::vector<rose_addr_t>& functionStartingVas() const /*final*/ { return settings_.partitioner.functionStartingVas; }
498  std::vector<rose_addr_t>& functionStartingVas() /*final*/ { return settings_.partitioner.functionStartingVas; }
507  bool usingSemantics() const /*final*/ { return settings_.partitioner.base.usingSemantics; }
508  virtual void usingSemantics(bool b) { settings_.partitioner.base.usingSemantics = b; }
519  bool ignoringUnknownInsns() const /*final*/ { return settings_.partitioner.base.ignoringUnknownInsns; }
520  virtual void ignoringUnknownInsns(bool b) { settings_.partitioner.base.ignoringUnknownInsns = b; }
540  size_t maxBasicBlockSize() const /*final*/ { return settings_.partitioner.maxBasicBlockSize; }
541  virtual void maxBasicBlockSize(size_t n) { settings_.partitioner.maxBasicBlockSize = n; }
552  const std::vector<rose_addr_t>& ipRewrites() const /*final*/ { return settings_.partitioner.ipRewrites; }
553  virtual void ipRewrites(const std::vector<rose_addr_t> &v) { settings_.partitioner.ipRewrites = v; }
564  bool findingDeadCode() const /*final*/ { return settings_.partitioner.findingDeadCode; }
565  virtual void findingDeadCode(bool b) { settings_.partitioner.findingDeadCode = b; }
574  rose_addr_t peScramblerDispatcherVa() const /*final*/ { return settings_.partitioner.peScramblerDispatcherVa; }
575  virtual void peScramblerDispatcherVa(rose_addr_t va) { settings_.partitioner.peScramblerDispatcherVa = va; }
585  size_t findingIntraFunctionCode() const /*final*/ { return settings_.partitioner.findingIntraFunctionCode; }
586  virtual void findingIntraFunctionCode(size_t n) { settings_.partitioner.findingIntraFunctionCode = n; }
595  bool findingIntraFunctionData() const /*final*/ { return settings_.partitioner.findingIntraFunctionData; }
596  virtual void findingIntraFunctionData(bool b) { settings_.partitioner.findingIntraFunctionData = b; }
605  const AddressInterval& interruptVector() const /*final*/ { return settings_.partitioner.interruptVector; }
606  virtual void interruptVector(const AddressInterval &i) { settings_.partitioner.interruptVector = i; }
615  bool doingPostAnalysis() const /*final*/ { return settings_.partitioner.doingPostAnalysis; }
616  virtual void doingPostAnalysis(bool b) { settings_.partitioner.doingPostAnalysis = b; }
624  bool doingPostFunctionMayReturn() const /*final*/ { return settings_.partitioner.doingPostFunctionMayReturn; }
625  virtual void doingPostFunctionMayReturn(bool b) { settings_.partitioner.doingPostFunctionMayReturn = b; }
633  bool doingPostFunctionStackDelta() const /*final*/ { return settings_.partitioner.doingPostFunctionStackDelta; }
642  bool doingPostCallingConvention() const /*final*/ { return settings_.partitioner.doingPostCallingConvention; }
643  virtual void doingPostCallingConvention(bool b) { settings_.partitioner.doingPostCallingConvention = b; }
652  bool doingPostFunctionNoop() const /*final*/ { return settings_.partitioner.doingPostFunctionNoop; }
653  virtual void doingPostFunctionNoop(bool b) { settings_.partitioner.doingPostFunctionNoop = b; }
678  size_t functionReturnAnalysisMaxSorts() const /*final*/ { return settings_.partitioner.functionReturnAnalysisMaxSorts; }
688  bool findingInterFunctionCalls() const /*final*/ { return settings_.partitioner.findingInterFunctionCalls; }
689  virtual void findingInterFunctionCalls(bool b) { settings_.partitioner.findingInterFunctionCalls = b; }
698  bool findingFunctionCallFunctions() const /*final*/ { return settings_.partitioner.findingFunctionCallFunctions; }
707  bool findingEntryFunctions() const /*final*/ { return settings_.partitioner.findingEntryFunctions; }
708  virtual void findingEntryFunctions(bool b) { settings_.partitioner.findingEntryFunctions = b; }
717  bool findingErrorFunctions() const /*final*/ { return settings_.partitioner.findingErrorFunctions; }
718  virtual void findingErrorFunctions(bool b) { settings_.partitioner.findingErrorFunctions = b; }
727  bool findingImportFunctions() const /*final*/ { return settings_.partitioner.findingImportFunctions; }
728  virtual void findingImportFunctions(bool b) { settings_.partitioner.findingImportFunctions = b; }
737  bool findingExportFunctions() const /*final*/ { return settings_.partitioner.findingExportFunctions; }
738  virtual void findingExportFunctions(bool b) { settings_.partitioner.findingExportFunctions = b; }
747  bool findingSymbolFunctions() const /*final*/ { return settings_.partitioner.findingSymbolFunctions; }
748  virtual void findingSymbolFunctions(bool b) { settings_.partitioner.findingSymbolFunctions = b; }
757  bool findingDataFunctionPointers() const /*final*/ { return settings_.partitioner.findingDataFunctionPointers; }
767  bool findingCodeFunctionPointers() const /*final*/ { return settings_.partitioner.findingCodeFunctionPointers; }
776  bool checkingCallBranch() const /*final*/ { return settings_.partitioner.base.checkingCallBranch; }
777  virtual void checkingCallBranch(bool b) { settings_.partitioner.base.checkingCallBranch = b; }
791  bool basicBlockSemanticsAutoDrop() const /*final*/ { return settings_.partitioner.base.basicBlockSemanticsAutoDrop; }
800  const std::vector<std::string>& configurationNames() /*final*/ const { return settings_.engine.configurationNames; }
801  std::vector<std::string>& configurationNames() /*final*/ { return settings_.engine.configurationNames; }
809  bool namingConstants() const /*final*/ { return settings_.partitioner.namingConstants; }
810  virtual void namingConstants(bool b) { settings_.partitioner.namingConstants = b; }
820  const AddressInterval& namingStrings() const /*final*/ { return settings_.partitioner.namingStrings; }
821  void namingStrings(const AddressInterval &where) { settings_.partitioner.namingStrings = where; }
830  bool namingSystemCalls() const /*final*/ { return settings_.partitioner.namingSyscalls; }
831  virtual void namingSystemCalls(bool b) { settings_.partitioner.namingSyscalls = b; }
841  const boost::filesystem::path& systemCallHeader() const /*final*/ { return settings_.partitioner.syscallHeader; }
842  virtual void systemCallHeader(const boost::filesystem::path &filename) { settings_.partitioner.syscallHeader = filename; }
851  bool demangleNames() const /*final*/ { return settings_.partitioner.demangleNames; }
852  virtual void demangleNames(bool b) { settings_.partitioner.demangleNames = b; }
861  bool astAllowEmptyGlobalBlock() const /*final*/ { return settings_.astConstruction.allowEmptyGlobalBlock; }
862  virtual void astAllowEmptyGlobalBlock(bool b) { settings_.astConstruction.allowEmptyGlobalBlock = b; }
871  bool astAllowFunctionWithNoBasicBlocks() const /*final*/ {
873  }
874  virtual void astAllowFunctionWithNoBasicBlocks(bool b) {
876  }
885  bool astAllowEmptyBasicBlock() const /*final*/ { return settings_.astConstruction.allowEmptyBasicBlocks; }
886  virtual void astAllowEmptyBasicBlock(bool b) { settings_.astConstruction.allowEmptyBasicBlocks = b; }
898  bool astCopyAllInstructions() const /*final*/ { return settings_.astConstruction.copyAllInstructions; }
899  virtual void astCopyAllInstructions(bool b) { settings_.astConstruction.copyAllInstructions = b; }
902  // Python API support functions
905 #ifdef ROSE_ENABLE_PYTHON_API
906 
907  // Similar to frontend, but returns a partitioner rather than an AST since the Python API doesn't yet support ASTs.
908  Partitioner pythonParseVector(boost::python::list &pyArgs, const std::string &purpose, const std::string &description);
909  Partitioner pythonParseSingle(const std::string &specimen, const std::string &purpose, const std::string &description);
910 
911 #endif
912 
914  // Internal stuff
916 private:
917  void init();
918 
919  // Similar to ::frontend but a lot less complicated.
920  SgProject* roseFrontendReplacement(const std::vector<boost::filesystem::path> &fileNames);
921 };
922 
924 // JVM Module
926 
928 namespace ModulesJvm {
929 
934 bool isJavaClassFile(const boost::filesystem::path&);
935 
936 } // namespace
937 
938 } // namespace
939 } // namespace
940 } // namespace
941 
942 #endif
943 #endif
bool findingInterFunctionCalls
Look for function calls between functions.
const AddressInterval & namingStrings() const
Property: Addresses where strings might start.
Definition: JvmEngine.h:820
Settings & settings()
Property: All settings.
Definition: JvmEngine.h:438
bool doingPostFunctionNoop() const
Property: Whether to run no-op function analysis.
Definition: JvmEngine.h:652
const boost::filesystem::path & systemCallHeader() const
Property: Header file in which system calls are defined.
Definition: JvmEngine.h:841
bool usingSemantics() const
Property: Whether to use instruction semantics.
Definition: JvmEngine.h:507
Class for the JVM engine driving the partitioner.
Definition: JvmEngine.h:95
virtual void doingPostCallingConvention(bool b)
Property: Whether to run calling-convention analysis.
Definition: JvmEngine.h:643
void basicBlockSemanticsAutoDrop(bool b)
Property: Automatically drop semantics for attached basic blocks.
Definition: JvmEngine.h:792
const AddressInterval & interruptVector() const
Property: Location of machine interrupt vector.
Definition: JvmEngine.h:605
Settings for controling the engine behavior.
bool findingCodeFunctionPointers() const
Property: Whether to search existing instructions for function pointers.
Definition: JvmEngine.h:767
bool findingExportFunctions
Create functions at export addresses.
size_t maxBasicBlockSize() const
Property: Maximum size for basic blocks.
Definition: JvmEngine.h:540
bool findingDataFunctionPointers
Look for function pointers in static data.
bool findingFunctionCallFunctions() const
Property: Whether to turn function call targets into functions.
Definition: JvmEngine.h:698
Instruction basic block.
virtual void maxBasicBlockSize(size_t n)
Property: Maximum size for basic blocks.
Definition: JvmEngine.h:541
bool findingSymbolFunctions() const
Property: Whether to make functions according to symbol tables.
Definition: JvmEngine.h:747
rose_addr_t peScramblerDispatcherVa() const
Property: PE-Scrambler dispatcher address.
Definition: JvmEngine.h:574
std::string isaName
Name of the instruction set architecture.
bool doingPostFunctionStackDelta
Run function-stack-delta analysis if doingPostAnalysis is set?
bool findingImportFunctions() const
Property: Whether to make functions at import addresses.
Definition: JvmEngine.h:727
virtual void doDisassemble(bool b)
Property: Perform disassembly.
Definition: JvmEngine.h:468
virtual void interruptVector(const AddressInterval &i)
Property: Location of machine interrupt vector.
Definition: JvmEngine.h:606
rose_addr_t peScramblerDispatcherVa
Run the PeDescrambler module if non-zero.
virtual void namingSystemCalls(bool b)
Property: Give names to system calls.
Definition: JvmEngine.h:831
bool doingPostFunctionMayReturn() const
Property: Whether to run the function may-return analysis.
Definition: JvmEngine.h:624
AddressInterval namingStrings
Addresses that might be string literals for commenting integers.
bool copyAllInstructions
Whether to allow shared instructions in the AST.
bool findingDeadCode() const
Property: Whether to find dead code.
Definition: JvmEngine.h:564
Disassembler * disassembler() const
Property: Disassembler.
Definition: JvmEngine.h:477
The result from parsing a command line.
virtual void astCopyAllInstructions(bool b)
Property: Whether to copy instructions when building the AST.
Definition: JvmEngine.h:899
FunctionReturnAnalysis functionReturnAnalysis() const
Property: Whether to run the function may-return analysis.
Definition: JvmEngine.h:662
const std::vector< rose_addr_t > & ipRewrites() const
Property: CFG edge rewrite pairs.
Definition: JvmEngine.h:552
bool findingExportFunctions() const
Property: Whether to make functions at export addresses.
Definition: JvmEngine.h:737
const std::string & isaName() const
Property: Instruction set architecture name.
Definition: JvmEngine.h:487
virtual void exitOnError(bool b)
Property: Error handling.
Definition: JvmEngine.h:450
bool findingDataFunctionPointers() const
Property: Whether to search static data for function pointers.
Definition: JvmEngine.h:757
bool doDisassemble() const
Property: Perform disassembly.
Definition: JvmEngine.h:467
bool demangleNames() const
Property: Demangle names.
Definition: JvmEngine.h:851
virtual void functionReturnAnalysis(FunctionReturnAnalysis x)
Property: Whether to run the function may-return analysis.
Definition: JvmEngine.h:663
A collection of related switch declarations.
bool doingPostFunctionNoop
Find and name functions that are effectively no-ops.
bool checkingCallBranch() const
Property: Whether to look for function calls used as branches.
Definition: JvmEngine.h:776
size_t findingIntraFunctionCode() const
Property: Whether to find intra-function code.
Definition: JvmEngine.h:585
virtual void findingInterFunctionCalls(bool b)
Property: Whether to search for function calls between exiting functions.
Definition: JvmEngine.h:689
bool namingSyscalls
Give names (comments) to system calls if possible.
Main namespace for the ROSE library.
bool doingPostCallingConvention
Run calling-convention analysis if doingPostAnalysis is set?
virtual void doingPostFunctionNoop(bool b)
Property: Whether to run no-op function analysis.
Definition: JvmEngine.h:653
std::vector< rose_addr_t > functionStartingVas
Addresses at which to start recursive disassembly.
virtual void astAllowFunctionWithNoBasicBlocks(bool b)
Property: Whether to allow empty functions in the AST.
Definition: JvmEngine.h:874
bool exitOnError() const
Property: Error handling.
Definition: JvmEngine.h:449
std::vector< rose_addr_t > & functionStartingVas()
Property: Starting addresses for disassembly.
Definition: JvmEngine.h:498
bool doingPostCallingConvention() const
Property: Whether to run calling-convention analysis.
Definition: JvmEngine.h:642
virtual void ipRewrites(const std::vector< rose_addr_t > &v)
Property: CFG edge rewrite pairs.
Definition: JvmEngine.h:553
size_t functionReturnAnalysisMaxSorts() const
Property: Maximum number of function may-return sorting operations.
Definition: JvmEngine.h:678
virtual void findingExportFunctions(bool b)
Property: Whether to make functions at export addresses.
Definition: JvmEngine.h:738
bool allowEmptyGlobalBlock
Whether to allow an empty global block.
AstConstructionSettings astConstruction
Settings for constructing the AST.
Definition: JvmEngine.h:104
virtual void doingPostFunctionMayReturn(bool b)
Property: Whether to run the function may-return analysis.
Definition: JvmEngine.h:625
virtual void usingSemantics(bool b)
Property: Whether to use instruction semantics.
Definition: JvmEngine.h:508
std::vector< std::string > & configurationNames()
Property: Configuration files.
Definition: JvmEngine.h:801
size_t functionReturnAnalysisMaxSorts
Number of times functions are sorted before using unsorted lists.
bool basicBlockSemanticsAutoDrop() const
Property: Automatically drop semantics for attached basic blocks.
Definition: JvmEngine.h:791
FunctionReturnAnalysis functionReturnAnalysis
How to run the function may-return analysis.
bool demangleNames
Run all names through a demangling step.
Progress::Ptr progress() const
Property: progress reporting.
Definition: JvmEngine.h:458
std::vector< std::string > configurationNames
List of configuration files and/or directories.
std::vector< rose_addr_t > ipRewrites
Pairs of addresses for rewriting CFG edges.
virtual void findingImportFunctions(bool b)
Property: Whether to make functions at import addresses.
Definition: JvmEngine.h:728
virtual void findingSymbolFunctions(bool b)
Property: Whether to make functions according to symbol tables.
Definition: JvmEngine.h:748
bool doingPostFunctionMayReturn
Run function-may-return analysis if doingPostAnalysis is set?
The parser for a program command line.
bool ignoringUnknownInsns
Whether to ignore unkonwn insns when extending basic blocks.
const std::vector< std::string > & configurationNames() const
Property: Configuration files.
Definition: JvmEngine.h:800
bool findingErrorFunctions
Create functions from error handling and exception information.
Settings that control the engine partitioning.
virtual void doingPostFunctionStackDelta(bool b)
Property: Whether to run the function stack delta analysis.
Definition: JvmEngine.h:634
bool astCopyAllInstructions() const
Property: Whether to copy instructions when building the AST.
Definition: JvmEngine.h:898
bool doingPostAnalysis
Perform enabled post-partitioning analyses?
SemanticMemoryParadigm semanticMemoryParadigm() const
Property: Type of container for semantic memory.
Definition: JvmEngine.h:529
size_t findingIntraFunctionCode
Suck up unused addresses as intra-function code (number of passes).
PartitionerSettings partitioner
Settings for creating a partitioner.
Definition: JvmEngine.h:102
virtual void systemCallHeader(const boost::filesystem::path &filename)
Property: Header file in which system calls are defined.
Definition: JvmEngine.h:842
bool findingImportFunctions
Create functions at import addresses.
virtual void doingPostAnalysis(bool b)
Property: Whether to perform post-partitioning analysis steps.
Definition: JvmEngine.h:616
bool astAllowEmptyBasicBlock() const
Property: Whether to allow empty basic blocks in the AST.
Definition: JvmEngine.h:885
SemanticMemoryParadigm
Organization of semantic memory.
virtual void peScramblerDispatcherVa(rose_addr_t va)
Property: PE-Scrambler dispatcher address.
Definition: JvmEngine.h:575
EngineSettings engine
Settings that control engine behavior.
Definition: JvmEngine.h:103
bool astAllowEmptyGlobalBlock() const
Property: Whether to allow empty global block in the AST.
Definition: JvmEngine.h:861
virtual void functionReturnAnalysisMaxSorts(size_t n)
Property: Maximum number of function may-return sorting operations.
Definition: JvmEngine.h:679
const std::vector< rose_addr_t > & functionStartingVas() const
Property: Starting addresses for disassembly.
Definition: JvmEngine.h:497
virtual void namingConstants(bool b)
Property: Give names to constants.
Definition: JvmEngine.h:810
bool findingInterFunctionCalls() const
Property: Whether to search for function calls between exiting functions.
Definition: JvmEngine.h:688
virtual void semanticMemoryParadigm(SemanticMemoryParadigm p)
Property: Type of container for semantic memory.
Definition: JvmEngine.h:530
FunctionReturnAnalysis
Controls whether the function may-return analysis runs.
bool namingSystemCalls() const
Property: Give names to system calls.
Definition: JvmEngine.h:830
virtual void isaName(const std::string &s)
Property: Instruction set architecture name.
Definition: JvmEngine.h:488
bool findingIntraFunctionData() const
Property: Whether to find intra-function data.
Definition: JvmEngine.h:595
bool findingEntryFunctions
Create functions at the program entry point(s).
virtual void findingIntraFunctionData(bool b)
Property: Whether to find intra-function data.
Definition: JvmEngine.h:596
JvmEngine(const Settings &settings)
Construct engine with settings.
Definition: JvmEngine.h:140
SemanticMemoryParadigm semanticMemoryParadigm
Container used for semantic memory states.
virtual void findingCodeFunctionPointers(bool b)
Property: Whether to search existing instructions for function pointers.
Definition: JvmEngine.h:768
virtual void findingFunctionCallFunctions(bool b)
Property: Whether to turn function call targets into functions.
Definition: JvmEngine.h:699
bool doingPostAnalysis() const
Property: Whether to perform post-partitioning analysis steps.
Definition: JvmEngine.h:615
DisassemblerSettings disassembler
Settings for creating the disassembler.
Definition: JvmEngine.h:101
virtual void disassembler(Disassembler *d)
Property: Disassembler.
Definition: JvmEngine.h:478
bool checkingCallBranch
Check for situations where CALL is used as a branch.
virtual void ignoringUnknownInsns(bool b)
Property: Whether unknown instructions are ignored.
Definition: JvmEngine.h:520
bool allowEmptyBasicBlocks
Whether to allow a basic block to be empty.
bool usingSemantics
Whether instruction semantics are used.
A general, thread-safe way to report progress made on some task.
virtual void progress(const Progress::Ptr &progress)
Property: progress reporting.
Definition: JvmEngine.h:459
virtual void checkingCallBranch(bool b)
Property: Whether to look for function calls used as branches.
Definition: JvmEngine.h:777
bool findingSymbolFunctions
Create functions according to symbol tables.
bool exitOnError
If true, emit error message and exit non-zero, else throw.
bool namingConstants() const
Property: Give names to constants.
Definition: JvmEngine.h:809
bool basicBlockSemanticsAutoDrop
Conserve memory by dropping semantics for attached basic blocks.
virtual void astAllowEmptyGlobalBlock(bool b)
Property: Whether to allow empty global block in the AST.
Definition: JvmEngine.h:862
virtual void findingIntraFunctionCode(size_t n)
Property: Whether to find intra-function code.
Definition: JvmEngine.h:586
virtual void findingDataFunctionPointers(bool b)
Property: Whether to search static data for function pointers.
Definition: JvmEngine.h:758
bool namingConstants
Give names to constants by calling Modules::nameConstants.
virtual void findingErrorFunctions(bool b)
Property: Whether to make error handling functions.
Definition: JvmEngine.h:718
void namingStrings(const AddressInterval &where)
Property: Addresses where strings might start.
Definition: JvmEngine.h:821
virtual void demangleNames(bool b)
Property: Demangle names.
Definition: JvmEngine.h:852
This class represents a source project, with a list of SgFile objects and global information about th...
bool findingCodeFunctionPointers
Look for function pointers in instructions.
bool findingIntraFunctionData
Suck up unused addresses as intra-function data.
virtual void astAllowEmptyBasicBlock(bool b)
Property: Whether to allow empty basic blocks in the AST.
Definition: JvmEngine.h:886
Partitions instructions into basic blocks and functions.
Definition: Partitioner.h:289
Base class for all ROSE exceptions.
Definition: Rose/Exception.h:9
bool allowFunctionWithNoBasicBlocks
Whether to allow functions with no basic blocks.
bool isJavaClassFile(const boost::filesystem::path &)
True if named file is a Java class file.
AddressInterval interruptVector
Table of interrupt handling functions.
virtual void findingDeadCode(bool b)
Property: Whether to find dead code.
Definition: JvmEngine.h:565
Represents an interpretation of a binary container.
Virtual base class for instruction disassemblers.
Definition: Disassembler.h:50
bool findingFunctionCallFunctions
Create functions from function calls.
bool findingErrorFunctions() const
Property: Whether to make error handling functions.
Definition: JvmEngine.h:717
bool doingPostFunctionStackDelta() const
Property: Whether to run the function stack delta analysis.
Definition: JvmEngine.h:633
boost::filesystem::path syscallHeader
Name of header file containing system call numbers.
virtual void findingEntryFunctions(bool b)
Property: Whether to make functions at program entry points.
Definition: JvmEngine.h:708
bool findingEntryFunctions() const
Property: Whether to make functions at program entry points.
Definition: JvmEngine.h:707
const Settings & settings() const
Property: All settings.
Definition: JvmEngine.h:437
bool astAllowFunctionWithNoBasicBlocks() const
Property: Whether to allow empty functions in the AST.
Definition: JvmEngine.h:871
bool ignoringUnknownInsns() const
Property: Whether unknown instructions are ignored.
Definition: JvmEngine.h:519