1 #ifndef ROSE_BinaryAnalysis_Partitioner2_JvmEngine_H
2 #define ROSE_BinaryAnalysis_Partitioner2_JvmEngine_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <Rose/BinaryAnalysis/Disassembler/BasicTypes.h>
7 #include <Rose/BinaryAnalysis/Partitioner2/Partitioner.h>
8 #include <Rose/Progress.h>
9 #include <Rose/Exception.h>
13 namespace BinaryAnalysis {
14 namespace Partitioner2 {
95 class ROSE_DLL_API
JvmEngine:
private boost::noncopyable {
169 const std::string &purpose,
const std::string &description);
170 virtual SgAsmBlock* frontend(
const std::vector<std::string> &args,
171 const std::string &purpose,
const std::string &description);
212 const std::string &purpose,
const std::string &description) ;
214 const std::string &purpose,
const std::string &description);
257 virtual Partitioner partition(
const std::vector<std::string> &fileNames = std::vector<std::string>());
258 Partitioner partition(
const std::string &fileName) ;
275 SgAsmBlock* buildAst(
const std::vector<std::string> &fileNames = std::vector<std::string>()) ;
276 SgAsmBlock* buildAst(
const std::string &fileName) ;
314 static std::string specimenNameDocumentation();
335 virtual void checkSettings();
470 virtual
void disassembler(const Disassembler::BasePtr&);
897 #ifdef ROSE_ENABLE_PYTHON_API
900 Partitioner pythonParseVector(boost::python::list &pyArgs,
const std::string &purpose,
const std::string &description);
901 Partitioner pythonParseSingle(
const std::string &specimen,
const std::string &purpose,
const std::string &description);
912 SgProject* roseFrontendReplacement(
const std::vector<boost::filesystem::path> &fileNames);
920 namespace ModulesJvm {
bool findingInterFunctionCalls
Look for function calls between functions.
const AddressInterval & namingStrings() const
Property: Addresses where strings might start.
Settings & settings()
Property: All settings.
bool doingPostFunctionNoop() const
Property: Whether to run no-op function analysis.
const boost::filesystem::path & systemCallHeader() const
Property: Header file in which system calls are defined.
bool usingSemantics() const
Property: Whether to use instruction semantics.
Class for the JVM engine driving the partitioner.
virtual void doingPostCallingConvention(bool b)
Property: Whether to run calling-convention analysis.
void basicBlockSemanticsAutoDrop(bool b)
Property: Automatically drop semantics for attached basic blocks.
const AddressInterval & interruptVector() const
Property: Location of machine interrupt vector.
Settings for controling the engine behavior.
bool findingCodeFunctionPointers() const
Property: Whether to search existing instructions for function pointers.
bool findingExportFunctions
Create functions at export addresses.
size_t maxBasicBlockSize() const
Property: Maximum size for basic blocks.
bool findingDataFunctionPointers
Look for function pointers in static data.
bool findingFunctionCallFunctions() const
Property: Whether to turn function call targets into functions.
virtual void maxBasicBlockSize(size_t n)
Property: Maximum size for basic blocks.
bool findingSymbolFunctions() const
Property: Whether to make functions according to symbol tables.
rose_addr_t peScramblerDispatcherVa() const
Property: PE-Scrambler dispatcher address.
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.
virtual void doDisassemble(bool b)
Property: Perform disassembly.
virtual void interruptVector(const AddressInterval &i)
Property: Location of machine interrupt vector.
rose_addr_t peScramblerDispatcherVa
Run the PeDescrambler module if non-zero.
virtual void namingSystemCalls(bool b)
Property: Give names to system calls.
bool doingPostFunctionMayReturn() const
Property: Whether to run the function may-return analysis.
Settings that control the disassembler.
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.
bool findingDeadCode() const
Property: Whether to find dead code.
The result from parsing a command line.
virtual void astCopyAllInstructions(bool b)
Property: Whether to copy instructions when building the AST.
FunctionReturnAnalysis functionReturnAnalysis() const
Property: Whether to run the function may-return analysis.
const std::vector< rose_addr_t > & ipRewrites() const
Property: CFG edge rewrite pairs.
bool findingExportFunctions() const
Property: Whether to make functions at export addresses.
virtual void exitOnError(bool b)
Property: Error handling.
bool findingDataFunctionPointers() const
Property: Whether to search static data for function pointers.
bool doDisassemble() const
Property: Perform disassembly.
bool demangleNames() const
Property: Demangle names.
virtual void functionReturnAnalysis(FunctionReturnAnalysis x)
Property: Whether to run the function may-return analysis.
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.
size_t findingIntraFunctionCode() const
Property: Whether to find intra-function code.
virtual void findingInterFunctionCalls(bool b)
Property: Whether to search for function calls between exiting functions.
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.
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.
bool exitOnError() const
Property: Error handling.
std::vector< rose_addr_t > & functionStartingVas()
Property: Starting addresses for disassembly.
Settings that control building the AST.
bool doingPostCallingConvention() const
Property: Whether to run calling-convention analysis.
virtual void ipRewrites(const std::vector< rose_addr_t > &v)
Property: CFG edge rewrite pairs.
size_t functionReturnAnalysisMaxSorts() const
Property: Maximum number of function may-return sorting operations.
virtual void findingExportFunctions(bool b)
Property: Whether to make functions at export addresses.
bool allowEmptyGlobalBlock
Whether to allow an empty global block.
AstConstructionSettings astConstruction
Settings for constructing the AST.
virtual void doingPostFunctionMayReturn(bool b)
Property: Whether to run the function may-return analysis.
virtual void usingSemantics(bool b)
Property: Whether to use instruction semantics.
std::vector< std::string > & configurationNames()
Property: Configuration files.
size_t functionReturnAnalysisMaxSorts
Number of times functions are sorted before using unsorted lists.
bool basicBlockSemanticsAutoDrop() const
Property: Automatically drop semantics for attached basic blocks.
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.
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.
virtual void findingSymbolFunctions(bool b)
Property: Whether to make functions according to symbol tables.
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.
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.
bool astCopyAllInstructions() const
Property: Whether to copy instructions when building the AST.
bool doingPostAnalysis
Perform enabled post-partitioning analyses?
SemanticMemoryParadigm semanticMemoryParadigm() const
Property: Type of container for semantic memory.
size_t findingIntraFunctionCode
Suck up unused addresses as intra-function code (number of passes).
PartitionerSettings partitioner
Settings for creating a partitioner.
virtual void systemCallHeader(const boost::filesystem::path &filename)
Property: Header file in which system calls are defined.
bool findingImportFunctions
Create functions at import addresses.
virtual void doingPostAnalysis(bool b)
Property: Whether to perform post-partitioning analysis steps.
bool astAllowEmptyBasicBlock() const
Property: Whether to allow empty basic blocks in the AST.
SemanticMemoryParadigm
Organization of semantic memory.
virtual void peScramblerDispatcherVa(rose_addr_t va)
Property: PE-Scrambler dispatcher address.
EngineSettings engine
Settings that control engine behavior.
bool astAllowEmptyGlobalBlock() const
Property: Whether to allow empty global block in the AST.
virtual void functionReturnAnalysisMaxSorts(size_t n)
Property: Maximum number of function may-return sorting operations.
const std::vector< rose_addr_t > & functionStartingVas() const
Property: Starting addresses for disassembly.
virtual void namingConstants(bool b)
Property: Give names to constants.
bool findingInterFunctionCalls() const
Property: Whether to search for function calls between exiting functions.
virtual void semanticMemoryParadigm(SemanticMemoryParadigm p)
Property: Type of container for semantic memory.
FunctionReturnAnalysis
Controls whether the function may-return analysis runs.
bool namingSystemCalls() const
Property: Give names to system calls.
virtual void isaName(const std::string &s)
Property: Instruction set architecture name.
bool findingIntraFunctionData() const
Property: Whether to find intra-function data.
bool findingEntryFunctions
Create functions at the program entry point(s).
bool findingDeadCode
Look for unreachable basic blocks?
virtual void findingIntraFunctionData(bool b)
Property: Whether to find intra-function data.
SemanticMemoryParadigm semanticMemoryParadigm
Container used for semantic memory states.
virtual void findingCodeFunctionPointers(bool b)
Property: Whether to search existing instructions for function pointers.
virtual void findingFunctionCallFunctions(bool b)
Property: Whether to turn function call targets into functions.
bool doDisassemble
Perform disassembly.
bool doingPostAnalysis() const
Property: Whether to perform post-partitioning analysis steps.
DisassemblerSettings disassembler
Settings for creating the disassembler.
bool checkingCallBranch
Check for situations where CALL is used as a branch.
virtual void ignoringUnknownInsns(bool b)
Property: Whether unknown instructions are ignored.
bool allowEmptyBasicBlocks
Whether to allow a basic block to be empty.
bool usingSemantics
Whether instruction semantics are used.
virtual void progress(const Progress::Ptr &progress)
Property: progress reporting.
virtual void checkingCallBranch(bool b)
Property: Whether to look for function calls used as branches.
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.
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.
virtual void findingIntraFunctionCode(size_t n)
Property: Whether to find intra-function code.
virtual void findingDataFunctionPointers(bool b)
Property: Whether to search static data for function pointers.
virtual void findingErrorFunctions(bool b)
Property: Whether to make error handling functions.
void namingStrings(const AddressInterval &where)
Property: Addresses where strings might start.
virtual void demangleNames(bool b)
Property: Demangle names.
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.
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.
virtual void findingDeadCode(bool b)
Property: Whether to find dead code.
Represents an interpretation of a binary container.
bool findingFunctionCallFunctions
Create functions from function calls.
bool findingErrorFunctions() const
Property: Whether to make error handling functions.
size_t maxBasicBlockSize
Maximum basic block size.
bool doingPostFunctionStackDelta() const
Property: Whether to run the function stack delta analysis.
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.
bool findingEntryFunctions() const
Property: Whether to make functions at program entry points.
const Settings & settings() const
Property: All settings.
Holds configuration information.
bool astAllowFunctionWithNoBasicBlocks() const
Property: Whether to allow empty functions in the AST.
bool ignoringUnknownInsns() const
Property: Whether unknown instructions are ignored.