pub trait BinaryViewExt: BinaryViewBase {
Show 173 methods
// Provided methods
fn file(&self) -> Ref<FileMetadata> { ... }
fn parent_view(&self) -> Option<Ref<BinaryView>> { ... }
fn raw_view(&self) -> Option<Ref<BinaryView>> { ... }
fn view_type(&self) -> String { ... }
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 search<C: FnMut(u64, &DataBuffer) -> bool>(
&self,
query: &SearchQuery,
on_match: C,
) -> bool { ... }
fn search_with_progress<P: ProgressCallback, C: FnMut(u64, &DataBuffer) -> bool>(
&self,
query: &SearchQuery,
on_match: C,
progress: P,
) -> bool { ... }
fn find_next_data(
&self,
start: u64,
end: u64,
data: &DataBuffer,
) -> Option<u64> { ... }
fn find_next_data_with_opts<P: ProgressCallback>(
&self,
start: u64,
end: u64,
data: &DataBuffer,
flag: FindFlag,
progress: P,
) -> Option<u64> { ... }
fn find_next_constant(
&self,
start: u64,
end: u64,
constant: u64,
view_type: FunctionViewType,
) -> Option<u64> { ... }
fn find_next_constant_with_opts<P: ProgressCallback>(
&self,
start: u64,
end: u64,
constant: u64,
disasm_settings: &DisassemblySettings,
view_type: FunctionViewType,
progress: P,
) -> Option<u64> { ... }
fn find_next_text(
&self,
start: u64,
end: u64,
text: &str,
view_type: FunctionViewType,
) -> Option<u64> { ... }
fn find_next_text_with_opts<P: ProgressCallback>(
&self,
start: u64,
end: u64,
text: &str,
disasm_settings: &DisassemblySettings,
flag: FindFlag,
view_type: FunctionViewType,
progress: P,
) -> Option<u64> { ... }
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: &str) { ... }
fn has_initial_analysis(&self) -> bool { ... }
fn set_analysis_hold(&self, enable: bool) { ... }
fn update_analysis(&self) { ... }
fn update_analysis_and_wait(&self) { ... }
fn reanalyze(&self) { ... }
fn abort_analysis(&self) { ... }
fn workflow(&self) -> Ref<Workflow> { ... }
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 base_address_detection(&self) -> Option<BaseAddressDetection> { ... }
fn instruction_len<A: Architecture>(
&self,
arch: &A,
addr: u64,
) -> Option<usize> { ... }
fn symbol_by_address(&self, addr: u64) -> Option<Ref<Symbol>> { ... }
fn symbol_by_raw_name(&self, raw_name: impl IntoCStr) -> Option<Ref<Symbol>> { ... }
fn symbols(&self) -> Array<Symbol> { ... }
fn symbols_by_name(&self, name: impl IntoCStr) -> 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<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<T: Into<QualifiedName>>(
&self,
name: T,
source: &str,
type_obj: &Type,
) -> QualifiedName { ... }
fn define_auto_type_with_id<T: Into<QualifiedName>>(
&self,
name: T,
id: &str,
type_obj: &Type,
) -> QualifiedName { ... }
fn define_user_type<T: Into<QualifiedName>>(&self, name: T, type_obj: &Type) { ... }
fn define_auto_types<T, I>(
&self,
names_sources_and_types: T,
) -> HashMap<String, QualifiedName>
where T: Iterator<Item = I>,
I: Into<QualifiedNameTypeAndId> { ... }
fn define_auto_types_with_progress<T, I, P>(
&self,
names_sources_and_types: T,
progress: P,
) -> HashMap<String, QualifiedName>
where T: Iterator<Item = I>,
I: Into<QualifiedNameTypeAndId>,
P: ProgressCallback { ... }
fn define_user_types<T, I>(&self, names_and_types: T)
where T: Iterator<Item = I>,
I: Into<QualifiedNameAndType> { ... }
fn define_user_types_with_progress<T, I, P>(
&self,
names_and_types: T,
progress: P,
)
where T: Iterator<Item = I>,
I: Into<QualifiedNameAndType>,
P: ProgressCallback { ... }
fn undefine_auto_type(&self, id: &str) { ... }
fn undefine_user_type<T: Into<QualifiedName>>(&self, name: T) { ... }
fn types(&self) -> Array<QualifiedNameAndType> { ... }
fn dependency_sorted_types(&self) -> Array<QualifiedNameAndType> { ... }
fn type_by_name<T: Into<QualifiedName>>(&self, name: T) -> Option<Ref<Type>> { ... }
fn type_by_ref(&self, ref_: &NamedTypeReference) -> Option<Ref<Type>> { ... }
fn type_by_id(&self, id: &str) -> Option<Ref<Type>> { ... }
fn type_name_by_id(&self, id: &str) -> Option<QualifiedName> { ... }
fn type_id_by_name<T: Into<QualifiedName>>(&self, name: T) -> Option<String> { ... }
fn is_type_auto_defined<T: Into<QualifiedName>>(&self, name: T) -> bool { ... }
fn segments(&self) -> Array<Segment> { ... }
fn segment_at(&self, addr: u64) -> Option<Ref<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(&self, section: SectionBuilder) { ... }
fn remove_auto_section(&self, name: impl IntoCStr) { ... }
fn remove_user_section(&self, name: impl IntoCStr) { ... }
fn section_by_name(&self, name: impl IntoCStr) -> Option<Ref<Section>> { ... }
fn sections(&self) -> Array<Section> { ... }
fn sections_at(&self, addr: u64) -> Array<Section> { ... }
fn memory_map(&self) -> MemoryMap { ... }
fn add_auto_function(&self, address: u64) -> Option<Ref<Function>> { ... }
fn add_auto_function_with_platform(
&self,
address: u64,
platform: &Platform,
) -> Option<Ref<Function>> { ... }
fn add_auto_function_ext(
&self,
address: u64,
platform: &Platform,
func_type: Option<&Type>,
) -> Option<Ref<Function>> { ... }
fn remove_auto_function(&self, func: &Function, update_refs: bool) { ... }
fn add_user_function(&self, addr: u64) -> Option<Ref<Function>> { ... }
fn add_user_function_with_platform(
&self,
addr: u64,
platform: &Platform,
) -> Option<Ref<Function>> { ... }
fn remove_user_function(&self, func: &Function) { ... }
fn has_functions(&self) -> bool { ... }
fn add_entry_point(&self, addr: u64) { ... }
fn add_entry_point_with_platform(&self, addr: u64, platform: &Platform) { ... }
fn entry_point_function(&self) -> Option<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,
) -> Option<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_plaintext_report(&self, title: &str, plaintext: &str) { ... }
fn show_markdown_report(&self, title: &str, contents: &str, plaintext: &str) { ... }
fn show_html_report(&self, title: &str, contents: &str, plaintext: &str) { ... }
fn show_graph_report(&self, raw_name: &str, graph: &FlowGraph) { ... }
fn load_settings(&self, view_type_name: &str) -> Result<Ref<Settings>> { ... }
fn set_load_settings(&self, view_type_name: &str, settings: &Settings) { ... }
fn create_tag_type(&self, name: &str, icon: &str) -> Ref<TagType> { ... }
fn remove_tag_type(&self, tag_type: &TagType) { ... }
fn tag_type_by_name(&self, name: &str) -> Option<Ref<TagType>> { ... }
fn tag_by_id(&self, id: &str) -> Option<Ref<Tag>> { ... }
fn add_tag(&self, addr: u64, t: &TagType, data: &str, user: bool) { ... }
fn remove_auto_data_tag(&self, addr: u64, tag: &Tag) { ... }
fn remove_user_data_tag(&self, addr: u64, tag: &Tag) { ... }
fn comment_at(&self, addr: u64) -> Option<String> { ... }
fn set_comment_at(&self, addr: u64, comment: &str) { ... }
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(&self, key: &str) -> Option<Ref<Metadata>> { ... }
fn get_metadata<T>(&self, key: &str) -> Option<Result<T>>
where T: for<'a> TryFrom<&'a Metadata> { ... }
fn store_metadata<V>(&self, key: &str, value: V, is_auto: bool)
where V: Into<Ref<Metadata>> { ... }
fn remove_metadata(&self, key: &str) { ... }
fn code_refs_to_addr(&self, addr: u64) -> Array<CodeReference> { ... }
fn code_refs_into_range(&self, range: Range<u64>) -> Array<CodeReference> { ... }
fn code_refs_from_addr(
&self,
addr: u64,
func: Option<&Function>,
) -> Vec<u64> { ... }
fn data_refs_to_addr(&self, addr: u64) -> Array<DataReference> { ... }
fn data_refs_into_range(&self, range: Range<u64>) -> Array<DataReference> { ... }
fn data_refs_from_addr(&self, addr: u64) -> Array<DataReference> { ... }
fn code_refs_using_type_name<T: Into<QualifiedName>>(
&self,
name: T,
) -> Array<CodeReference> { ... }
fn data_refs_using_type_name<T: Into<QualifiedName>>(
&self,
name: T,
) -> Array<DataReference> { ... }
fn relocations_at(&self, addr: u64) -> Array<Relocation> { ... }
fn relocation_ranges(&self) -> Vec<Range<u64>> { ... }
fn component_by_guid(&self, guid: &str) -> Option<Ref<Component>> { ... }
fn root_component(&self) -> Option<Ref<Component>> { ... }
fn component_by_path(&self, path: &str) -> Option<Ref<Component>> { ... }
fn remove_component(&self, component: &Component) -> bool { ... }
fn remove_component_by_guid(&self, guid: &str) -> bool { ... }
fn data_variable_parent_components(
&self,
data_variable: &DataVariable,
) -> Array<Component> { ... }
fn external_libraries(&self) -> Array<ExternalLibrary> { ... }
fn external_library(&self, name: &str) -> Option<Ref<ExternalLibrary>> { ... }
fn remove_external_library(&self, name: &str) { ... }
fn add_external_library(
&self,
name: &str,
backing_file: Option<&ProjectFile>,
auto: bool,
) -> Option<Ref<ExternalLibrary>> { ... }
fn external_locations(&self) -> Array<ExternalLocation> { ... }
fn external_location_from_symbol(
&self,
symbol: &Symbol,
) -> Option<Ref<ExternalLocation>> { ... }
fn remove_external_location(&self, location: &ExternalLocation) { ... }
fn remove_external_location_from_symbol(&self, symbol: &Symbol) { ... }
fn add_external_location(
&self,
symbol: &Symbol,
library: &ExternalLibrary,
target_symbol_name: &str,
target_address: Option<u64>,
target_is_auto: bool,
) -> Option<Ref<ExternalLocation>> { ... }
fn type_container(&self) -> TypeContainer { ... }
fn user_type_container(&self) -> TypeContainer { ... }
fn auto_type_container(&self) -> TypeContainer { ... }
fn add_type_library(&self, library: &TypeLibrary) { ... }
fn type_library_by_name(&self, name: &str) -> Option<Ref<TypeLibrary>> { ... }
fn record_imported_object_library<T: Into<QualifiedName>>(
&self,
lib: &TypeLibrary,
name: T,
addr: u64,
platform: &Platform,
) { ... }
fn import_type_library<T: Into<QualifiedName>>(
&self,
name: T,
lib: Option<TypeLibrary>,
) -> Option<Ref<Type>> { ... }
fn import_type_object<T: Into<QualifiedName>>(
&self,
name: T,
lib: Option<TypeLibrary>,
) -> Option<Ref<Type>> { ... }
fn import_type_by_guid(&self, guid: &str) -> Option<Ref<Type>> { ... }
fn export_type_to_library<T: Into<QualifiedName>>(
&self,
lib: &TypeLibrary,
name: T,
type_obj: &Type,
) { ... }
fn export_object_to_library<T: Into<QualifiedName>>(
&self,
lib: &TypeLibrary,
name: T,
type_obj: &Type,
) { ... }
fn lookup_imported_object_library(
&self,
addr: u64,
platform: &Platform,
) -> Option<(Ref<TypeLibrary>, QualifiedName)> { ... }
fn lookup_imported_type_library<T: Into<QualifiedName>>(
&self,
name: T,
) -> Option<(Ref<TypeLibrary>, QualifiedName)> { ... }
fn strings(&self) -> Array<StringReference> { ... }
fn strings_in_range(&self, range: Range<u64>) -> Array<StringReference> { ... }
}
Provided Methods§
fn file(&self) -> Ref<FileMetadata>
fn parent_view(&self) -> Option<Ref<BinaryView>>
fn raw_view(&self) -> Option<Ref<BinaryView>>
fn view_type(&self) -> String
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
sourcefn search<C: FnMut(u64, &DataBuffer) -> bool>(
&self,
query: &SearchQuery,
on_match: C,
) -> bool
fn search<C: FnMut(u64, &DataBuffer) -> bool>( &self, query: &SearchQuery, on_match: C, ) -> bool
Search the view using the query options.
sourcefn search_with_progress<P: ProgressCallback, C: FnMut(u64, &DataBuffer) -> bool>(
&self,
query: &SearchQuery,
on_match: C,
progress: P,
) -> bool
fn search_with_progress<P: ProgressCallback, C: FnMut(u64, &DataBuffer) -> bool>( &self, query: &SearchQuery, on_match: C, progress: P, ) -> bool
Search the view using the query options.
fn find_next_data(&self, start: u64, end: u64, data: &DataBuffer) -> Option<u64>
sourcefn find_next_data_with_opts<P: ProgressCallback>(
&self,
start: u64,
end: u64,
data: &DataBuffer,
flag: FindFlag,
progress: P,
) -> Option<u64>
fn find_next_data_with_opts<P: ProgressCallback>( &self, start: u64, end: u64, data: &DataBuffer, flag: FindFlag, progress: P, ) -> Option<u64>
§Warning
This function is likely to be changed to take in a “query” structure. Or deprecated entirely.
fn find_next_constant( &self, start: u64, end: u64, constant: u64, view_type: FunctionViewType, ) -> Option<u64>
sourcefn find_next_constant_with_opts<P: ProgressCallback>(
&self,
start: u64,
end: u64,
constant: u64,
disasm_settings: &DisassemblySettings,
view_type: FunctionViewType,
progress: P,
) -> Option<u64>
fn find_next_constant_with_opts<P: ProgressCallback>( &self, start: u64, end: u64, constant: u64, disasm_settings: &DisassemblySettings, view_type: FunctionViewType, progress: P, ) -> Option<u64>
§Warning
This function is likely to be changed to take in a “query” structure.
fn find_next_text( &self, start: u64, end: u64, text: &str, view_type: FunctionViewType, ) -> Option<u64>
sourcefn find_next_text_with_opts<P: ProgressCallback>(
&self,
start: u64,
end: u64,
text: &str,
disasm_settings: &DisassemblySettings,
flag: FindFlag,
view_type: FunctionViewType,
progress: P,
) -> Option<u64>
fn find_next_text_with_opts<P: ProgressCallback>( &self, start: u64, end: u64, text: &str, disasm_settings: &DisassemblySettings, flag: FindFlag, view_type: FunctionViewType, progress: P, ) -> Option<u64>
§Warning
This function is likely to be changed to take in a “query” structure.
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: &str)
fn has_initial_analysis(&self) -> bool
fn set_analysis_hold(&self, enable: bool)
sourcefn update_analysis(&self)
fn update_analysis(&self)
Runs the analysis pipeline, analyzing any data that has been marked for updates.
You can explicitly mark a function to be updated with:
NOTE: This is a non-blocking call, use BinaryViewExt::update_analysis_and_wait
if you
require analysis to have completed before moving on.
sourcefn update_analysis_and_wait(&self)
fn update_analysis_and_wait(&self)
Runs the analysis pipeline, analyzing any data that has been marked for updates.
You can explicitly mark a function to be updated with:
NOTE: This is a blocking call, use BinaryViewExt::update_analysis
if you do not
need to wait for the analysis update to finish.
sourcefn reanalyze(&self)
fn reanalyze(&self)
Causes all functions to be reanalyzed.
Use BinaryViewExt::update_analysis
or BinaryViewExt::update_analysis_and_wait
instead
if you want to incrementally update analysis.
NOTE: This function does not wait for the analysis to finish.
fn abort_analysis(&self)
fn workflow(&self) -> Ref<Workflow>
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 base_address_detection(&self) -> Option<BaseAddressDetection>
fn instruction_len<A: Architecture>(&self, arch: &A, addr: u64) -> Option<usize>
fn symbol_by_address(&self, addr: u64) -> Option<Ref<Symbol>>
fn symbol_by_raw_name(&self, raw_name: impl IntoCStr) -> Option<Ref<Symbol>>
fn symbols(&self) -> Array<Symbol>
fn symbols_by_name(&self, name: impl IntoCStr) -> 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<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 BinaryViewExt::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<T: Into<QualifiedName>>( &self, name: T, source: &str, type_obj: &Type, ) -> QualifiedName
fn define_auto_type_with_id<T: Into<QualifiedName>>( &self, name: T, id: &str, type_obj: &Type, ) -> QualifiedName
fn define_user_type<T: Into<QualifiedName>>(&self, name: T, type_obj: &Type)
fn define_auto_types<T, I>( &self, names_sources_and_types: T, ) -> HashMap<String, QualifiedName>
fn define_auto_types_with_progress<T, I, P>( &self, names_sources_and_types: T, progress: P, ) -> HashMap<String, QualifiedName>
fn define_user_types<T, I>(&self, names_and_types: T)
fn define_user_types_with_progress<T, I, P>( &self, names_and_types: T, progress: P, )
fn undefine_auto_type(&self, id: &str)
fn undefine_user_type<T: Into<QualifiedName>>(&self, name: T)
fn types(&self) -> Array<QualifiedNameAndType>
fn dependency_sorted_types(&self) -> Array<QualifiedNameAndType>
fn type_by_name<T: Into<QualifiedName>>(&self, name: T) -> Option<Ref<Type>>
fn type_by_ref(&self, ref_: &NamedTypeReference) -> Option<Ref<Type>>
fn type_by_id(&self, id: &str) -> Option<Ref<Type>>
fn type_name_by_id(&self, id: &str) -> Option<QualifiedName>
fn type_id_by_name<T: Into<QualifiedName>>(&self, name: T) -> Option<String>
fn is_type_auto_defined<T: Into<QualifiedName>>(&self, name: T) -> bool
fn segments(&self) -> Array<Segment>
fn segment_at(&self, addr: u64) -> Option<Ref<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 uncommitted until a call to BinaryViewExt::end_bulk_add_segments
If you wish to discard the uncommitted 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 uncommitted.
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(&self, section: SectionBuilder)
fn remove_auto_section(&self, name: impl IntoCStr)
fn remove_user_section(&self, name: impl IntoCStr)
fn section_by_name(&self, name: impl IntoCStr) -> Option<Ref<Section>>
fn sections(&self) -> Array<Section>
fn sections_at(&self, addr: u64) -> Array<Section>
fn memory_map(&self) -> MemoryMap
sourcefn add_auto_function(&self, address: u64) -> Option<Ref<Function>>
fn add_auto_function(&self, address: u64) -> Option<Ref<Function>>
Add an auto function at the given address
with the views default platform.
Use BinaryViewExt::add_auto_function_with_platform
if you wish to specify a platform.
NOTE: The default platform must be set for this view!
sourcefn add_auto_function_with_platform(
&self,
address: u64,
platform: &Platform,
) -> Option<Ref<Function>>
fn add_auto_function_with_platform( &self, address: u64, platform: &Platform, ) -> Option<Ref<Function>>
Add an auto function at the given address
with the platform
.
Use BinaryViewExt::add_auto_function_ext
if you wish to specify a function type.
NOTE: If the view’s default platform is not set, this will set it to platform
.
sourcefn add_auto_function_ext(
&self,
address: u64,
platform: &Platform,
func_type: Option<&Type>,
) -> Option<Ref<Function>>
fn add_auto_function_ext( &self, address: u64, platform: &Platform, func_type: Option<&Type>, ) -> Option<Ref<Function>>
Add an auto function at the given address
with the platform
and function type.
NOTE: If the view’s default platform is not set, this will set it to platform
.
sourcefn remove_auto_function(&self, func: &Function, update_refs: bool)
fn remove_auto_function(&self, func: &Function, update_refs: bool)
Remove an auto function from the view.
Pass true
for update_refs
to update all references of the function.
NOTE: Unlike BinaryViewExt::remove_user_function
, this will NOT prohibit the function from
being re-added in the future, use BinaryViewExt::remove_user_function
to blacklist the
function from being automatically created.
sourcefn add_user_function(&self, addr: u64) -> Option<Ref<Function>>
fn add_user_function(&self, addr: u64) -> Option<Ref<Function>>
Add a user function at the given address
with the views default platform.
Use BinaryViewExt::add_user_function_with_platform
if you wish to specify a platform.
NOTE: The default platform must be set for this view!
sourcefn add_user_function_with_platform(
&self,
addr: u64,
platform: &Platform,
) -> Option<Ref<Function>>
fn add_user_function_with_platform( &self, addr: u64, platform: &Platform, ) -> Option<Ref<Function>>
Add an auto function at the given address
with the platform
.
NOTE: If the view’s default platform is not set, this will set it to platform
.
sourcefn remove_user_function(&self, func: &Function)
fn remove_user_function(&self, func: &Function)
Removes the function from the view and blacklists it from being created automatically.
NOTE: If you call BinaryViewExt::add_user_function
, it will override the blacklist.
fn has_functions(&self) -> bool
sourcefn add_entry_point(&self, addr: u64)
fn add_entry_point(&self, addr: u64)
Add an entry point at the given address
with the view’s default platform.
NOTE: The default platform must be set for this view!
sourcefn add_entry_point_with_platform(&self, addr: u64, platform: &Platform)
fn add_entry_point_with_platform(&self, addr: u64, platform: &Platform)
Add an entry point at the given address
with the platform
.
NOTE: If the view’s default platform is not set, this will set it to platform
.
fn entry_point_function(&self) -> Option<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) -> Option<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_plaintext_report(&self, title: &str, plaintext: &str)
fn show_markdown_report(&self, title: &str, contents: &str, plaintext: &str)
fn show_html_report(&self, title: &str, contents: &str, plaintext: &str)
fn show_graph_report(&self, raw_name: &str, graph: &FlowGraph)
fn load_settings(&self, view_type_name: &str) -> Result<Ref<Settings>>
fn set_load_settings(&self, view_type_name: &str, settings: &Settings)
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 tag_by_id(&self, id: &str) -> Option<Ref<Tag>>
fn tag_by_id(&self, id: &str) -> Option<Ref<Tag>>
Get a tag by its id.
Note this does not tell you anything about where it is used.
sourcefn add_tag(&self, addr: u64, t: &TagType, data: &str, user: bool)
fn add_tag(&self, addr: u64, t: &TagType, data: &str, 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.
fn comment_at(&self, addr: u64) -> Option<String>
sourcefn set_comment_at(&self, addr: u64, comment: &str)
fn set_comment_at(&self, addr: u64, comment: &str)
Sets a comment for the BinaryView
at the address specified.
NOTE: This is different from setting a comment at the function-level. To set a comment in a
function use Function::set_comment_at
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.
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(&self, key: &str) -> Option<Ref<Metadata>>
fn get_metadata<T>(&self, key: &str) -> Option<Result<T>>
fn store_metadata<V>(&self, key: &str, value: V, is_auto: bool)
fn remove_metadata(&self, key: &str)
sourcefn code_refs_to_addr(&self, addr: u64) -> Array<CodeReference>
fn code_refs_to_addr(&self, addr: u64) -> Array<CodeReference>
Retrieves a list of CodeReferences pointing to a given address.
sourcefn code_refs_into_range(&self, range: Range<u64>) -> Array<CodeReference>
fn code_refs_into_range(&self, range: Range<u64>) -> Array<CodeReference>
Retrieves a list of CodeReferences pointing into a given Range.
sourcefn code_refs_from_addr(&self, addr: u64, func: Option<&Function>) -> Vec<u64>
fn code_refs_from_addr(&self, addr: u64, func: Option<&Function>) -> Vec<u64>
Retrieves a list of addresses pointed to by a given address.
sourcefn data_refs_to_addr(&self, addr: u64) -> Array<DataReference>
fn data_refs_to_addr(&self, addr: u64) -> Array<DataReference>
Retrieves a list of DataReferences pointing to a given address.
sourcefn data_refs_into_range(&self, range: Range<u64>) -> Array<DataReference>
fn data_refs_into_range(&self, range: Range<u64>) -> Array<DataReference>
Retrieves a list of DataReferences pointing into a given Range.
sourcefn data_refs_from_addr(&self, addr: u64) -> Array<DataReference>
fn data_refs_from_addr(&self, addr: u64) -> Array<DataReference>
Retrieves a list of DataReferences originating from a given address.
sourcefn code_refs_using_type_name<T: Into<QualifiedName>>(
&self,
name: T,
) -> Array<CodeReference>
fn code_refs_using_type_name<T: Into<QualifiedName>>( &self, name: T, ) -> Array<CodeReference>
Retrieves a list of CodeReferences for locations in code that use a given named type.
sourcefn data_refs_using_type_name<T: Into<QualifiedName>>(
&self,
name: T,
) -> Array<DataReference>
fn data_refs_using_type_name<T: Into<QualifiedName>>( &self, name: T, ) -> Array<DataReference>
Retrieves a list of DataReferences for locations in data that use a given named type.
fn relocations_at(&self, addr: u64) -> Array<Relocation>
fn relocation_ranges(&self) -> Vec<Range<u64>>
fn component_by_guid(&self, guid: &str) -> Option<Ref<Component>>
fn root_component(&self) -> Option<Ref<Component>>
fn component_by_path(&self, path: &str) -> Option<Ref<Component>>
fn remove_component(&self, component: &Component) -> bool
fn remove_component_by_guid(&self, guid: &str) -> bool
fn data_variable_parent_components( &self, data_variable: &DataVariable, ) -> Array<Component>
fn external_libraries(&self) -> Array<ExternalLibrary>
fn external_library(&self, name: &str) -> Option<Ref<ExternalLibrary>>
fn remove_external_library(&self, name: &str)
fn add_external_library( &self, name: &str, backing_file: Option<&ProjectFile>, auto: bool, ) -> Option<Ref<ExternalLibrary>>
fn external_locations(&self) -> Array<ExternalLocation>
fn external_location_from_symbol( &self, symbol: &Symbol, ) -> Option<Ref<ExternalLocation>>
fn remove_external_location(&self, location: &ExternalLocation)
fn remove_external_location_from_symbol(&self, symbol: &Symbol)
fn add_external_location( &self, symbol: &Symbol, library: &ExternalLibrary, target_symbol_name: &str, target_address: Option<u64>, target_is_auto: bool, ) -> Option<Ref<ExternalLocation>>
sourcefn type_container(&self) -> TypeContainer
fn type_container(&self) -> TypeContainer
Type container for all types (user and auto) in the Binary View.
NOTE: Modifying an auto type will promote it to a user type.
sourcefn user_type_container(&self) -> TypeContainer
fn user_type_container(&self) -> TypeContainer
Type container for user types in the Binary View.
sourcefn auto_type_container(&self) -> TypeContainer
fn auto_type_container(&self) -> TypeContainer
Type container for auto types in the Binary View.
NOTE: Unlike Self::type_container
modification of auto types will NOT promote it to a user type.
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(&self, name: &str) -> Option<Ref<TypeLibrary>>
sourcefn record_imported_object_library<T: Into<QualifiedName>>(
&self,
lib: &TypeLibrary,
name: T,
addr: u64,
platform: &Platform,
)
fn record_imported_object_library<T: Into<QualifiedName>>( &self, lib: &TypeLibrary, name: T, 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<T: Into<QualifiedName>>(
&self,
name: T,
lib: Option<TypeLibrary>,
) -> Option<Ref<Type>>
fn import_type_library<T: Into<QualifiedName>>( &self, name: T, 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<T: Into<QualifiedName>>(
&self,
name: T,
lib: Option<TypeLibrary>,
) -> Option<Ref<Type>>
fn import_type_object<T: Into<QualifiedName>>( &self, name: T, 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(&self, guid: &str) -> Option<Ref<Type>>
fn import_type_by_guid(&self, guid: &str) -> Option<Ref<Type>>
Recursively imports a type interface given its GUID.
sourcefn export_type_to_library<T: Into<QualifiedName>>(
&self,
lib: &TypeLibrary,
name: T,
type_obj: &Type,
)
fn export_type_to_library<T: Into<QualifiedName>>( &self, lib: &TypeLibrary, name: T, 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<T: Into<QualifiedName>>(
&self,
lib: &TypeLibrary,
name: T,
type_obj: &Type,
)
fn export_object_to_library<T: Into<QualifiedName>>( &self, lib: &TypeLibrary, name: T, 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<(Ref<TypeLibrary>, QualifiedName)>
fn lookup_imported_object_library( &self, addr: u64, platform: &Platform, ) -> Option<(Ref<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<T: Into<QualifiedName>>(
&self,
name: T,
) -> Option<(Ref<TypeLibrary>, QualifiedName)>
fn lookup_imported_type_library<T: Into<QualifiedName>>( &self, name: T, ) -> Option<(Ref<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
sourcefn strings(&self) -> Array<StringReference>
fn strings(&self) -> Array<StringReference>
Retrieve all known strings in the binary.
NOTE: This returns a list of StringReference
as strings may not be representable
as a String
or even a BnString
. It is the caller’s responsibility to read the underlying
data and convert it to a representable form.
sourcefn strings_in_range(&self, range: Range<u64>) -> Array<StringReference>
fn strings_in_range(&self, range: Range<u64>) -> Array<StringReference>
Retrieve all known strings within the provided range
.
NOTE: This returns a list of StringReference
as strings may not be representable
as a String
or even a BnString
. It is the caller’s responsibility to read the underlying
data and convert it to a representable form.