1 #ifndef ROSE_BinaryAnalysis_Partitioner2_EngineJvm_H
2 #define ROSE_BinaryAnalysis_Partitioner2_EngineJvm_H
4 #include <Rose/BinaryAnalysis/Partitioner2/Engine.h>
6 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
9 namespace BinaryAnalysis {
10 namespace Partitioner2 {
91 class ROSE_DLL_API
EngineJvm:
private boost::noncopyable {
165 const std::string &purpose,
const std::string &description);
166 virtual SgAsmBlock* frontend(
const std::vector<std::string> &args,
167 const std::string &purpose,
const std::string &description);
208 const std::string &purpose,
const std::string &description) ;
210 const std::string &purpose,
const std::string &description);
253 virtual Partitioner partition(
const std::vector<std::string> &fileNames = std::vector<std::string>());
254 Partitioner partition(
const std::string &fileName) ;
271 SgAsmBlock* buildAst(
const std::vector<std::string> &fileNames = std::vector<std::string>()) ;
272 SgAsmBlock* buildAst(
const std::string &fileName) ;
310 static std::string specimenNameDocumentation();
331 virtual void checkSettings();
466 virtual
void disassembler(const Disassembler::BasePtr&);
893 #ifdef ROSE_ENABLE_PYTHON_API
896 Partitioner pythonParseVector(boost::python::list &pyArgs,
const std::string &purpose,
const std::string &description);
897 Partitioner pythonParseSingle(
const std::string &specimen,
const std::string &purpose,
const std::string &description);
908 SgProject* roseFrontendReplacement(
const std::vector<boost::filesystem::path> &fileNames);
916 namespace ModulesJvm {
bool findingInterFunctionCalls
Look for function calls between functions.
virtual void namingSystemCalls(bool b)
Property: Give names to system calls.
bool doDisassemble() const
Property: Perform disassembly.
virtual void findingImportFunctions(bool b)
Property: Whether to make functions at import addresses.
virtual void semanticMemoryParadigm(SemanticMemoryParadigm p)
Property: Type of container for semantic memory.
Settings for controling the engine behavior.
bool findingExportFunctions
Create functions at export addresses.
DisassemblerSettings disassembler
Settings for creating the disassembler.
bool findingDataFunctionPointers
Look for function pointers in static data.
virtual void astAllowFunctionWithNoBasicBlocks(bool b)
Property: Whether to allow empty functions in the AST.
virtual void findingIntraFunctionData(bool b)
Property: Whether to find intra-function data.
std::string isaName
Name of the instruction set architecture.
bool doingPostFunctionStackDelta
Run function-stack-delta analysis if doingPostAnalysis is set?
virtual void astAllowEmptyBasicBlock(bool b)
Property: Whether to allow empty basic blocks in the AST.
virtual void astAllowEmptyGlobalBlock(bool b)
Property: Whether to allow empty global block in the AST.
bool astAllowEmptyBasicBlock() const
Property: Whether to allow empty basic blocks in the AST.
rose_addr_t peScramblerDispatcherVa
Run the PeDescrambler module if non-zero.
virtual void checkingCallBranch(bool b)
Property: Whether to look for function calls used as branches.
Settings that control the disassembler.
bool findingIntraFunctionData() const
Property: Whether to find intra-function data.
bool findingExportFunctions() const
Property: Whether to make functions at export addresses.
AddressInterval namingStrings
Addresses that might be string literals for commenting integers.
bool copyAllInstructions
Whether to allow shared instructions in the AST.
AddressInterval namingConstants
Give possible names to constants if they're in this range.
virtual void ignoringUnknownInsns(bool b)
Property: Whether unknown instructions are ignored.
const boost::filesystem::path & systemCallHeader() const
Property: Header file in which system calls are defined.
The result from parsing a command line.
bool findingSymbolFunctions() const
Property: Whether to make functions according to symbol tables.
virtual void functionReturnAnalysis(FunctionReturnAnalysis x)
Property: Whether to run the function may-return analysis.
bool astCopyAllInstructions() const
Property: Whether to copy instructions when building the AST.
virtual void peScramblerDispatcherVa(rose_addr_t va)
Property: PE-Scrambler dispatcher address.
bool doingPostFunctionNoop() const
Property: Whether to run no-op function analysis.
A collection of related switch declarations.
bool doingPostFunctionNoop
Find and name functions that are effectively no-ops.
bool basicBlockSemanticsAutoDrop() const
Property: Automatically drop semantics for attached basic blocks.
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 astCopyAllInstructions(bool b)
Property: Whether to copy instructions when building the AST.
bool ignoringUnknownInsns() const
Property: Whether unknown instructions are ignored.
std::vector< rose_addr_t > functionStartingVas
Addresses at which to start recursive disassembly.
Settings that control building the AST.
bool namingSystemCalls() const
Property: Give names to system calls.
bool demangleNames() const
Property: Demangle names.
const std::vector< rose_addr_t > & functionStartingVas() const
Property: Starting addresses for disassembly.
bool allowEmptyGlobalBlock
Whether to allow an empty global block.
SemanticMemoryParadigm semanticMemoryParadigm() const
Property: Type of container for semantic memory.
virtual void ipRewrites(const std::vector< rose_addr_t > &v)
Property: CFG edge rewrite pairs.
virtual void findingErrorFunctions(bool b)
Property: Whether to make error handling functions.
virtual void isaName(const std::string &s)
Property: Instruction set architecture name.
virtual void progress(const Progress::Ptr &progress)
Property: progress reporting.
rose_addr_t peScramblerDispatcherVa() const
Property: PE-Scrambler dispatcher address.
bool doingPostFunctionStackDelta() const
Property: Whether to run the function stack delta analysis.
size_t functionReturnAnalysisMaxSorts
Number of times functions are sorted before using unsorted lists.
size_t findingIntraFunctionCode() const
Property: Whether to find intra-function code.
FunctionReturnAnalysis functionReturnAnalysis
How to run the function may-return analysis.
bool demangleNames
Run all names through a demangling step.
std::vector< std::string > configurationNames
List of configuration files and/or directories.
virtual void findingExportFunctions(bool b)
Property: Whether to make functions at export addresses.
virtual void findingDeadCode(bool b)
Property: Whether to find dead code.
const std::vector< rose_addr_t > & ipRewrites() const
Property: CFG edge rewrite pairs.
std::vector< rose_addr_t > ipRewrites
Pairs of addresses for rewriting CFG edges.
bool findingEntryFunctions() const
Property: Whether to make functions at program entry points.
virtual void findingCodeFunctionPointers(bool b)
Property: Whether to search existing instructions for function pointers.
const AddressInterval & namingStrings() const
Property: Addresses where strings might start.
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.
virtual void interruptVector(const AddressInterval &i)
Property: Location of machine interrupt vector.
bool findingErrorFunctions
Create functions from error handling and exception information.
bool doingPostCallingConvention() const
Property: Whether to run calling-convention analysis.
Progress::Ptr progress() const
Property: progress reporting.
void basicBlockSemanticsAutoDrop(bool b)
Property: Automatically drop semantics for attached basic blocks.
Settings that control the engine partitioning.
bool findingCodeFunctionPointers() const
Property: Whether to search existing instructions for function pointers.
const AddressInterval & interruptVector() const
Property: Location of machine interrupt vector.
bool doingPostAnalysis
Perform enabled post-partitioning analyses?
bool namingConstants() const
Property: Give names to constants.
size_t findingIntraFunctionCode
Suck up unused addresses as intra-function code (number of passes).
virtual void findingEntryFunctions(bool b)
Property: Whether to make functions at program entry points.
virtual void doingPostCallingConvention(bool b)
Property: Whether to run calling-convention analysis.
bool findingImportFunctions
Create functions at import addresses.
SemanticMemoryParadigm
Organization of semantic memory.
virtual void findingIntraFunctionCode(size_t n)
Property: Whether to find intra-function code.
bool findingDataFunctionPointers() const
Property: Whether to search static data for function pointers.
PartitionerSettings partitioner
Settings for creating a partitioner.
virtual void doingPostFunctionMayReturn(bool b)
Property: Whether to run the function may-return analysis.
bool checkingCallBranch() const
Property: Whether to look for function calls used as branches.
virtual void usingSemantics(bool b)
Property: Whether to use instruction semantics.
FunctionReturnAnalysis
Controls whether the function may-return analysis runs.
bool findingEntryFunctions
Create functions at the program entry point(s).
virtual void findingFunctionCallFunctions(bool b)
Property: Whether to turn function call targets into functions.
bool findingDeadCode
Look for unreachable basic blocks?
const std::vector< std::string > & configurationNames() const
Property: Configuration files.
virtual void systemCallHeader(const boost::filesystem::path &filename)
Property: Header file in which system calls are defined.
virtual void namingConstants(bool b)
Property: Give names to constants.
SemanticMemoryParadigm semanticMemoryParadigm
Container used for semantic memory states.
size_t maxBasicBlockSize() const
Property: Maximum size for basic blocks.
EngineSettings engine
Settings that control engine behavior.
virtual void doDisassemble(bool b)
Property: Perform disassembly.
const Settings & settings() const
Property: All settings.
virtual void doingPostAnalysis(bool b)
Property: Whether to perform post-partitioning analysis steps.
virtual void demangleNames(bool b)
Property: Demangle names.
bool doingPostFunctionMayReturn() const
Property: Whether to run the function may-return analysis.
bool doDisassemble
Perform disassembly.
virtual void findingSymbolFunctions(bool b)
Property: Whether to make functions according to symbol tables.
bool checkingCallBranch
Check for situations where CALL is used as a branch.
bool allowEmptyBasicBlocks
Whether to allow a basic block to be empty.
bool usingSemantics
Whether instruction semantics are used.
bool findingSymbolFunctions
Create functions according to symbol tables.
bool exitOnError
If true, emit error message and exit non-zero, else throw.
bool basicBlockSemanticsAutoDrop
Conserve memory by dropping semantics for attached basic blocks.
std::vector< std::string > & configurationNames()
Property: Configuration files.
virtual void findingDataFunctionPointers(bool b)
Property: Whether to search static data for function pointers.
bool findingFunctionCallFunctions() const
Property: Whether to turn function call targets into functions.
bool astAllowFunctionWithNoBasicBlocks() const
Property: Whether to allow empty functions in the AST.
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.
virtual void exitOnError(bool b)
Property: Error handling.
virtual void functionReturnAnalysisMaxSorts(size_t n)
Property: Maximum number of function may-return sorting operations.
virtual void doingPostFunctionNoop(bool b)
Property: Whether to run no-op function analysis.
virtual void findingInterFunctionCalls(bool b)
Property: Whether to search for function calls between exiting functions.
bool findingIntraFunctionData
Suck up unused addresses as intra-function data.
virtual void maxBasicBlockSize(size_t n)
Property: Maximum size for basic blocks.
Partitions instructions into basic blocks and functions.
Base class for all ROSE exceptions.
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.
std::vector< rose_addr_t > & functionStartingVas()
Property: Starting addresses for disassembly.
FunctionReturnAnalysis functionReturnAnalysis() const
Property: Whether to run the function may-return analysis.
bool findingDeadCode() const
Property: Whether to find dead code.
virtual void doingPostFunctionStackDelta(bool b)
Property: Whether to run the function stack delta analysis.
Represents an interpretation of a binary container.
bool findingFunctionCallFunctions
Create functions from function calls.
Class for the JVM engine driving the partitioner.
AstConstructionSettings astConstruction
Settings for constructing the AST.
size_t maxBasicBlockSize
Maximum basic block size.
bool usingSemantics() const
Property: Whether to use instruction semantics.
bool doingPostAnalysis() const
Property: Whether to perform post-partitioning analysis steps.
Settings & settings()
Property: All settings.
size_t functionReturnAnalysisMaxSorts() const
Property: Maximum number of function may-return sorting operations.
boost::filesystem::path syscallHeader
Name of header file containing system call numbers.
bool astAllowEmptyGlobalBlock() const
Property: Whether to allow empty global block in the AST.
bool findingInterFunctionCalls() const
Property: Whether to search for function calls between exiting functions.
void namingStrings(const AddressInterval &where)
Property: Addresses where strings might start.
Holds configuration information.
bool findingErrorFunctions() const
Property: Whether to make error handling functions.
bool exitOnError() const
Property: Error handling.
bool findingImportFunctions() const
Property: Whether to make functions at import addresses.