pub struct BinaryView { /* private fields */ }

Implementations§

source§

impl BinaryView

source

pub fn from_filename<S: BnStrCompatible>( meta: &mut FileMetadata, filename: S ) -> Result<Ref<Self>>

source

pub fn from_accessor( meta: &FileMetadata, file: &mut FileAccessor<'_> ) -> Result<Ref<Self>>

source

pub fn from_data(meta: &FileMetadata, data: &[u8]) -> Result<Ref<Self>>

Trait Implementations§

source§

impl AsRef<BinaryView> for BinaryView

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl BinaryViewBase for BinaryView

source§

fn read(&self, buf: &mut [u8], offset: u64) -> usize

source§

fn write(&self, offset: u64, data: &[u8]) -> usize

source§

fn insert(&self, offset: u64, data: &[u8]) -> usize

source§

fn remove(&self, offset: u64, len: usize) -> usize

source§

fn modification_status(&self, offset: u64) -> ModificationStatus

source§

fn offset_valid(&self, offset: u64) -> bool

source§

fn offset_readable(&self, offset: u64) -> bool

source§

fn offset_writable(&self, offset: u64) -> bool

source§

fn offset_executable(&self, offset: u64) -> bool

source§

fn offset_backed_by_file(&self, offset: u64) -> bool

source§

fn next_valid_offset_after(&self, offset: u64) -> u64

source§

fn default_endianness(&self) -> Endianness

source§

fn relocatable(&self) -> bool

source§

fn address_size(&self) -> usize

source§

fn start(&self) -> u64

source§

fn len(&self) -> usize

source§

fn entry_point(&self) -> u64

source§

fn executable(&self) -> bool

source§

fn save(&self) -> bool

source§

impl Debug for BinaryView

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for BinaryView

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 BinaryView

source§

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

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

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

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

impl ToOwned for BinaryView

§

type Owned = Ref<BinaryView>

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 BinaryView

source§

impl Send for BinaryView

source§

impl StructuralPartialEq for BinaryView

source§

impl Sync for BinaryView

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> BinaryViewExt for T
where T: BinaryViewBase,

source§

fn file(&self) -> Ref<FileMetadata>

source§

fn type_name(&self) -> BnString

source§

fn parent_view(&self) -> Result<Ref<BinaryView>>

source§

fn raw_view(&self) -> Result<Ref<BinaryView>>

source§

fn view_type(&self) -> BnString

source§

fn read_vec(&self, offset: u64, len: usize) -> Vec<u8>

Reads up to len bytes from address offset
source§

fn read_into_vec(&self, dest: &mut Vec<u8>, offset: u64, len: usize) -> usize

Appends up to len bytes from address offset into dest
source§

fn notify_data_written(&self, offset: u64, len: usize)

source§

fn notify_data_inserted(&self, offset: u64, len: usize)

source§

fn notify_data_removed(&self, offset: u64, len: usize)

source§

fn offset_has_code_semantics(&self, offset: u64) -> bool

source§

fn offset_has_writable_semantics(&self, offset: u64) -> bool

source§

fn original_image_base(&self) -> u64

source§

fn set_original_image_base(&self, image_base: u64)

source§

fn end(&self) -> u64

source§

fn add_analysis_option(&self, name: impl BnStrCompatible)

source§

fn has_initial_analysis(&self) -> bool

source§

fn set_analysis_hold(&self, enable: bool)

source§

fn update_analysis(&self)

source§

fn update_analysis_and_wait(&self)

source§

fn abort_analysis(&self)

source§

fn analysis_info(&self) -> Result<AnalysisInfo>

source§

fn analysis_progress(&self) -> AnalysisProgress

source§

fn default_arch(&self) -> Option<CoreArchitecture>

source§

fn set_default_arch<A: Architecture>(&self, arch: &A)

source§

fn default_platform(&self) -> Option<Ref<Platform>>

source§

fn set_default_platform(&self, plat: &Platform)

source§

fn instruction_len<A: Architecture>(&self, arch: &A, addr: u64) -> Option<usize>

source§

fn symbol_by_address(&self, addr: u64) -> Result<Ref<Symbol>>

source§

fn symbol_by_raw_name<S: BnStrCompatible>( &self, raw_name: S ) -> Result<Ref<Symbol>>

source§

fn symbols(&self) -> Array<Symbol>

source§

fn symbols_by_name<S: BnStrCompatible>(&self, name: S) -> Array<Symbol>

source§

fn symbols_in_range(&self, range: Range<u64>) -> Array<Symbol>

source§

fn symbols_of_type(&self, ty: SymbolType) -> Array<Symbol>

source§

fn symbols_of_type_in_range( &self, ty: SymbolType, range: Range<u64> ) -> Array<Symbol>

source§

fn define_auto_symbol(&self, sym: &Symbol)

source§

fn define_auto_symbol_with_type<'a, T: Into<Option<&'a Type>>>( &self, sym: &Symbol, plat: &Platform, ty: T ) -> Result<Ref<Symbol>>

source§

fn undefine_auto_symbol(&self, sym: &Symbol)

source§

fn define_user_symbol(&self, sym: &Symbol)

source§

fn undefine_user_symbol(&self, sym: &Symbol)

source§

fn data_variables(&self) -> Array<DataVariable>

source§

fn data_variable_at_address(&self, addr: u64) -> Option<Ref<DataVariable>>

source§

fn define_auto_data_var<'a, T: Into<Conf<&'a Type>>>(&self, addr: u64, ty: T)

source§

fn define_user_data_var<'a, T: Into<Conf<&'a Type>>>(&self, addr: u64, ty: T)

You likely would also like to call Self::define_user_symbol to bind this data variable with a name
source§

fn undefine_auto_data_var(&self, addr: u64, blacklist: Option<bool>)

source§

fn undefine_user_data_var(&self, addr: u64)

source§

fn define_auto_type<S: BnStrCompatible>( &self, name: S, source: S, type_obj: &Type ) -> QualifiedName

source§

fn define_auto_type_with_id<S: BnStrCompatible>( &self, name: S, id: S, type_obj: &Type ) -> QualifiedName

source§

fn define_user_type<S: BnStrCompatible>(&self, name: S, type_obj: &Type)

source§

fn define_auto_types<S: BnStrCompatible>( &self, names_sources_and_types: Vec<(S, S, &Type)>, progress: Option<Box<dyn Fn(usize, usize) -> Result<()>>> ) -> HashMap<String, QualifiedName>

source§

fn define_user_types<S: BnStrCompatible>( &self, names_and_types: Vec<(S, &Type)>, progress: Option<Box<dyn Fn(usize, usize) -> Result<()>>> )

source§

fn undefine_auto_type<S: BnStrCompatible>(&self, id: S)

source§

fn undefine_user_type<S: BnStrCompatible>(&self, name: S)

source§

fn types(&self) -> Array<QualifiedNameAndType>

source§

fn dependency_sorted_types(&self) -> Array<QualifiedNameAndType>

source§

fn get_type_by_name<S: BnStrCompatible>(&self, name: S) -> Option<Ref<Type>>

source§

fn get_type_by_ref(&self, ref_: &NamedTypeReference) -> Option<Ref<Type>>

source§

fn get_type_by_id<S: BnStrCompatible>(&self, id: S) -> Option<Ref<Type>>

source§

fn get_type_name_by_id<S: BnStrCompatible>( &self, id: S ) -> Option<QualifiedName>

source§

fn get_type_id<S: BnStrCompatible>(&self, name: S) -> Option<BnString>

source§

fn is_type_auto_defined<S: BnStrCompatible>(&self, name: S) -> bool

source§

fn segments(&self) -> Array<Segment>

source§

fn segment_at(&self, addr: u64) -> Option<Segment>

source§

fn add_segment(&self, segment: SegmentBuilder)

Adds a segment to the view. Read more
source§

fn begin_bulk_add_segments(&self)

Start adding segments in bulk. Useful for adding large numbers of segments. Read more
source§

fn end_bulk_add_segments(&self)

Commit all auto and user segments that have been added since the call to Self::begin_bulk_add_segments. Read more
source§

fn cancel_bulk_add_segments(&self)

Flushes the auto and user segments that have yet to be committed. Read more
source§

fn add_section<S: BnStrCompatible>(&self, section: SectionBuilder<S>)

source§

fn remove_auto_section<S: BnStrCompatible>(&self, name: S)

source§

fn remove_user_section<S: BnStrCompatible>(&self, name: S)

source§

fn section_by_name<S: BnStrCompatible>(&self, name: S) -> Result<Section>

source§

fn sections(&self) -> Array<Section>

source§

fn sections_at(&self, addr: u64) -> Array<Section>

source§

fn add_auto_function(&self, plat: &Platform, addr: u64) -> Option<Ref<Function>>

source§

fn add_function_with_type( &self, plat: &Platform, addr: u64, auto_discovered: bool, func_type: Option<&Type> ) -> Option<Ref<Function>>

source§

fn add_entry_point(&self, plat: &Platform, addr: u64)

source§

fn create_user_function( &self, plat: &Platform, addr: u64 ) -> Result<Ref<Function>>

source§

fn has_functions(&self) -> bool

source§

fn entry_point_function(&self) -> Result<Ref<Function>>

source§

fn entry_point_functions(&self) -> Array<Function>

source§

fn functions(&self) -> Array<Function>

source§

fn functions_at(&self, addr: u64) -> Array<Function>

List of functions starting at addr
source§

fn functions_containing(&self, addr: u64) -> Array<Function>

source§

fn function_at(&self, platform: &Platform, addr: u64) -> Result<Ref<Function>>

source§

fn function_start_before(&self, addr: u64) -> u64

source§

fn function_start_after(&self, addr: u64) -> u64

source§

fn basic_blocks_containing(&self, addr: u64) -> Array<BasicBlock<NativeBlock>>

source§

fn basic_blocks_starting_at(&self, addr: u64) -> Array<BasicBlock<NativeBlock>>

source§

fn is_new_auto_function_analysis_suppressed(&self) -> bool

source§

fn set_new_auto_function_analysis_suppressed(&self, suppress: bool)

source§

fn read_buffer(&self, offset: u64, len: usize) -> Result<DataBuffer>

source§

fn debug_info(&self) -> Ref<DebugInfo>

source§

fn set_debug_info(&self, debug_info: &DebugInfo)

source§

fn apply_debug_info(&self, debug_info: &DebugInfo)

source§

fn show_graph_report<S: BnStrCompatible>(&self, raw_name: S, graph: &FlowGraph)

source§

fn load_settings<S: BnStrCompatible>( &self, view_type_name: S ) -> Result<Ref<Settings>>

source§

fn set_load_settings<S: BnStrCompatible>( &self, view_type_name: S, settings: &Settings )

source§

fn create_tag_type<N: BnStrCompatible, I: BnStrCompatible>( &self, name: N, icon: I ) -> Ref<TagType>

Creates a new TagType and adds it to the view. Read more
source§

fn remove_tag_type(&self, tag_type: &TagType)

Removes a TagType and all tags that use it
source§

fn get_tag_type<S: BnStrCompatible>(&self, name: S) -> Option<Ref<TagType>>

Get a tag type by its name.
source§

fn get_tag<S: BnStrCompatible>(&self, id: S) -> Option<Ref<Tag>>

Get a tag by its id. Read more
source§

fn add_tag<S: BnStrCompatible>( &self, addr: u64, t: &TagType, data: S, user: bool )

Creates and adds a tag to an address Read more
source§

fn remove_auto_data_tag(&self, addr: u64, tag: &Tag)

removes a Tag object at a data address.
source§

fn remove_user_data_tag(&self, addr: u64, tag: &Tag)

removes a Tag object at a data address. Since this removes a user tag, it will be added to the current undo buffer.
source§

fn get_next_linear_disassembly_lines( &self, pos: &mut LinearViewCursor ) -> Array<LinearDisassemblyLine>

Retrieves a list of the next disassembly lines. Read more
source§

fn get_previous_linear_disassembly_lines( &self, pos: &mut LinearViewCursor ) -> Array<LinearDisassemblyLine>

Retrieves a list of the previous disassembly lines. Read more
source§

fn query_metadata<S: BnStrCompatible>(&self, key: S) -> Option<Ref<Metadata>>

source§

fn get_metadata<T, S: BnStrCompatible>(&self, key: S) -> Option<Result<T>>
where T: for<'a> TryFrom<&'a Metadata>,

source§

fn store_metadata<V, S: BnStrCompatible>(&self, key: S, value: V, is_auto: bool)
where V: Into<Ref<Metadata>>,

source§

fn remove_metadata<S: BnStrCompatible>(&self, key: S)

source§

fn get_code_refs(&self, addr: u64) -> Array<CodeReference>

Retrieves a list of CodeReferences pointing to a given address.
source§

fn get_code_refs_from(&self, addr: u64, func: Option<&Function>) -> Vec<u64>

Retrieves a list of addresses pointed to by a given address.
source§

fn get_code_refs_in_range(&self, range: Range<u64>) -> Array<CodeReference>

Retrieves a list of CodeReferences pointing into a given Range.
source§

fn get_data_refs(&self, addr: u64) -> Array<DataReference>

Retrieves a list of DataReferences pointing to a given address.
source§

fn get_data_refs_from(&self, addr: u64) -> Array<DataReference>

Retrieves a list of DataReferences originating from a given address.
source§

fn get_data_refs_in_range(&self, range: Range<u64>) -> Array<DataReference>

Retrieves a list of DataReferences pointing into a given Range.
source§

fn get_code_refs_for_type<B: BnStrCompatible>( &self, name: B ) -> Array<CodeReference>

Retrieves a list of CodeReferences for locations in code that use a given named type. Read more
source§

fn get_data_refs_for_type<B: BnStrCompatible>( &self, name: B ) -> Array<DataReference>

Retrieves a list of DataReferences instances of a given named type in data. Read more
source§

fn get_relocations_at(&self, addr: u64) -> Array<Relocation>

source§

fn get_relocation_ranges(&self) -> Vec<Range<u64>>

source§

fn component_by_guid<S: BnStrCompatible>(&self, guid: S) -> Option<Component>

source§

fn root_component(&self) -> Option<Component>

source§

fn component_builder(&self) -> ComponentBuilder

source§

fn component_by_path<P: BnStrCompatible>(&self, path: P) -> Option<Component>

source§

fn remove_component(&self, component: &Component) -> bool

source§

fn remove_component_by_guid<P: IntoComponentGuid>(&self, guid: P) -> bool

source§

fn data_variable_parent_components( &self, data_variable: &DataVariable ) -> Array<Component>

source§

fn add_type_library(&self, library: &TypeLibrary)

Make the contents of a type library available for type/import resolution
source§

fn type_library_by_name<S: BnStrCompatible>( &self, name: S ) -> Option<TypeLibrary>

source§

fn record_imported_object_library( &self, lib: &TypeLibrary, name: &QualifiedName, addr: u64, platform: &Platform )

Should be called by custom py:py:class:BinaryView implementations when they have successfully imported an object from a type library (eg a symbol’s type). Values recorded with this function will then be queryable via BinaryViewExt::lookup_imported_object_library. Read more
source§

fn import_type_library( &self, name: &QualifiedName, lib: Option<TypeLibrary> ) -> Option<Ref<Type>>

Recursively imports a type from the specified type library, or, if no library was explicitly provided, the first type library associated with the current BinaryView that provides the name requested. Read more
source§

fn import_type_object( &self, name: &QualifiedName, lib: Option<TypeLibrary> ) -> Option<Ref<Type>>

Recursively imports an object from the specified type library, or, if no library was explicitly provided, the first type library associated with the current BinaryView that provides the name requested. Read more
source§

fn import_type_by_guid<S: BnStrCompatible>(&self, guid: S) -> Option<Ref<Type>>

Recursively imports a type interface given its GUID. Read more
source§

fn export_type_to_library( &self, lib: &TypeLibrary, name: &QualifiedName, type_obj: &Type )

Recursively exports type_obj into lib as a type with name name Read more
source§

fn export_object_to_library( &self, lib: &TypeLibrary, name: &QualifiedName, type_obj: &Type )

Recursively exports type_obj into lib as a type with name name Read more
source§

fn lookup_imported_object_library( &self, addr: u64, platform: &Platform ) -> Option<(TypeLibrary, QualifiedName)>

Gives you details of which type library and name was used to determine the type of a symbol at a given address Read more
source§

fn lookup_imported_type_library( &self, name: &QualifiedNameAndType ) -> Option<(TypeLibrary, QualifiedName)>

Gives you details of from which type library and name a given type in the analysis was imported. 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>,

§

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>,

§

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.