1#ifndef ROSE_BinaryAnalysis_Partitioner2_ModulesPe_H
2#define ROSE_BinaryAnalysis_Partitioner2_ModulesPe_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
7#include <Rose/BinaryAnalysis/Partitioner2/Modules.h>
11namespace BinaryAnalysis {
12namespace Partitioner2 {
92 DispatchEntry(uint32_t returnVa, uint32_t calleeVa): returnVa(returnVa), calleeVa(calleeVa) {}
103 rose_addr_t dispatcherVa_;
104 rose_addr_t dispatchTableVa_;
105 bool reachedEndOfTable_;
106 bool checkedPreconditions_;
107 static const size_t sizeofDispatcherFunction = 65;
108 static const size_t bitsPerWord = 32;
115 checkedPreconditions_(false) {}
Base class for adjusting basic blocks during discovery.
Callback to restore PEScrambler function call edges.
void nameKeyAddresses(const PartitionerPtr &)
Name certain addresses in the specimen.
static Ptr instance(rose_addr_t dispatcherVa)
Construct a new PeDescrambler.
Sawyer::SharedPointer< PeDescrambler > Ptr
Shared-ownership pointer to a PeDescrambler.
virtual bool operator()(bool chain, const Args &) override
Callback method.
rose_addr_t dispatchTableVa() const
Virtual address of PEScrambler dispatch table.
std::vector< DispatchEntry > DispatchTable
The function dispatch table.
rose_addr_t dispatcherVa() const
Virtual address of PEScrambler dispatch function.
const DispatchTable & dispatchTable() const
Dispatch table.
DispatchTable & dispatchTable()
Dispatch table.
static Ptr instance(rose_addr_t dispatcherVa, rose_addr_t dispatchTableVa)
Construct a new PeDescrambler.
Container associating values with keys.
Holds a value or nothing.
Represents an interpretation of a binary container.
void nameImportThunks(const PartitionerConstPtr &, SgAsmInterpretation *)
Names functions that look like they're thunks for imports.
void rebaseImportAddressTables(const PartitionerPtr &partitioner, const ImportIndex &index)
Update import address tables to reflect addresses of imported functions.
std::string systemFunctionName(const std::string &)
Convert function name to system representation.
std::vector< FunctionPtr > findImportFunctions(const PartitionerConstPtr &, SgAsmPEFileHeader *)
Reads PE import sections to find functions.
std::vector< FunctionPtr > findExportFunctions(const PartitionerConstPtr &, SgAsmPEFileHeader *)
Reads PE export sections to find functions.
void buildMayReturnLists(const PartitionerPtr &)
Build may-return white and black lists.
ImportIndex getImportIndex(const PartitionerConstPtr &, SgAsmPEFileHeader *)
Scans PE import sections to build an index.
Sawyer::Container::Map< rose_addr_t, SgAsmPEImportItem * > ImportIndex
Index for PE import addresses.
Arguments passed to the callback.
One dispatch table entry in native format.