Data Structures | ||||
struct | xed_format_options_t | |||
Options for the disasembly formatting functions. More... | ||||
struct | xed_print_info_t | |||
This contains the information used by the various disassembly printers. More... | ||||
xed_decoded_inst_t Printers | ||||
XED_DLL_EXPORT void | xed_decoded_inst_dump (const xed_decoded_inst_t *p, char *buf, int buflen) | |||
Print out all the information about the decoded instruction to the buffer buf whose length is maximally buflen. | ||||
XED_DLL_EXPORT xed_bool_t | xed_decoded_inst_dump_xed_format (const xed_decoded_inst_t *p, char *buf, int buflen, xed_uint64_t runtime_address) | |||
Print the instruction information in a verbose format. | ||||
XED_DLL_EXPORT xed_bool_t | xed_format_context (xed_syntax_enum_t syntax, const xed_decoded_inst_t *xedd, char *out_buffer, int buffer_len, xed_uint64_t runtime_instruction_address, void *context, xed_disassembly_callback_fn_t symbolic_callback) | |||
Disassemble the decoded instruction using the specified syntax. | ||||
XED_DLL_EXPORT xed_bool_t | xed_format_generic (xed_print_info_t *pi) | |||
Disassemble the instruction information to a buffer. | ||||
Formatting options | ||||
XED_DLL_EXPORT void | xed_format_set_options (xed_format_options_t format_options) | |||
Optionally, customize the disassembly formatting options by passing in a xed_format_options_t structure. | ||||
Typedefs | ||||
typedef int(*) | xed_disassembly_callback_fn_t (xed_uint64_t address, char *symbol_buffer, xed_uint32_t buffer_length, xed_uint64_t *offset, void *context) | |||
| ||||
Functions | ||||
XED_DLL_EXPORT void | xed_init_print_info (xed_print_info_t *pi) |
The disassembly dialect (order of operands and formatting) is specified by the xed_syntax_enum_t parameter. For finer control on certain aspects of disassembly, the parameter to xed_format_generic() has a field specifing lower level formatting options (xed_format_options_t).
typedef int(*) xed_disassembly_callback_fn_t(xed_uint64_t address, char *symbol_buffer, xed_uint32_t buffer_length, xed_uint64_t *offset, void *context) |
address | The input address for which we want symbolic name and offset |
symbol_buffer | A buffer to hold the symbol name. The callback function should fill this in and terminate with a null byte. | |
buffer_length | The maximum length of the symbol_buffer including then null | |
offset | A pointer to a xed_uint64_t to hold the offset from the provided symbol. | |
context | This void* pointer passed to the disassembler's new interface so that the caller can identify the proper context against which to resolve the symbols. The disassembler passes this value to the callback. The legacy formatters that do not have context will pass zero for this parameter. |
Definition at line 58 of file xed-disas.h.
XED_DLL_EXPORT void xed_decoded_inst_dump | ( | const xed_decoded_inst_t * | p, | |
char * | buf, | |||
int | buflen | |||
) |
Print out all the information about the decoded instruction to the buffer buf whose length is maximally buflen.
This is for debugging.
XED_DLL_EXPORT xed_bool_t xed_decoded_inst_dump_xed_format | ( | const xed_decoded_inst_t * | p, | |
char * | buf, | |||
int | buflen, | |||
xed_uint64_t | runtime_address | |||
) |
Print the instruction information in a verbose format.
This is for debugging.
p | a xed_decoded_inst_t for a decoded instruction | |
buf | a buffer to write the disassembly in to. | |
buflen | maximum length of the disassembly buffer | |
runtime_address | the address of the instruction being disassembled. If zero, the offset is printed for relative branches. If nonzero, XED attempts to print the target address for relative branches. |
XED_DLL_EXPORT xed_bool_t xed_format_context | ( | xed_syntax_enum_t | syntax, | |
const xed_decoded_inst_t * | xedd, | |||
char * | out_buffer, | |||
int | buffer_len, | |||
xed_uint64_t | runtime_instruction_address, | |||
void * | context, | |||
xed_disassembly_callback_fn_t | symbolic_callback | |||
) |
Disassemble the decoded instruction using the specified syntax.
The output buffer must be at least 25 bytes long. Returns true if disassembly proceeded without errors.
syntax | a xed_syntax_enum_t the specifies the disassembly format | |
xedd | a xed_decoded_inst_t for a decoded instruction | |
out_buffer | a buffer to write the disassembly in to. | |
buffer_len | maximum length of the disassembly buffer | |
runtime_instruction_address | the address of the instruction being disassembled. If zero, the offset is printed for relative branches. If nonzero, XED attempts to print the target address for relative branches. | |
context | A void* used only for the call back routine for symbolic disassembly if one is provided. Can be zero. | |
symbolic_callback | A function pointer for obtaining symbolic disassembly. Can be zero. |
XED_DLL_EXPORT xed_bool_t xed_format_generic | ( | xed_print_info_t * | pi | ) |
Disassemble the instruction information to a buffer.
See the xed_print_info_t for the required public fields of the argument. This is the preferred method of doing disassembly. The output buffer must be at least 25 bytes long.
pi | a xed_print_info_t |
XED_DLL_EXPORT void xed_format_set_options | ( | xed_format_options_t | format_options | ) |
Optionally, customize the disassembly formatting options by passing in a xed_format_options_t structure.
XED_DLL_EXPORT void xed_init_print_info | ( | xed_print_info_t * | pi | ) |