C# Class SharpDisasm.Disassembler

Provides a simple wrapper around the C# ported udis86 library.
Inheritance: IDisposable
Afficher le fichier Open project: spazzarama/SharpDisasm Class Usage Examples

Méthodes publiques

Свойство Type Description
Address ulong
Architecture ArchitectureMode
CopyBinaryToInstruction bool
Translator SharpDisasm.Translators.Translator
Vendor Vendor

Méthodes publiques

Méthode Description
Disassemble ( ) : IEnumerable

Disassemble instructions and yield the result. Breaking out of the enumerator will prevent further instructions being disassembled.

Disassembler ( IAssemblyCode code, ArchitectureMode architecture, ulong address = 0x0, bool copyBinaryToInstruction = false, Vendor vendor = Vendor.Any ) : System

Initializes a new instance of the Disassembler class.

Disassembler ( IntPtr codePtr, int codeLength, ArchitectureMode architecture, ulong address = 0x0, bool copyBinaryToInstruction = false, Vendor vendor = Vendor.Any ) : System

Prepares a new disassembler instance for the code located at the memory address provided. The instructions can then be disassembled with a call to Disassemble. The base address used to resolve relative addresses should be provided in address.

Disassembler ( byte code, ArchitectureMode architecture, ulong address = 0x0, bool copyBinaryToInstruction = false, Vendor vendor = Vendor.Any ) : System

Prepares a new disassembler instance for the code provided. The instructions can then be disassembled with a call to Disassemble. The base address used to resolve relative addresses should be provided in address.

Dispose ( ) : void

Dispose

NextInstruction ( ) : Instruction

Decodes a single instruction and increments buffer position.

Reset ( ) : void

Reset to beginning of the buffer

Private Methods

Méthode Description
InitUdis86 ( ) : void

(Re)Initialise the udis86 disassembler

Method Details

Disassemble() public méthode

Disassemble instructions and yield the result. Breaking out of the enumerator will prevent further instructions being disassembled.
public Disassemble ( ) : IEnumerable
Résultat IEnumerable

Disassembler() public méthode

Initializes a new instance of the Disassembler class.
public Disassembler ( IAssemblyCode code, ArchitectureMode architecture, ulong address = 0x0, bool copyBinaryToInstruction = false, Vendor vendor = Vendor.Any ) : System
code IAssemblyCode The code.
architecture ArchitectureMode The architecture.
address ulong The address.
copyBinaryToInstruction bool if set to true [copy binary to instruction].
vendor Vendor The vendor.
Résultat System

Disassembler() public méthode

Prepares a new disassembler instance for the code located at the memory address provided. The instructions can then be disassembled with a call to Disassemble. The base address used to resolve relative addresses should be provided in address.
public Disassembler ( IntPtr codePtr, int codeLength, ArchitectureMode architecture, ulong address = 0x0, bool copyBinaryToInstruction = false, Vendor vendor = Vendor.Any ) : System
codePtr System.IntPtr A pointer to memory to be disassembled.
codeLength int The maximum length to be disassembled.
architecture ArchitectureMode The architecture of the code (e.g. 64-bit, 32-bit or 16-bit).
address ulong The address of the first byte of code. This value is used to resolve relative addresses into absolute addresses while disassembling.
copyBinaryToInstruction bool Keeps a copy of the binary code for the instruction. This will increase the memory usage for each instruction. This is necessary if planning on using the option.
vendor Vendor What vendors to support for disassembly, default is Any. Other options are AMD or Intel.
Résultat System

Disassembler() public méthode

Prepares a new disassembler instance for the code provided. The instructions can then be disassembled with a call to Disassemble. The base address used to resolve relative addresses should be provided in address.
public Disassembler ( byte code, ArchitectureMode architecture, ulong address = 0x0, bool copyBinaryToInstruction = false, Vendor vendor = Vendor.Any ) : System
code byte The code to be disassembled
architecture ArchitectureMode The target x86 instruction set architecture of the code (e.g. 64-bit, 32-bit or 16-bit).
address ulong The address of the first byte of code. This value is used to resolve relative addresses into absolute addresses while disassembling.
copyBinaryToInstruction bool Keeps a copy of the binary code for the instruction. This will increase the memory usage for each instruction. This is necessary if planning on using the option.
vendor Vendor What vendor instructions to support during disassembly, default is Any. Other options are AMD or Intel.
Résultat System

Dispose() public méthode

Dispose
public Dispose ( ) : void
Résultat void

NextInstruction() public méthode

Decodes a single instruction and increments buffer position.
public NextInstruction ( ) : Instruction
Résultat Instruction

Reset() public méthode

Reset to beginning of the buffer
public Reset ( ) : void
Résultat void

Property Details

Address public_oe property

The address
public ulong Address
Résultat ulong

Architecture public_oe property

The x86 CPU architecture to use: 16-bit, 32-bit or 64-bit.
public ArchitectureMode Architecture
Résultat ArchitectureMode

CopyBinaryToInstruction public_oe property

Copies the source binary to the decoded instructions. When true this option increases the memory required for each decoded instruction.
public bool CopyBinaryToInstruction
Résultat bool

Translator public_oe static_oe property

The translator that will be used when calling Instruction.ToString.
public static SharpDisasm.Translators.Translator Translator
Résultat SharpDisasm.Translators.Translator

Vendor public_oe property

Which vendor instructions to support for disassembly. Options are AMD, Intel or Any.
public Vendor Vendor
Résultat Vendor