Debugging Tools for Windows

Disassemble

The Disassemble and DisassembleWide methods disassemble a processor instruction in the target's memory.

HRESULT
  IDebugControl::Disassemble(
    IN ULONG64  Offset,
    IN ULONG  Flags,
    OUT OPTIONAL PSTR  Buffer,
    IN ULONG  BufferSize,
    OUT OPTIONAL PULONG  DisassemblySize,
    OUT PULONG64  EndOffset
    );

HRESULT
  IDebugControl4::DisassembleWide(
    IN ULONG64  Offset,
    IN ULONG  Flags,
    OUT OPTIONAL PWSTR  Buffer,
    IN ULONG  BufferSize,
    OUT OPTIONAL PULONG  DisassemblySize,
    OUT PULONG64  EndOffset
    );

#ifdef UNICODE
#define DisassembleT DisassembleWide
#else
#define DisassembleT Disassemble
#endif

Parameters

Offset
Specifies the location in the target's memory of the instruction to disassemble.
Flags
Specifies the bit-flags that affect the behavior of this method. Currently the only flag that can be set is DEBUG_DISASM_EFFECTIVE_ADDRESS; when set, the engine will compute the effective address from the current register information and display it.
Buffer
Receives the disassembled instruction. If Buffer is NULL, this information is not returned.
BufferSize
Specifies the size, in characters, of the Buffer buffer.
DisassemblySize
Receives the size, in characters, of the disassembled instruction. If DisassemblySize is NULL, this information is not returned.
EndOffset
Receives the location in the target's memory of the instruction following the disassembled instruction.

Return Value

S_OK
The method was successful.
S_FALSE
The method was successful. However, Buffer was too small to hold the disassembled instruction and the instruction was truncated to fit.

This method can also return error values. See Return Values for more details.

Interface Version

Disassemble is available in all versions of IDebugControl. DisassembleWide is available in IDebugControl4 and later versions.

Comments

The assembly language depends on the effective processor type of the target system. For information about the assembly language, see the processor documentation.

The disassembly options—returned by GetAssemblyOptions—affect the operation of this method.

For an overview of using assembly in debugger applications, see Debugging in Assembly Mode. For more information about using assembly with the debugger engine API, see Assembling and Disassembling Instructions.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

Assemble, GetAssemblyOptions, u (Unassemble)

Build machine: CAPEBUILD