pub struct StructureBuilder { /* private fields */ }

Implementations

// Includes
use binaryninja::types::{Structure, Type};

// Define struct, set size (in bytes)
let mut my_custom_struct = StructureBuilder::new();
let field_1 = Type::named_int(5, false, "my_weird_int_type");
let field_2 = Type::int(4, false);
let field_3 = Type::int(8, false);

// Assign those fields
my_custom_struct.append(&field_1, "field_4");
my_custom_struct.insert(&field_1, "field_1", 0);
my_custom_struct.insert(&field_2, "field_2", 5);
my_custom_struct.insert(&field_3, "field_3", 9);

// Convert structure to type
let my_custom_structure_type = Self::structure_type(&mut my_custom_struct);

// Add the struct to the binary view to use in analysis
let bv = unsafe { BinaryView::from_raw(view) };
bv.define_user_type("my_custom_struct", &my_custom_structure_type);

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Executes the destructor for this type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.