|
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. More...
|
|
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. More...
|
|
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. More...
|
|
XED_DLL_EXPORT xed_bool_t | xed_format_generic (xed_print_info_t *pi) |
| Disassemble the instruction information to a buffer. More...
|
|
There are two kinds of printers. The legacy printers to not take a void* context parameter. The other printers take a void* context parameter that is only passed to a callback function registered by calling #xed_register_disassembly_callback(). The callback is used for symbolic disassembly.
If using the callback, register a callback once before you program creates its threads.
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) |
A xed_disassembly_callback_fn_t takes an address, a pointer to a symbol buffer of buffer_length bytes, and a pointer to an offset.
The function fills in the symbol_buffer and sets the offset to the desired offset for that symbol. If the function succeeds, it returns 1.
- Parameters
-
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. |
- Returns
- 0 on failure, 1 on success.
Definition at line 58 of file xed-disas.h.
Print out all the information about the decoded instruction to the buffer buf whose length is maximally buflen.
This is for debugging.
Print the instruction information in a verbose format.
This is for debugging.
- Parameters
-
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. |
- Returns
- Returns 0 if the disassembly fails, 1 otherwise.
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.
- Parameters
-
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 registered. Can be zero. |
symbolic_callback | A function pointer for obtaining symbolic disassembly if one is registered. Can be zero. |
- Returns
- Returns 0 if the disassembly fails, 1 otherwise.
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.
- Parameters
-
- Returns
- Returns 0 if the disassembly fails, 1 otherwise.
Optionally, customize the disassembly formatting options by passing in a xed_format_options_t structure.