Function libudis86_sys::ud_set_syntax [] [src]

pub unsafe extern "C" fn ud_set_syntax(
    ud: *mut ud,
    translator: Option<unsafe extern "C" fn(_: *mut ud)>
)

Sets the function that translates the intermediate decode information to a human readable form. There are two inbuilt translators,

  • ud_translate_intel for INTEL (NASM-like) syntax.
  • ud_translate_att for AT&T (GAS-like) syntax.

If you do not want libudis86 to translate, you can pass NULL to the function, with no more translations thereafter. This is useful when you only want to identify chunks of code and then create the assembly output if needed, or when you are only interested in examining the instructions and do not want to waste cycles generating the assembly language output.

If you want to create your own translator, you can specify a pointer to your own function. This function must accept a single parameter, the udis86 object ud_t, and it will be invoked everytime an instruction is decoded.