ROSE  0.9.10.91
Classes | Public Member Functions | List of all members
Rose::BinaryAnalysis::DisassemblerX86 Class Reference

Description

Disassembler for the x86 architecture.

Most of the useful disassembly methods can be found in the superclass. There's really not much reason to use this class directly or to call any of these methods directly.

Definition at line 20 of file DisassemblerX86.h.

#include <DisassemblerX86.h>

Inheritance diagram for Rose::BinaryAnalysis::DisassemblerX86:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::DisassemblerX86:
Collaboration graph
[legend]

Public Member Functions

 DisassemblerX86 (size_t wordsize)
 
virtual DisassemblerX86clone () const ROSE_OVERRIDE
 Creates a new copy of a disassembler. More...
 
virtual bool canDisassemble (SgAsmGenericHeader *) const ROSE_OVERRIDE
 Predicate determining the suitability of a disassembler for a specific file header. More...
 
virtual Unparser::BasePtr unparser () const ROSE_OVERRIDE
 Unparser. More...
 
virtual SgAsmInstructiondisassembleOne (const MemoryMap::Ptr &map, rose_addr_t start_va, AddressSet *successors=NULL) ROSE_OVERRIDE
 This is the lowest level disassembly function and is implemented in the architecture-specific subclasses. More...
 
virtual SgAsmInstructionmakeUnknownInstruction (const Exception &) ROSE_OVERRIDE
 Makes an unknown instruction from an exception. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::Disassembler
virtual RegisterDescriptor instructionPointerRegister () const
 Returns the register that points to instructions. More...
 
virtual RegisterDescriptor stackPointerRegister () const
 Returns the register that points to the stack. More...
 
virtual RegisterDescriptor stackFrameRegister () const
 Returns the register that ponts to the stack frame. More...
 
virtual RegisterDescriptor stackSegmentRegister () const
 Returns the segment register for accessing the stack. More...
 
const Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::DispatcherPtrdispatcher () const
 Return an instruction semantics dispatcher if possible. More...
 
SgAsmInstructiondisassembleOne (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...
 
void mark_referenced_instructions (SgAsmInterpretation *, const MemoryMap::Ptr &, 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...
 
const std::string & name () const
 Property: Name by which disassembler is registered.
 
void name (const std::string &s)
 Property: Name by which disassembler is registered.
 
ByteOrder::Endianness byteOrder () const
 Property: Byte order of instructions in memory.
 
void byteOrder (ByteOrder::Endianness sex)
 Property: Byte order of instructions in memory.
 
size_t wordSizeBytes () const
 Property: Basic word size in bytes.
 
void wordSizeBytes (size_t nbytes)
 Property: Basic word size in bytes.
 
void registerDictionary (const RegisterDictionary *rdict)
 Properties: Register dictionary. More...
 
const RegisterDictionaryregisterDictionary () const
 Properties: Register dictionary. More...
 
const CallingConvention::DictionarycallingConventions () const
 Property: Calling convention dictionary. More...
 
CallingConvention::DictionarycallingConventions ()
 Properties: Register dictionary. More...
 
void callingConventions (const CallingConvention::Dictionary &d)
 Properties: Register dictionary. More...
 

Additional Inherited Members

- Public Types inherited from Rose::BinaryAnalysis::Disassembler
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...
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::Disassembler
static void registerSubclass (Disassembler *)
 Register a disassembler instance. More...
 
static Disassemblerlookup (SgAsmGenericHeader *)
 Finds a suitable disassembler. More...
 
static std::vector< std::string > isaNames ()
 List of names recognized by lookup. More...
 
static Disassemblerlookup (SgAsmInterpretation *)
 Finds a suitable disassembler. More...
 
static Disassemblerlookup (const std::string &)
 Finds a suitable disassembler. More...
 
static void initDiagnostics ()
 Initializes and registers disassembler diagnostic streams. More...
 
- Static Public Attributes inherited from Rose::BinaryAnalysis::Disassembler
static Sawyer::Message::Facility mlog
 Disassembler diagnostic streams. More...
 
- Protected Attributes inherited from Rose::BinaryAnalysis::Disassembler
const RegisterDictionaryp_registers
 Description of registers available for this platform. More...
 
RegisterDescriptor REG_IP
 
RegisterDescriptor REG_SP
 
RegisterDescriptor REG_SS
 
RegisterDescriptor REG_SF
 Register descriptors initialized during construction. More...
 
ByteOrder::Endianness p_byteOrder
 Byte order of instructions in memory. More...
 
size_t p_wordSizeBytes
 Basic word size in bytes. More...
 
std::string p_name
 Name by which this dissassembler is registered. More...
 
InstructionSemantics2::BaseSemantics::DispatcherPtr p_proto_dispatcher
 Prototypical dispatcher for creating real dispatchers.
 
- Static Protected Attributes inherited from Rose::BinaryAnalysis::Disassembler
static std::vector< Disassembler * > disassemblers
 List of disassembler subclasses. More...
 

Member Function Documentation

virtual DisassemblerX86* Rose::BinaryAnalysis::DisassemblerX86::clone ( ) const
inlinevirtual

Creates a new copy of a disassembler.

The new copy has all the same settings as the original.

Thread safety: The thread safety of this virtual method depends on the implementation in the subclass.

Implements Rose::BinaryAnalysis::Disassembler.

Definition at line 104 of file DisassemblerX86.h.

virtual bool Rose::BinaryAnalysis::DisassemblerX86::canDisassemble ( SgAsmGenericHeader ) const
virtual

Predicate determining the suitability of a disassembler for a specific file header.

If this disassembler is capable of disassembling machine code described by the specified file header, then this predicate returns true, otherwise it returns false.

Thread safety: The thread safety of this virtual method depends on the implementation in the subclass.

Implements Rose::BinaryAnalysis::Disassembler.

virtual Unparser::BasePtr Rose::BinaryAnalysis::DisassemblerX86::unparser ( ) const
virtual

Unparser.

Returns an unparser suitable for unparsing the same instruction set architecture as recognized and produced by this disassembler.

Implements Rose::BinaryAnalysis::Disassembler.

virtual SgAsmInstruction* Rose::BinaryAnalysis::DisassemblerX86::disassembleOne ( const MemoryMap::Ptr map,
rose_addr_t  start_va,
AddressSet successors = NULL 
)
virtual

This is the lowest level disassembly function and is implemented in the architecture-specific subclasses.

It disassembles one instruction at the specified virtual address. The map is a mapping from virtual addresses to buffer and enables instructions to span file segments that are mapped contiguously in virtual memory by the loader but which might not be contiguous in the file. The instruction's successor virtual addresses are added to the optional successor set (note that successors of an individual instruction can also be obtained via SgAsmInstruction::getSuccessors). If the instruction cannot be disassembled then an exception is thrown and the successors set is not modified.

Thread safety: The safety of this method depends on its implementation in the subclass. In any case, no other thread can be modifying the MemoryMap or successors set at the same time.

Implements Rose::BinaryAnalysis::Disassembler.

virtual SgAsmInstruction* Rose::BinaryAnalysis::DisassemblerX86::makeUnknownInstruction ( const Exception )
virtual

Makes an unknown instruction from an exception.

Thread safety: The safety of this method depends on its implementation in the subclass.

Implements Rose::BinaryAnalysis::Disassembler.


The documentation for this class was generated from the following file: