|
| DisassemblerPowerpc () |
|
| DisassemblerPowerpc (const DisassemblerPowerpc &other) |
|
virtual | ~DisassemblerPowerpc () |
|
virtual DisassemblerPowerpc * | clone () const |
| Creates a new copy of a disassembler. More...
|
|
virtual bool | can_disassemble (SgAsmGenericHeader *) const |
| Predicate determining the suitability of a disassembler for a specific file header. More...
|
|
virtual SgAsmInstruction * | disassembleOne (const MemoryMap *map, rose_addr_t start_va, AddressSet *successors=NULL) |
| This is the lowest level disassembly function and is implemented in the architecture-specific subclasses. More...
|
|
virtual void | assembleOne (SgAsmInstruction *, SgUnsignedCharList &) |
|
virtual SgAsmInstruction * | make_unknown_instruction (const Exception &) |
| Makes an unknown instruction from an exception. More...
|
|
| Disassembler () |
|
| Disassembler (const Disassembler &other) |
|
virtual | ~Disassembler () |
|
void | disassemble (SgAsmInterpretation *, AddressSet *successors=NULL, BadMap *bad=NULL) |
| This high-level method disassembles instructions belonging to part of a file described by an executable file header as indicated by the specified interpretation. More...
|
|
void | set_registers (const RegisterDictionary *rdict) |
| Specifies the registers available on this architecture. More...
|
|
const RegisterDictionary * | get_registers () const |
| Returns the dictionary used for looking up register names. More...
|
|
void | set_partitioner (class Partitioner *p) |
| Specifies the instruction partitioner to use when partitioning instructions into functions. More...
|
|
class Partitioner * | get_partitioner () const |
| Returns the partitioner object set by set_partitioner(). More...
|
|
void | set_search (unsigned bits) |
| Specifies the heuristics used when searching for instructions. More...
|
|
unsigned | get_search () const |
| Returns a bit mask of SearchHeuristic bits representing which heuristics would be used when searching for instructions. More...
|
|
void | set_wordsize (size_t) |
| Specifies the word size for the SEARCH_WORDS heuristic. More...
|
|
size_t | get_wordsize () const |
| Returns the word size used by the SEARCH_WORDS heuristic. More...
|
|
void | set_alignment (size_t) |
| Specifies the alignment for the SEARCH_WORDS heuristic. More...
|
|
size_t | get_alignment () const |
| Returns the alignment used by the SEARCH_WORDS heuristic. More...
|
|
void | set_sex (ByteOrder::Endianness sex) |
| Specifies the byte order for the SEARCH_WORDS heuristic. More...
|
|
ByteOrder::Endianness | get_sex () const |
| Returns the byte order used by the SEARCH_WORDS heuristic. More...
|
|
void | set_debug (FILE *f) |
| Sends disassembler diagnostics to the specified output stream. More...
|
|
FILE * | get_debug () const |
| Returns the file currently used for debugging; null implies no debugging. More...
|
|
size_t | get_ndisassembled () const |
| Returns the number of instructions successfully disassembled. More...
|
|
void | set_protection (unsigned bitvec) |
| Normally the disassembler will only read memory when the execute permission is turned on for the memory. More...
|
|
unsigned | get_protection () const |
| Returns a bit vector describing which bits must be enabled in the MemoryMap in order for the disassembler to read from that memory. More...
|
|
void | set_progress_reporting (FILE *, unsigned min_interval) |
| Set progress reporting properties. More...
|
|
SgAsmInstruction * | disassembleOne (const unsigned char *buf, rose_addr_t buf_va, size_t buf_size, rose_addr_t start_va, AddressSet *successors=NULL) |
| Similar in functionality to the disassembleOne method that takes a MemoryMap argument, except the content buffer is mapped 1:1 to virtual memory beginning at the specified address. More...
|
|
InstructionMap | disassembleBlock (const MemoryMap *map, rose_addr_t start_va, AddressSet *successors=NULL, InstructionMap *cache=NULL) |
| Like the disassembleOne method except it disassembles a basic block's worth of instructions beginning at the specified virtual address. More...
|
|
InstructionMap | disassembleBlock (const unsigned char *buf, rose_addr_t buf_va, size_t buf_size, rose_addr_t start_va, AddressSet *successors=NULL, InstructionMap *cache=NULL) |
| Similar in functionality to the disassembleBlock method that takes a MemoryMap argument, except the supplied buffer is mapped 1:1 to virtual memory beginning at the specified address. More...
|
|
InstructionMap | disassembleBuffer (const MemoryMap *map, size_t start_va, AddressSet *successors=NULL, BadMap *bad=NULL) |
| Disassembles instructions from the content buffer beginning at the specified virtual address and including all instructions that are direct or indirect successors of the first instruction. More...
|
|
InstructionMap | disassembleBuffer (const unsigned char *buf, rose_addr_t buf_va, size_t buf_size, rose_addr_t start_va, AddressSet *successors=NULL, BadMap *bad=NULL) |
| Similar in functionality to the disassembleBuffer methods that take a MemoryMap argument, except the supplied buffer is mapped 1:1 to virtual memory beginning at the specified address. More...
|
|
InstructionMap | disassembleBuffer (const MemoryMap *map, AddressSet workset, AddressSet *successors=NULL, BadMap *bad=NULL) |
| Similar in functionality to the disassembleBuffer methods that take a single starting virtual address, except this one tries to disassemble from all the addresses specified in the workset. More...
|
|
InstructionMap | disassembleSection (SgAsmGenericSection *section, rose_addr_t section_va, rose_addr_t start_offset, AddressSet *successors=NULL, BadMap *bad=NULL) |
| Disassembles instructions in the specified section by assuming that it's mapped to a particular starting address. More...
|
|
InstructionMap | disassembleInterp (SgAsmInterpretation *interp, AddressSet *successors=NULL, BadMap *bad=NULL) |
| Disassembles instructions in a particular binary interpretation. More...
|
|
void | search_following (AddressSet *worklist, const InstructionMap &bb, rose_addr_t bb_va, const MemoryMap *map, const InstructionMap &tried) |
| Adds the address following a basic block to the list of addresses that should be disassembled. More...
|
|
void | search_immediate (AddressSet *worklist, const InstructionMap &bb, const MemoryMap *map, const InstructionMap &tried) |
| Adds values of immediate operands to the list of addresses that should be disassembled. More...
|
|
void | search_words (AddressSet *worklist, const MemoryMap *map, const InstructionMap &tried) |
| Adds all word-aligned values to work list, provided they specify a virtual address in the map . More...
|
|
void | search_next_address (AddressSet *worklist, rose_addr_t start_va, const MemoryMap *map, const InstructionMap &insns, const InstructionMap &tried, bool avoid_overlaps) |
| Finds the lowest virtual address, greater than or equal to start_va , which does not correspond to a previous disassembly attempt as evidenced by its presence in the supplied instructions or bad map. More...
|
|
void | search_function_symbols (AddressSet *worklist, const MemoryMap *, SgAsmGenericHeader *) |
| Adds addresses that correspond to function symbols. More...
|
|
void | update_progress (SgAsmInstruction *) |
| Updates progress information. More...
|
|
void | progress (FILE *, const char *fmt,...) const __attribute__((format(printf |
| Conditionally prints a progress report. More...
|
|
void | mark_referenced_instructions (SgAsmInterpretation *, const MemoryMap *, const InstructionMap &) |
| Marks parts of the file that correspond to instructions as having been referenced. More...
|
|
AddressSet | get_block_successors (const InstructionMap &, bool *complete) |
| Calculates the successor addresses of a basic block and adds them to a successors set. More...
|
|
|
enum | SearchHeuristic {
SEARCH_FOLLOWING = 0x0001,
SEARCH_IMMEDIATE = 0x0002,
SEARCH_WORDS = 0x0004,
SEARCH_ALLBYTES = 0x0008,
SEARCH_UNUSED = 0x0010,
SEARCH_NONEXE = 0x0020,
SEARCH_DEADEND = 0x0040,
SEARCH_UNKNOWN = 0x0080,
SEARCH_FUNCSYMS = 0x0100,
SEARCH_DEFAULT = 0x0101
} |
| Heuristics used to find instructions to disassemble. More...
|
|
typedef std::set< rose_addr_t > | AddressSet |
| An AddressSet contains virtual addresses (alternatively, relative virtual addresses) for such things as specifying which virtual addresses should be disassembled. More...
|
|
typedef Map< rose_addr_t,
SgAsmInstruction * > | InstructionMap |
| The InstructionMap is a mapping from (absolute) virtual address to disassembled instruction. More...
|
|
typedef Map< rose_addr_t,
Exception > | BadMap |
| The BadMap is a mapping from (absolute) virtual address to information about a failed disassembly attempt at that address. More...
|
|
static unsigned | parse_switches (const std::string &s, unsigned initial=SEARCH_DEFAULT) |
| Given a string (presumably from the ROSE command-line), parse it and return the bit vector describing which search heuristics should be employed by the disassembler. More...
|
|
static void | register_subclass (Disassembler *) |
| Register a disassembler instance. More...
|
|
static Disassembler * | lookup (SgAsmGenericHeader *) |
| Finds a suitable disassembler. More...
|
|
static Disassembler * | lookup (SgAsmInterpretation *) |
| Finds a suitable disassembler. More...
|
|
static void | disassembleInterpretation (SgAsmInterpretation *) |
| This class method is for backward compatibility with the disassembleInterpretation() function in the old Disassembler namespace. More...
|
|
const RegisterDictionary * | p_registers |
| Description of registers available for this platform. More...
|
|
class Partitioner * | p_partitioner |
| Used for placing instructions into blocks and functions. More...
|
|
unsigned | p_search |
| Mask of SearchHeuristic bits specifying instruction searching. More...
|
|
FILE * | p_debug |
| Set to non-null to get debugging info. More...
|
|
size_t | p_wordsize |
| Word size used by SEARCH_WORDS. More...
|
|
ByteOrder::Endianness | p_sex |
| Byte order for SEARCH_WORDS. More...
|
|
size_t | p_alignment |
| Word alignment constraint for SEARCH_WORDS (0 and 1 imply byte). More...
|
|
size_t | p_ndisassembled |
| Total number of instructions disassembled by disassembleBlock() More...
|
|
unsigned | p_protection |
| Memory protection bits that must be set to disassemble. More...
|
|
static std::vector
< Disassembler * > | disassemblers |
| List of disassembler subclasses. More...
|
|
static time_t | progress_interval = 10 |
| Minimum interval between progress reports. More...
|
|
static time_t | progress_time = 0 |
| Time of last report, or zero if no report has been generated. More...
|
|
static FILE * | progress_file = stderr |
| File to which reports are made. More...
|
|
static RTS_mutex_t | class_mutex = RTS_MUTEX_INITIALIZER(RTS_LAYER_DISASSEMBLER_CLASS) |
| Mutex for class-wide thread safety. More...
|
|
Disassembler for the PowerPC architecture.
Definition at line 10 of file DisassemblerPowerpc.h.