binaryninja::high_level_il::token_emitter

Struct HighLevelILTokenEmitter

source
pub struct HighLevelILTokenEmitter { /* private fields */ }

Implementations§

source§

impl HighLevelILTokenEmitter

source

pub fn current_tokens(&self) -> Array<InstructionTextToken>

Returns the list of InstructionTextToken on the current line.

source

pub fn lines(&self) -> Array<DisassemblyTextLine>

Returns the list of DisassemblyTextLine in the output.

source

pub fn prepend_collapse_blank_indicator(&self)

source

pub fn prepend_collapse_indicator( &self, context: InstructionTextTokenContext, hash: u64, )

source

pub fn has_collapsible_regions(&self) -> bool

source

pub fn set_has_collapsible_regions(&self, state: bool)

source

pub fn append(&self, token: InstructionTextToken)

source

pub fn init_line(&self)

Starts a new line in the output.

source

pub fn new_line(&self)

Starts a new line in the output.

source

pub fn increase_indent(&self)

Increases the indentation level by one.

source

pub fn decrease_indent(&self)

Decreases the indentation level by one.

source

pub fn scope_separator(&self)

Indicates that visual separation of scopes is desirable at the current position.

By default, this will insert a blank line, but this can be configured by the user.

source

pub fn begin_scope(&self, ty: ScopeType)

Begins a new scope. Insertion of newlines and braces will be handled using the current settings.

source

pub fn end_scope(&self, ty: ScopeType)

Ends the current scope.

The type ty should be equal to what was passed to HighLevelILTokenEmitter::begin_scope.

source

pub fn scope_continuation(&self, force_same_line: bool)

Continues the previous scope with a new associated scope. This is most commonly used for else statements.

If force_same_line is true, the continuation will always be placed on the same line as the previous scope.

source

pub fn finalize_scope(&self)

Finalizes the previous scope, indicating that there are no more associated scopes.

source

pub fn no_indent_for_this_line(&self)

Forces there to be no indentation for the next line.

source

pub fn begin_force_zero_confidence(&self)

Begins a region of tokens that always have zero confidence.

source

pub fn end_force_zero_confidence(&self)

Ends a region of tokens that always have zero confidence.

source

pub fn set_current_expr( &self, expr: TokenEmitterExpr, ) -> CurrentTokenEmitterExpr

Sets the current expression. Returning the CurrentTokenEmitterExpr which when dropped will restore the previously active TokenEmitterExpr.

source

pub fn finalize(&self)

Finalizes the outputted lines.

source

pub fn append_open_paren(&self)

Appends (.

source

pub fn append_close_paren(&self)

Appends ).

source

pub fn append_open_bracket(&self)

Appends [.

source

pub fn append_close_bracket(&self)

Appends ].

source

pub fn append_open_brace(&self)

Appends {.

source

pub fn append_close_brace(&self)

Appends }.

source

pub fn append_semicolon(&self)

Appends ;.

source

pub fn set_brace_requirement(&self, required: BraceRequirement)

Sets the requirement for insertion of braces around scopes in the output.

source

pub fn set_braces_around_switch_cases(&self, braces: bool)

Sets whether cases within switch statements should always have braces around them.

source

pub fn set_default_braces_on_same_line(&self, same_line: bool)

Sets whether braces should default to being on the same line as the statement that begins the scope.

If the user has explicitly set a preference, this setting will be ignored and the user’s preference will be used instead.

source

pub fn set_simple_scope_allowed(&self, allowed: bool)

Sets whether omitting braces around single-line scopes is allowed.

source

pub fn brace_requirement(&self) -> BraceRequirement

source

pub fn has_braces_around_switch_cases(&self) -> bool

source

pub fn default_braces_on_same_line(&self) -> bool

source

pub fn is_simple_scope_allowed(&self) -> bool

source

pub fn append_size_token(&self, size: usize, ty: InstructionTextTokenType)

Appends a size token for the given size in the High Level IL syntax.

source

pub fn append_float_size_token(&self, size: usize, ty: InstructionTextTokenType)

Appends a floating point size token for the given size in the High Level IL syntax.

source

pub fn append_var_text_token( &self, func: &HighLevelILFunction, var: Variable, expr_index: usize, size: usize, )

Appends tokens for access to a variable.

source

pub fn append_integer_text_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, size: usize, )

Appends tokens for a constant integer value.

source

pub fn append_array_index_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, size: usize, address: Option<u64>, )

Appends tokens for accessing an array by constant index.

source

pub fn append_pointer_text_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, settings: &DisassemblySettings, symbol_display: SymbolDisplayType, precedence: OperatorPrecedence, allow_short_string: bool, ) -> SymbolDisplayResult

Appends tokens for displaying a constant pointer value.

If allow_short_string is true, then a string will be shown even if it is “short”.

source

pub fn append_constant_text_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, size: usize, settings: &DisassemblySettings, precedence: OperatorPrecedence, )

Appends tokens for a constant value.

Trait Implementations§

source§

impl Hash for HighLevelILTokenEmitter

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for HighLevelILTokenEmitter

source§

fn eq(&self, other: &HighLevelILTokenEmitter) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToOwned for HighLevelILTokenEmitter

source§

type Owned = Ref<HighLevelILTokenEmitter>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl Eq for HighLevelILTokenEmitter

source§

impl Send for HighLevelILTokenEmitter

source§

impl StructuralPartialEq for HighLevelILTokenEmitter

source§

impl Sync for HighLevelILTokenEmitter

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.