Trait binaryninja::binaryview::BinaryViewExt
source · pub trait BinaryViewExt: BinaryViewBase {
Show 137 methods
// Provided methods
fn file(&self) -> Ref<FileMetadata> { ... }
fn type_name(&self) -> BnString { ... }
fn parent_view(&self) -> Result<Ref<BinaryView>> { ... }
fn raw_view(&self) -> Result<Ref<BinaryView>> { ... }
fn view_type(&self) -> BnString { ... }
fn read_vec(&self, offset: u64, len: usize) -> Vec<u8> { ... }
fn read_into_vec(
&self,
dest: &mut Vec<u8>,
offset: u64,
len: usize
) -> usize { ... }
fn notify_data_written(&self, offset: u64, len: usize) { ... }
fn notify_data_inserted(&self, offset: u64, len: usize) { ... }
fn notify_data_removed(&self, offset: u64, len: usize) { ... }
fn offset_has_code_semantics(&self, offset: u64) -> bool { ... }
fn offset_has_writable_semantics(&self, offset: u64) -> bool { ... }
fn original_image_base(&self) -> u64 { ... }
fn set_original_image_base(&self, image_base: u64) { ... }
fn end(&self) -> u64 { ... }
fn add_analysis_option(&self, name: impl BnStrCompatible) { ... }
fn has_initial_analysis(&self) -> bool { ... }
fn set_analysis_hold(&self, enable: bool) { ... }
fn update_analysis(&self) { ... }
fn update_analysis_and_wait(&self) { ... }
fn abort_analysis(&self) { ... }
fn analysis_info(&self) -> Result<AnalysisInfo> { ... }
fn analysis_progress(&self) -> AnalysisProgress { ... }
fn default_arch(&self) -> Option<CoreArchitecture> { ... }
fn set_default_arch<A: Architecture>(&self, arch: &A) { ... }
fn default_platform(&self) -> Option<Ref<Platform>> { ... }
fn set_default_platform(&self, plat: &Platform) { ... }
fn instruction_len<A: Architecture>(
&self,
arch: &A,
addr: u64
) -> Option<usize> { ... }
fn symbol_by_address(&self, addr: u64) -> Result<Ref<Symbol>> { ... }
fn symbol_by_raw_name<S: BnStrCompatible>(
&self,
raw_name: S
) -> Result<Ref<Symbol>> { ... }
fn symbols(&self) -> Array<Symbol> { ... }
fn symbols_by_name<S: BnStrCompatible>(&self, name: S) -> Array<Symbol> { ... }
fn symbols_in_range(&self, range: Range<u64>) -> Array<Symbol> { ... }
fn symbols_of_type(&self, ty: SymbolType) -> Array<Symbol> { ... }
fn symbols_of_type_in_range(
&self,
ty: SymbolType,
range: Range<u64>
) -> Array<Symbol> { ... }
fn define_auto_symbol(&self, sym: &Symbol) { ... }
fn define_auto_symbol_with_type<'a, T: Into<Option<&'a Type>>>(
&self,
sym: &Symbol,
plat: &Platform,
ty: T
) -> Result<Ref<Symbol>> { ... }
fn undefine_auto_symbol(&self, sym: &Symbol) { ... }
fn define_user_symbol(&self, sym: &Symbol) { ... }
fn undefine_user_symbol(&self, sym: &Symbol) { ... }
fn data_variables(&self) -> Array<DataVariable> { ... }
fn data_variable_at_address(&self, addr: u64) -> Option<Ref<DataVariable>> { ... }
fn define_auto_data_var<'a, T: Into<Conf<&'a Type>>>(
&self,
addr: u64,
ty: T
) { ... }
fn define_user_data_var<'a, T: Into<Conf<&'a Type>>>(
&self,
addr: u64,
ty: T
) { ... }
fn undefine_auto_data_var(&self, addr: u64, blacklist: Option<bool>) { ... }
fn undefine_user_data_var(&self, addr: u64) { ... }
fn define_auto_type<S: BnStrCompatible>(
&self,
name: S,
source: S,
type_obj: &Type
) -> QualifiedName { ... }
fn define_auto_type_with_id<S: BnStrCompatible>(
&self,
name: S,
id: S,
type_obj: &Type
) -> QualifiedName { ... }
fn define_user_type<S: BnStrCompatible>(&self, name: S, type_obj: &Type) { ... }
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> { ... }
fn define_user_types<S: BnStrCompatible>(
&self,
names_and_types: Vec<(S, &Type)>,
progress: Option<Box<dyn Fn(usize, usize) -> Result<()>>>
) { ... }
fn undefine_auto_type<S: BnStrCompatible>(&self, id: S) { ... }
fn undefine_user_type<S: BnStrCompatible>(&self, name: S) { ... }
fn types(&self) -> Array<QualifiedNameAndType> { ... }
fn dependency_sorted_types(&self) -> Array<QualifiedNameAndType> { ... }
fn get_type_by_name<S: BnStrCompatible>(&self, name: S) -> Option<Ref<Type>> { ... }
fn get_type_by_ref(&self, ref_: &NamedTypeReference) -> Option<Ref<Type>> { ... }
fn get_type_by_id<S: BnStrCompatible>(&self, id: S) -> Option<Ref<Type>> { ... }
fn get_type_name_by_id<S: BnStrCompatible>(
&self,
id: S
) -> Option<QualifiedName> { ... }
fn get_type_id<S: BnStrCompatible>(&self, name: S) -> Option<BnString> { ... }
fn is_type_auto_defined<S: BnStrCompatible>(&self, name: S) -> bool { ... }
fn segments(&self) -> Array<Segment> { ... }
fn segment_at(&self, addr: u64) -> Option<Segment> { ... }
fn add_segment(&self, segment: SegmentBuilder) { ... }
fn begin_bulk_add_segments(&self) { ... }
fn end_bulk_add_segments(&self) { ... }
fn cancel_bulk_add_segments(&self) { ... }
fn add_section<S: BnStrCompatible>(&self, section: SectionBuilder<S>) { ... }
fn remove_auto_section<S: BnStrCompatible>(&self, name: S) { ... }
fn remove_user_section<S: BnStrCompatible>(&self, name: S) { ... }
fn section_by_name<S: BnStrCompatible>(&self, name: S) -> Result<Section> { ... }
fn sections(&self) -> Array<Section> { ... }
fn sections_at(&self, addr: u64) -> Array<Section> { ... }
fn add_auto_function(
&self,
plat: &Platform,
addr: u64
) -> Option<Ref<Function>> { ... }
fn add_function_with_type(
&self,
plat: &Platform,
addr: u64,
auto_discovered: bool,
func_type: Option<&Type>
) -> Option<Ref<Function>> { ... }
fn add_entry_point(&self, plat: &Platform, addr: u64) { ... }
fn create_user_function(
&self,
plat: &Platform,
addr: u64
) -> Result<Ref<Function>> { ... }
fn has_functions(&self) -> bool { ... }
fn entry_point_function(&self) -> Result<Ref<Function>> { ... }
fn entry_point_functions(&self) -> Array<Function> { ... }
fn functions(&self) -> Array<Function> { ... }
fn functions_at(&self, addr: u64) -> Array<Function> { ... }
fn functions_containing(&self, addr: u64) -> Array<Function> { ... }
fn function_at(
&self,
platform: &Platform,
addr: u64
) -> Result<Ref<Function>> { ... }
fn function_start_before(&self, addr: u64) -> u64 { ... }
fn function_start_after(&self, addr: u64) -> u64 { ... }
fn basic_blocks_containing(
&self,
addr: u64
) -> Array<BasicBlock<NativeBlock>> { ... }
fn basic_blocks_starting_at(
&self,
addr: u64
) -> Array<BasicBlock<NativeBlock>> { ... }
fn is_new_auto_function_analysis_suppressed(&self) -> bool { ... }
fn set_new_auto_function_analysis_suppressed(&self, suppress: bool) { ... }
fn read_buffer(&self, offset: u64, len: usize) -> Result<DataBuffer> { ... }
fn debug_info(&self) -> Ref<DebugInfo> { ... }
fn set_debug_info(&self, debug_info: &DebugInfo) { ... }
fn apply_debug_info(&self, debug_info: &DebugInfo) { ... }
fn show_graph_report<S: BnStrCompatible>(
&self,
raw_name: S,
graph: &FlowGraph
) { ... }
fn load_settings<S: BnStrCompatible>(
&self,
view_type_name: S
) -> Result<Ref<Settings>> { ... }
fn set_load_settings<S: BnStrCompatible>(
&self,
view_type_name: S,
settings: &Settings
) { ... }
fn create_tag_type<N: BnStrCompatible, I: BnStrCompatible>(
&self,
name: N,
icon: I
) -> Ref<TagType> { ... }
fn remove_tag_type(&self, tag_type: &TagType) { ... }
fn get_tag_type<S: BnStrCompatible>(&self, name: S) -> Option<Ref<TagType>> { ... }
fn get_tag<S: BnStrCompatible>(&self, id: S) -> Option<Ref<Tag>> { ... }
fn add_tag<S: BnStrCompatible>(
&self,
addr: u64,
t: &TagType,
data: S,
user: bool
) { ... }
fn remove_auto_data_tag(&self, addr: u64, tag: &Tag) { ... }
fn remove_user_data_tag(&self, addr: u64, tag: &Tag) { ... }
fn get_next_linear_disassembly_lines(
&self,
pos: &mut LinearViewCursor
) -> Array<LinearDisassemblyLine> { ... }
fn get_previous_linear_disassembly_lines(
&self,
pos: &mut LinearViewCursor
) -> Array<LinearDisassemblyLine> { ... }
fn query_metadata<S: BnStrCompatible>(
&self,
key: S
) -> Option<Ref<Metadata>> { ... }
fn get_metadata<T, S: BnStrCompatible>(&self, key: S) -> Option<Result<T>>
where T: for<'a> TryFrom<&'a Metadata> { ... }
fn store_metadata<V, S: BnStrCompatible>(
&self,
key: S,
value: V,
is_auto: bool
)
where V: Into<Ref<Metadata>> { ... }
fn remove_metadata<S: BnStrCompatible>(&self, key: S) { ... }
fn get_code_refs(&self, addr: u64) -> Array<CodeReference> { ... }
fn get_code_refs_from(&self, addr: u64, func: Option<&Function>) -> Vec<u64> { ... }
fn get_code_refs_in_range(&self, range: Range<u64>) -> Array<CodeReference> { ... }
fn get_data_refs(&self, addr: u64) -> Array<DataReference> { ... }
fn get_data_refs_from(&self, addr: u64) -> Array<DataReference> { ... }
fn get_data_refs_in_range(&self, range: Range<u64>) -> Array<DataReference> { ... }
fn get_code_refs_for_type<B: BnStrCompatible>(
&self,
name: B
) -> Array<CodeReference> { ... }
fn get_data_refs_for_type<B: BnStrCompatible>(
&self,
name: B
) -> Array<DataReference> { ... }
fn get_relocations_at(&self, addr: u64) -> Array<Relocation> { ... }
fn get_relocation_ranges(&self) -> Vec<Range<u64>> { ... }
fn component_by_guid<S: BnStrCompatible>(
&self,
guid: S
) -> Option<Component> { ... }
fn root_component(&self) -> Option<Component> { ... }
fn component_builder(&self) -> ComponentBuilder { ... }
fn component_by_path<P: BnStrCompatible>(
&self,
path: P
) -> Option<Component> { ... }
fn remove_component(&self, component: &Component) -> bool { ... }
fn remove_component_by_guid<P: IntoComponentGuid>(&self, guid: P) -> bool { ... }
fn data_variable_parent_components(
&self,
data_variable: &DataVariable
) -> Array<Component> { ... }
fn add_type_library(&self, library: &TypeLibrary) { ... }
fn type_library_by_name<S: BnStrCompatible>(
&self,
name: S
) -> Option<TypeLibrary> { ... }
fn record_imported_object_library(
&self,
lib: &TypeLibrary,
name: &QualifiedName,
addr: u64,
platform: &Platform
) { ... }
fn import_type_library(
&self,
name: &QualifiedName,
lib: Option<TypeLibrary>
) -> Option<Ref<Type>> { ... }
fn import_type_object(
&self,
name: &QualifiedName,
lib: Option<TypeLibrary>
) -> Option<Ref<Type>> { ... }
fn import_type_by_guid<S: BnStrCompatible>(
&self,
guid: S
) -> Option<Ref<Type>> { ... }
fn export_type_to_library(
&self,
lib: &TypeLibrary,
name: &QualifiedName,
type_obj: &Type
) { ... }
fn export_object_to_library(
&self,
lib: &TypeLibrary,
name: &QualifiedName,
type_obj: &Type
) { ... }
fn lookup_imported_object_library(
&self,
addr: u64,
platform: &Platform
) -> Option<(TypeLibrary, QualifiedName)> { ... }
fn lookup_imported_type_library(
&self,
name: &QualifiedNameAndType
) -> Option<(TypeLibrary, QualifiedName)> { ... }
}
Provided Methods§
fn file(&self) -> Ref<FileMetadata>
fn type_name(&self) -> BnString
fn parent_view(&self) -> Result<Ref<BinaryView>>
fn raw_view(&self) -> Result<Ref<BinaryView>>
fn view_type(&self) -> BnString
sourcefn read_vec(&self, offset: u64, len: usize) -> Vec<u8>
fn read_vec(&self, offset: u64, len: usize) -> Vec<u8>
Reads up to len
bytes from address offset
sourcefn read_into_vec(&self, dest: &mut Vec<u8>, offset: u64, len: usize) -> usize
fn read_into_vec(&self, dest: &mut Vec<u8>, offset: u64, len: usize) -> usize
Appends up to len
bytes from address offset
into dest
fn notify_data_written(&self, offset: u64, len: usize)
fn notify_data_inserted(&self, offset: u64, len: usize)
fn notify_data_removed(&self, offset: u64, len: usize)
fn offset_has_code_semantics(&self, offset: u64) -> bool
fn offset_has_writable_semantics(&self, offset: u64) -> bool
fn original_image_base(&self) -> u64
fn set_original_image_base(&self, image_base: u64)
fn end(&self) -> u64
fn add_analysis_option(&self, name: impl BnStrCompatible)
fn has_initial_analysis(&self) -> bool
fn set_analysis_hold(&self, enable: bool)
fn update_analysis(&self)
fn update_analysis_and_wait(&self)
fn abort_analysis(&self)
fn analysis_info(&self) -> Result<AnalysisInfo>
fn analysis_progress(&self) -> AnalysisProgress
fn default_arch(&self) -> Option<CoreArchitecture>
fn set_default_arch<A: Architecture>(&self, arch: &A)
fn default_platform(&self) -> Option<Ref<Platform>>
fn set_default_platform(&self, plat: &Platform)
fn instruction_len<A: Architecture>(&self, arch: &A, addr: u64) -> Option<usize>
fn symbol_by_address(&self, addr: u64) -> Result<Ref<Symbol>>
fn symbol_by_raw_name<S: BnStrCompatible>( &self, raw_name: S ) -> Result<Ref<Symbol>>
fn symbols(&self) -> Array<Symbol>
fn symbols_by_name<S: BnStrCompatible>(&self, name: S) -> Array<Symbol>
fn symbols_in_range(&self, range: Range<u64>) -> Array<Symbol>
fn symbols_of_type(&self, ty: SymbolType) -> Array<Symbol>
fn symbols_of_type_in_range( &self, ty: SymbolType, range: Range<u64> ) -> Array<Symbol>
fn define_auto_symbol(&self, sym: &Symbol)
fn define_auto_symbol_with_type<'a, T: Into<Option<&'a Type>>>( &self, sym: &Symbol, plat: &Platform, ty: T ) -> Result<Ref<Symbol>>
fn undefine_auto_symbol(&self, sym: &Symbol)
fn define_user_symbol(&self, sym: &Symbol)
fn undefine_user_symbol(&self, sym: &Symbol)
fn data_variables(&self) -> Array<DataVariable>
fn data_variable_at_address(&self, addr: u64) -> Option<Ref<DataVariable>>
fn define_auto_data_var<'a, T: Into<Conf<&'a Type>>>(&self, addr: u64, ty: T)
sourcefn define_user_data_var<'a, T: Into<Conf<&'a Type>>>(&self, addr: u64, ty: T)
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
fn undefine_auto_data_var(&self, addr: u64, blacklist: Option<bool>)
fn undefine_user_data_var(&self, addr: u64)
fn define_auto_type<S: BnStrCompatible>( &self, name: S, source: S, type_obj: &Type ) -> QualifiedName
fn define_auto_type_with_id<S: BnStrCompatible>( &self, name: S, id: S, type_obj: &Type ) -> QualifiedName
fn define_user_type<S: BnStrCompatible>(&self, name: S, type_obj: &Type)
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>
fn define_user_types<S: BnStrCompatible>( &self, names_and_types: Vec<(S, &Type)>, progress: Option<Box<dyn Fn(usize, usize) -> Result<()>>> )
fn undefine_auto_type<S: BnStrCompatible>(&self, id: S)
fn undefine_user_type<S: BnStrCompatible>(&self, name: S)
fn types(&self) -> Array<QualifiedNameAndType>
fn dependency_sorted_types(&self) -> Array<QualifiedNameAndType>
fn get_type_by_name<S: BnStrCompatible>(&self, name: S) -> Option<Ref<Type>>
fn get_type_by_ref(&self, ref_: &NamedTypeReference) -> Option<Ref<Type>>
fn get_type_by_id<S: BnStrCompatible>(&self, id: S) -> Option<Ref<Type>>
fn get_type_name_by_id<S: BnStrCompatible>( &self, id: S ) -> Option<QualifiedName>
fn get_type_id<S: BnStrCompatible>(&self, name: S) -> Option<BnString>
fn is_type_auto_defined<S: BnStrCompatible>(&self, name: S) -> bool
fn segments(&self) -> Array<Segment>
fn segment_at(&self, addr: u64) -> Option<Segment>
sourcefn add_segment(&self, segment: SegmentBuilder)
fn add_segment(&self, segment: SegmentBuilder)
Adds a segment to the view.
NOTE: Consider using BinaryViewExt::begin_bulk_add_segments and BinaryViewExt::end_bulk_add_segments if you plan on adding a number of segments all at once, to avoid unnecessary MemoryMap updates.
sourcefn begin_bulk_add_segments(&self)
fn begin_bulk_add_segments(&self)
Start adding segments in bulk. Useful for adding large numbers of segments.
After calling this any call to BinaryViewExt::add_segment will be uncommited until a call to BinaryViewExt::end_bulk_add_segments
If you wish to discard the uncommited segments you can call BinaryViewExt::cancel_bulk_add_segments.
NOTE: This must be paired with a later call to BinaryViewExt::end_bulk_add_segments or BinaryViewExt::cancel_bulk_add_segments, otherwise segments added after this call will stay uncommited.
sourcefn end_bulk_add_segments(&self)
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.
NOTE: This must be paired with a prior call to Self::begin_bulk_add_segments, otherwise this does nothing and segments are added individually.
sourcefn cancel_bulk_add_segments(&self)
fn cancel_bulk_add_segments(&self)
Flushes the auto and user segments that have yet to be committed.
This is to be used in conjunction with Self::begin_bulk_add_segments and Self::end_bulk_add_segments, where the latter will commit the segments which have been added since Self::begin_bulk_add_segments, this function will discard them so that they do not get added to the view.
fn add_section<S: BnStrCompatible>(&self, section: SectionBuilder<S>)
fn remove_auto_section<S: BnStrCompatible>(&self, name: S)
fn remove_user_section<S: BnStrCompatible>(&self, name: S)
fn section_by_name<S: BnStrCompatible>(&self, name: S) -> Result<Section>
fn sections(&self) -> Array<Section>
fn sections_at(&self, addr: u64) -> Array<Section>
fn add_auto_function(&self, plat: &Platform, addr: u64) -> Option<Ref<Function>>
fn add_function_with_type( &self, plat: &Platform, addr: u64, auto_discovered: bool, func_type: Option<&Type> ) -> Option<Ref<Function>>
fn add_entry_point(&self, plat: &Platform, addr: u64)
fn create_user_function( &self, plat: &Platform, addr: u64 ) -> Result<Ref<Function>>
fn has_functions(&self) -> bool
fn entry_point_function(&self) -> Result<Ref<Function>>
fn entry_point_functions(&self) -> Array<Function>
fn functions(&self) -> Array<Function>
sourcefn functions_at(&self, addr: u64) -> Array<Function>
fn functions_at(&self, addr: u64) -> Array<Function>
List of functions starting at addr
fn functions_containing(&self, addr: u64) -> Array<Function>
fn function_at(&self, platform: &Platform, addr: u64) -> Result<Ref<Function>>
fn function_start_before(&self, addr: u64) -> u64
fn function_start_after(&self, addr: u64) -> u64
fn basic_blocks_containing(&self, addr: u64) -> Array<BasicBlock<NativeBlock>>
fn basic_blocks_starting_at(&self, addr: u64) -> Array<BasicBlock<NativeBlock>>
fn is_new_auto_function_analysis_suppressed(&self) -> bool
fn set_new_auto_function_analysis_suppressed(&self, suppress: bool)
fn read_buffer(&self, offset: u64, len: usize) -> Result<DataBuffer>
fn debug_info(&self) -> Ref<DebugInfo>
fn set_debug_info(&self, debug_info: &DebugInfo)
fn apply_debug_info(&self, debug_info: &DebugInfo)
fn show_graph_report<S: BnStrCompatible>(&self, raw_name: S, graph: &FlowGraph)
fn load_settings<S: BnStrCompatible>( &self, view_type_name: S ) -> Result<Ref<Settings>>
fn set_load_settings<S: BnStrCompatible>( &self, view_type_name: S, settings: &Settings )
sourcefn create_tag_type<N: BnStrCompatible, I: BnStrCompatible>(
&self,
name: N,
icon: I
) -> Ref<TagType>
fn create_tag_type<N: BnStrCompatible, I: BnStrCompatible>( &self, name: N, icon: I ) -> Ref<TagType>
sourcefn remove_tag_type(&self, tag_type: &TagType)
fn remove_tag_type(&self, tag_type: &TagType)
Removes a TagType and all tags that use it
sourcefn get_tag_type<S: BnStrCompatible>(&self, name: S) -> Option<Ref<TagType>>
fn get_tag_type<S: BnStrCompatible>(&self, name: S) -> Option<Ref<TagType>>
Get a tag type by its name.
sourcefn get_tag<S: BnStrCompatible>(&self, id: S) -> Option<Ref<Tag>>
fn get_tag<S: BnStrCompatible>(&self, id: S) -> Option<Ref<Tag>>
Get a tag by its id.
Note this does not tell you anything about where it is used.
sourcefn add_tag<S: BnStrCompatible>(
&self,
addr: u64,
t: &TagType,
data: S,
user: bool
)
fn add_tag<S: BnStrCompatible>( &self, addr: u64, t: &TagType, data: S, user: bool )
Creates and adds a tag to an address
User tag creations will be added to the undo buffer
sourcefn remove_auto_data_tag(&self, addr: u64, tag: &Tag)
fn remove_auto_data_tag(&self, addr: u64, tag: &Tag)
removes a Tag object at a data address.
sourcefn remove_user_data_tag(&self, addr: u64, tag: &Tag)
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.
sourcefn get_next_linear_disassembly_lines(
&self,
pos: &mut LinearViewCursor
) -> Array<LinearDisassemblyLine>
fn get_next_linear_disassembly_lines( &self, pos: &mut LinearViewCursor ) -> Array<LinearDisassemblyLine>
Retrieves a list of the next disassembly lines.
get_next_linear_disassembly_lines
retrieves an Array over LinearDisassemblyLine objects for the
next disassembly lines, and updates the LinearViewCursor passed in. This function can be called
repeatedly to get more lines of linear disassembly.
§Arguments
pos
- Position to retrieve linear disassembly lines from
sourcefn get_previous_linear_disassembly_lines(
&self,
pos: &mut LinearViewCursor
) -> Array<LinearDisassemblyLine>
fn get_previous_linear_disassembly_lines( &self, pos: &mut LinearViewCursor ) -> Array<LinearDisassemblyLine>
Retrieves a list of the previous disassembly lines.
get_previous_linear_disassembly_lines
retrieves an Array over LinearDisassemblyLine objects for the
previous disassembly lines, and updates the LinearViewCursor passed in. This function can be called
repeatedly to get more lines of linear disassembly.
§Arguments
pos
- Position to retrieve linear disassembly lines relative to
fn query_metadata<S: BnStrCompatible>(&self, key: S) -> Option<Ref<Metadata>>
fn get_metadata<T, S: BnStrCompatible>(&self, key: S) -> Option<Result<T>>
fn store_metadata<V, S: BnStrCompatible>(&self, key: S, value: V, is_auto: bool)
fn remove_metadata<S: BnStrCompatible>(&self, key: S)
sourcefn get_code_refs(&self, addr: u64) -> Array<CodeReference>
fn get_code_refs(&self, addr: u64) -> Array<CodeReference>
Retrieves a list of CodeReferences pointing to a given address.
sourcefn get_code_refs_from(&self, addr: u64, func: Option<&Function>) -> Vec<u64>
fn get_code_refs_from(&self, addr: u64, func: Option<&Function>) -> Vec<u64>
Retrieves a list of addresses pointed to by a given address.
sourcefn get_code_refs_in_range(&self, range: Range<u64>) -> Array<CodeReference>
fn get_code_refs_in_range(&self, range: Range<u64>) -> Array<CodeReference>
Retrieves a list of CodeReferences pointing into a given Range.
sourcefn get_data_refs(&self, addr: u64) -> Array<DataReference>
fn get_data_refs(&self, addr: u64) -> Array<DataReference>
Retrieves a list of DataReferences pointing to a given address.
sourcefn get_data_refs_from(&self, addr: u64) -> Array<DataReference>
fn get_data_refs_from(&self, addr: u64) -> Array<DataReference>
Retrieves a list of DataReferences originating from a given address.
sourcefn get_data_refs_in_range(&self, range: Range<u64>) -> Array<DataReference>
fn get_data_refs_in_range(&self, range: Range<u64>) -> Array<DataReference>
Retrieves a list of DataReferences pointing into a given Range.
sourcefn get_code_refs_for_type<B: BnStrCompatible>(
&self,
name: B
) -> Array<CodeReference>
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.
TODO: It might be cleaner if this used an already allocated type from the core and used its name instead of this slightly-gross QualifiedName hack. Since the returned object doesn’t have any QualifiedName, I’m assuming the core does not alias the QualifiedName we pass to it and it is safe to destroy it on Drop, as in this function.
sourcefn get_data_refs_for_type<B: BnStrCompatible>(
&self,
name: B
) -> Array<DataReference>
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.
TODO: It might be cleaner if this used an already allocated type from the core and used its name instead of this slightly-gross QualifiedName hack. Since the returned object doesn’t have any QualifiedName, I’m assuming the core does not alias the QualifiedName we pass to it and it is safe to destroy it on Drop, as in this function.
fn get_relocations_at(&self, addr: u64) -> Array<Relocation>
fn get_relocation_ranges(&self) -> Vec<Range<u64>>
fn component_by_guid<S: BnStrCompatible>(&self, guid: S) -> Option<Component>
fn root_component(&self) -> Option<Component>
fn component_builder(&self) -> ComponentBuilder
fn component_by_path<P: BnStrCompatible>(&self, path: P) -> Option<Component>
fn remove_component(&self, component: &Component) -> bool
fn remove_component_by_guid<P: IntoComponentGuid>(&self, guid: P) -> bool
fn data_variable_parent_components( &self, data_variable: &DataVariable ) -> Array<Component>
sourcefn add_type_library(&self, library: &TypeLibrary)
fn add_type_library(&self, library: &TypeLibrary)
Make the contents of a type library available for type/import resolution
fn type_library_by_name<S: BnStrCompatible>( &self, name: S ) -> Option<TypeLibrary>
sourcefn record_imported_object_library(
&self,
lib: &TypeLibrary,
name: &QualifiedName,
addr: u64,
platform: &Platform
)
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.
lib
- Type Library containing the imported typename
- Name of the object in the type libraryaddr
- address of symbol at import siteplatform
- Platform of symbol at import site
sourcefn import_type_library(
&self,
name: &QualifiedName,
lib: Option<TypeLibrary>
) -> Option<Ref<Type>>
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.
This may have the impact of loading other type libraries as dependencies on other type libraries are lazily resolved when references to types provided by them are first encountered.
Note that the name actually inserted into the view may not match the name as it exists in the type library in
the event of a name conflict. To aid in this, the Type object returned is a NamedTypeReference
to
the deconflicted name used.
sourcefn import_type_object(
&self,
name: &QualifiedName,
lib: Option<TypeLibrary>
) -> Option<Ref<Type>>
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.
This may have the impact of loading other type libraries as dependencies on other type libraries are lazily resolved when references to types provided by them are first encountered.
.. note:: If you are implementing a custom BinaryView and use this method to import object types, you should then call BinaryViewExt::record_imported_object_library with the details of where the object is located.
sourcefn import_type_by_guid<S: BnStrCompatible>(&self, guid: S) -> Option<Ref<Type>>
fn import_type_by_guid<S: BnStrCompatible>(&self, guid: S) -> Option<Ref<Type>>
Recursively imports a type interface given its GUID.
.. note:: To support this type of lookup a type library must have contain a metadata key called “type_guids” which is a map Dict[string_guid, string_type_name] or Dict[string_guid, Tuple[string_type_name, type_library_name]]
sourcefn export_type_to_library(
&self,
lib: &TypeLibrary,
name: &QualifiedName,
type_obj: &Type
)
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
As other referenced types are encountered, they are either copied into the destination type library or else the type library that provided the referenced type is added as a dependency for the destination library.
sourcefn export_object_to_library(
&self,
lib: &TypeLibrary,
name: &QualifiedName,
type_obj: &Type
)
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
As other referenced types are encountered, they are either copied into the destination type library or else the type library that provided the referenced type is added as a dependency for the destination library.
sourcefn lookup_imported_object_library(
&self,
addr: u64,
platform: &Platform
) -> Option<(TypeLibrary, QualifiedName)>
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
addr
- address of symbol at import siteplatform
- Platform of symbol at import site
sourcefn lookup_imported_type_library(
&self,
name: &QualifiedNameAndType
) -> Option<(TypeLibrary, QualifiedName)>
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.
name
- Name of type in analysis