Skip to main content

disassemble_to_buffer

Function disassemble_to_buffer 

Source
pub unsafe extern "C" fn disassemble_to_buffer(
    drcontext: *mut c_void,
    pc: *mut byte,
    orig_pc: *mut byte,
    show_pc: bool_,
    show_bytes: bool_,
    buf: *mut c_char,
    bufsz: usize,
    printed: *mut c_int,
) -> *mut byte
Expand description

Decodes the instruction at address \p pc as though it were located at address \p orig_pc, and then prints the instruction to the buffer \p buf. Always null-terminates, and will not print more than \p bufsz characters, which includes the final null character. Indicates the number of characters printed, not including the final null, in \p printed, if \p printed is non-NULL.

Prior to the instruction the address \p orig_pc is printed if \p show_pc and the raw bytes are printed if \p show_bytes. The default is to use DR’s custom syntax (see disassemble_set_syntax()). Returns the address of the subsequent instruction after the copy at \p copy_pc, or NULL if the instruction at \p copy_pc is invalid.