pub struct Function { /* private fields */ }

Implementations§

source§

impl Function

source

pub fn arch(&self) -> CoreArchitecture

source

pub fn platform(&self) -> Ref<Platform>

source

pub fn view(&self) -> Ref<BinaryView>

source

pub fn symbol(&self) -> Ref<Symbol>

source

pub fn workflow(&self) -> Option<Ref<Workflow>>

source

pub fn start(&self) -> u64

source

pub fn lowest_address(&self) -> u64

source

pub fn highest_address(&self) -> u64

source

pub fn address_ranges(&self) -> Array<AddressRange>

source

pub fn comment(&self) -> BnString

source

pub fn set_comment<S: BnStrCompatible>(&self, comment: S)

source

pub fn set_can_return_auto<T: Into<Conf<bool>>>(&self, can_return: T)

source

pub fn set_can_return_user<T: Into<Conf<bool>>>(&self, can_return: T)

source

pub fn comment_at(&self, addr: u64) -> BnString

source

pub fn set_comment_at<S: BnStrCompatible>(&self, addr: u64, comment: S)

source

pub fn comments(&self) -> Array<Comments>

All comments in the function

source

pub fn basic_blocks(&self) -> Array<BasicBlock<NativeBlock>>

source

pub fn basic_block_containing( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Option<Ref<BasicBlock<NativeBlock>>>

Returns the BasicBlock that contains the given address addr.

  • addr - Address of the BasicBlock to retrieve.
  • arch - Architecture of the basic block if different from the Function’s self.arch
§Example
let blocks = fun.basic_block_containing(0x1000, None);
source

pub fn block_annotations( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<Array<InstructionTextToken>>

source

pub fn get_variable_name(&self, var: &Variable) -> BnString

source

pub fn high_level_il( &self, full_ast: bool ) -> Result<Ref<HighLevelILFunction>, ()>

source

pub fn high_level_il_if_available(&self) -> Option<Ref<HighLevelILFunction>>

source

pub fn mapped_medium_level_il(&self) -> Result<Ref<MediumLevelILFunction>, ()>

MediumLevelILFunction used to represent Function mapped medium level IL

source

pub fn mapped_medium_level_il_if_available( &self ) -> Result<Ref<MediumLevelILFunction>, ()>

source

pub fn medium_level_il(&self) -> Result<Ref<MediumLevelILFunction>, ()>

source

pub fn medium_level_il_if_available(&self) -> Option<Ref<MediumLevelILFunction>>

source

pub fn low_level_il(&self) -> Result<Ref<RegularFunction<CoreArchitecture>>, ()>

source

pub fn low_level_il_if_available( &self ) -> Option<Ref<RegularFunction<CoreArchitecture>>>

source

pub fn lifted_il(&self) -> Result<Ref<LiftedFunction<CoreArchitecture>>, ()>

source

pub fn lifted_il_if_available( &self ) -> Option<Ref<LiftedFunction<CoreArchitecture>>>

source

pub fn return_type(&self) -> Conf<Ref<Type>>

source

pub fn set_auto_return_type<'a, C>(&self, return_type: C)
where C: Into<Conf<&'a Type>>,

source

pub fn set_user_return_type<'a, C>(&self, return_type: C)
where C: Into<Conf<&'a Type>>,

source

pub fn function_type(&self) -> Ref<Type>

source

pub fn has_user_type(&self) -> bool

source

pub fn set_user_type(&self, t: &Type)

source

pub fn set_auto_type(&self, t: &Type)

source

pub fn stack_layout(&self) -> Array<NamedTypedVariable>

source

pub fn stack_adjustment(&self) -> Conf<i64>

Gets number of bytes removed from the stack after return

source

pub fn set_user_stack_adjustment<C>(&self, value: C)
where C: Into<Conf<i64>>,

Sets number of bytes removed from the stack after return

source

pub fn set_auto_stack_adjustment<C>(&self, value: C)
where C: Into<Conf<i64>>,

Sets number of bytes removed from the stack after return

source

pub fn call_stack_adjustment( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Conf<i64>

source

pub fn set_user_call_stack_adjustment<I>( &self, addr: u64, adjust: I, arch: Option<CoreArchitecture> )
where I: Into<Conf<i64>>,

source

pub fn set_auto_call_stack_adjustment<I>( &self, addr: u64, adjust: I, arch: Option<CoreArchitecture> )
where I: Into<Conf<i64>>,

source

pub fn call_type_adjustment( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Option<Conf<Ref<Type>>>

source

pub fn set_user_call_type_adjustment<'a, I>( &self, addr: u64, adjust_type: Option<I>, arch: Option<CoreArchitecture> )
where I: Into<Conf<&'a Type>>,

Sets or removes the call type override at a call site to the given type.

  • addr - virtual address of the call instruction to adjust
  • adjust_type - (optional) overridden call type, or None to remove an existing adjustment
  • arch - (optional) Architecture of the instruction if different from self.arch
source

pub fn set_auto_call_type_adjustment<'a, I>( &self, addr: u64, adjust_type: I, arch: Option<CoreArchitecture> )
where I: Into<Conf<&'a Type>>,

source

pub fn call_reg_stack_adjustment( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<RegisterStackAdjustment<CoreArchitecture>>

source

pub fn set_user_call_reg_stack_adjustment<I>( self, addr: u64, adjust: I, arch: Option<CoreArchitecture> )

source

pub fn set_auto_call_reg_stack_adjustment<I>( &self, addr: u64, adjust: I, arch: Option<CoreArchitecture> )

source

pub fn call_reg_stack_adjustment_for_reg_stack( &self, addr: u64, reg_stack_id: u32, arch: Option<CoreArchitecture> ) -> RegisterStackAdjustment<CoreArchitecture>

source

pub fn set_user_call_reg_stack_adjustment_for_reg_stack<I>( &self, addr: u64, reg_stack_id: u32, adjust: I, arch: Option<CoreArchitecture> )
where I: Into<Conf<i32>>,

source

pub fn set_auto_call_reg_stack_adjustment_for_reg_stack<I>( &self, addr: u64, reg_stack_id: u32, adjust: I, arch: Option<CoreArchitecture> )
where I: Into<Conf<i32>>,

source

pub fn reg_stack_adjustments( &self ) -> Array<RegisterStackAdjustment<CoreArchitecture>>

source

pub fn set_user_reg_stack_adjustments<I, A>(&self, values: I)

source

pub fn set_auto_reg_stack_adjustments<I, A>(&self, values: I)

source

pub fn variables(&self) -> Array<(&str, Variable, &Type)>

List of function variables: including name, variable and type

source

pub fn split_variables(&self) -> Array<Variable>

source

pub fn parameter_variables(&self) -> Conf<Vec<Variable>>

source

pub fn set_user_parameter_variables<I>(&self, values: I, confidence: u8)
where I: IntoIterator<Item = Variable>,

source

pub fn set_auto_parameter_variables<I>(&self, values: I, confidence: u8)
where I: IntoIterator<Item = Variable>,

source

pub fn parameter_at( &self, addr: u64, func_type: Option<&Type>, i: usize, arch: Option<CoreArchitecture> ) -> RegisterValue

source

pub fn parameter_at_low_level_il_instruction( &self, instr: usize, func_type: &Type, i: usize ) -> RegisterValue

source

pub fn apply_imported_types(&self, sym: &Symbol, t: Option<&Type>)

source

pub fn apply_auto_discovered_type(&self, func_type: &Type)

source

pub fn analysis_skipped(&self) -> bool

Whether automatic analysis was skipped for this function. Can be set to false to re-enable analysis.

source

pub fn set_analysis_skipped(&self, skip: bool)

source

pub fn analysis_skip_reason(&self) -> AnalysisSkipReason

source

pub fn analysis_skip_override(&self) -> FunctionAnalysisSkipOverride

source

pub fn set_analysis_skip_override( &self, override_: FunctionAnalysisSkipOverride )

source

pub fn inline_during_analysis(&self) -> Conf<bool>

Whether the function’s IL should be inlined into all callers’ IL

source

pub fn set_auto_inline_during_analysis<C>(&self, value: C)
where C: Into<Conf<bool>>,

source

pub fn set_user_inline_during_analysis<C>(&self, value: C)
where C: Into<Conf<bool>>,

source

pub fn analysis_performance_info(&self) -> Array<PerformanceInfo>

source

pub fn add_tag<S: BnStrCompatible>( &self, tag_type: &TagType, data: S, addr: Option<u64>, user: bool, arch: Option<CoreArchitecture> )

Creates and adds a Tag object on either a function, or on an address inside of a function.

“Function tags” appear at the top of a function and are a good way to label an entire function with some information. If you include an address when you call Function.add_tag, you’ll create an “address tag”. These are good for labeling specific instructions.

For tagging arbitrary data, consider BinaryViewExt::add_tag.

  • tag_type_name - The name of the tag type for this Tag.
  • data - Additional data for the Tag.
  • addr - Address at which to add the tag.
  • user - Whether or not a user tag.
§Example
let important = bv.create_tag_type("Important", "⚠️");
fun.add_tag(&important, "I think this is the main function", None, false, None);
let crash = bv.create_tag_type("Crashes", "🎯");
fun.add_tag(&crash, "Nullpointer dereference", Some(0x1337), false, None);
source

pub fn remove_tag( &self, tag: &Tag, addr: Option<u64>, user: bool, arch: Option<CoreArchitecture> )

Remove Tag object on either a function, or on an address inside of a function.

  • tag - The tag to remove.
  • addr - (optional) Address at which to remove the tag.
  • user - Whether or not a user tag.
source

pub fn remove_tags_of_type( &self, tag_type: &TagType, addr: Option<u64>, user: bool, arch: Option<CoreArchitecture> )

Remove Tag object of type on either a function, or on an address inside of a function.

  • tag_type - The type of the to remove.
  • addr - Address at which to add the tag.
  • user - Whether or not a user tag.
source

pub fn add_user_code_ref( &self, from_addr: u64, to_addr: u64, arch: Option<CoreArchitecture> )

Places a user-defined cross-reference from the instruction at the given address and architecture to the specified target address. If the specified source instruction is not contained within this function, no action is performed. To remove the reference, use Function::remove_user_code_ref.

  • from_addr - Virtual address of the source instruction.
  • to_addr - Virtual address of the xref’s destination.
  • arch - Architecture of the source instruction.
§Example
fun.add_user_code_ref(0x1337, 0x400000, None);
source

pub fn remove_user_code_ref( self, from_addr: u64, to_addr: u64, arch: Option<CoreArchitecture> )

Removes a user-defined cross-reference. If the given address is not contained within this function, or if there is no such user-defined cross-reference, no action is performed.

  • from_addr - virtual address of the source instruction
  • to_addr - virtual address of the xref’s destination.
  • arch - architecture of the source instruction

#Example

fun.remove_user_code_ref(0x1337, 0x400000, None);
source

pub fn add_user_type_ref( &self, from_addr: u64, name: &QualifiedName, arch: Option<CoreArchitecture> )

Places a user-defined type cross-reference from the instruction at the given address and architecture to the specified type. If the specified source instruction is not contained within this function, no action is performed. To remove the reference, use Function::remove_user_type_ref.

  • from_addr - Virtual address of the source instruction.
  • name - Name of the referenced type.
  • arch - Architecture of the source instruction.
§Example
fun.add_user_type_ref(0x1337, &"A".into(), None);
source

pub fn remove_user_type_ref( &self, from_addr: u64, name: &QualifiedName, arch: Option<CoreArchitecture> )

Removes a user-defined type cross-reference. If the given address is not contained within this function, or if there is no such user-defined cross-reference, no action is performed.

  • from_addr - Virtual address of the source instruction.
  • name - Name of the referenced type.
  • from_arch - Architecture of the source instruction.
§Example
fun.remove_user_type_ref(0x1337, &"A".into(), None);
source

pub fn add_user_type_field_ref( &self, from_addr: u64, name: &QualifiedName, offset: u64, arch: Option<CoreArchitecture>, size: Option<usize> )

Places a user-defined type field cross-reference from the instruction at the given address and architecture to the specified type. If the specified source instruction is not contained within this function, no action is performed. To remove the reference, use Function::remove_user_type_field_ref.

  • from_addr - Virtual address of the source instruction.
  • name - Name of the referenced type.
  • offset - Offset of the field, relative to the type.
  • arch - Architecture of the source instruction.
  • size - The size of the access.
§Example
fun.add_user_type_field_ref(0x1337, &"A".into(), 0x8, None, None);
source

pub fn remove_user_type_field_ref( &self, from_addr: u64, name: &QualifiedName, offset: u64, arch: Option<CoreArchitecture>, size: Option<usize> )

Removes a user-defined type field cross-reference. If the given address is not contained within this function, or if there is no such user-defined cross-reference, no action is performed.

  • from_addr - Virtual address of the source instruction
  • name - Name of the referenced type
  • offset - Offset of the field, relative to the type
  • arch - Architecture of the source instruction
  • size - The size of the access
§Example
fun.remove_user_type_field_ref(0x1337, &"A".into(), 0x8, None, None);
source

pub fn constant_data( &self, state: RegisterValueType, value: u64, size: Option<usize> ) -> (DataBuffer, BuiltinType)

source

pub fn constants_referenced_by( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<ConstantReference>

source

pub fn constants_referenced_by_address_if_available( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<ConstantReference>

source

pub fn function_tags( &self, auto: Option<bool>, tag_type: Option<&str> ) -> Array<Tag>

Returns a list of function Tags for the function.

auto - If None, gets all tags, if true, gets auto tags, if false, gets user tags tag_type - If None, gets all tags, otherwise only gets tags of the given type

source

pub fn tags(&self) -> Array<TagReference>

source

pub fn tags_at( &self, addr: u64, auto: Option<bool>, arch: Option<CoreArchitecture> ) -> Array<Tag>

Gets a list of Tags at the address.

  • addr - Address to get tags from.
  • auto - If None, gets all tags, if true, gets auto tags, if false, gets user tags
source

pub fn tags_in_range( &self, range: Range<u64>, auto: Option<bool>, arch: Option<CoreArchitecture> ) -> Array<TagReference>

Gets a list of Tags in the address range.

  • addr - Address to get tags from.
  • auto - If None, gets all tags, if true, gets auto tags, if false, gets user tags
source

pub fn indirect_branches(&self) -> Array<IndirectBranchInfo>

List of indirect branches

source

pub fn set_user_indirect_branches<I>( &self, source: u64, branches: I, arch: Option<CoreArchitecture> )
where I: IntoIterator<Item = u64>,

source

pub fn set_auto_indirect_branches<I>( &self, source: u64, branches: I, arch: Option<CoreArchitecture> )
where I: IntoIterator<Item = u64>,

source

pub fn indirect_branches_at( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<IndirectBranchInfo>

List of indirect branches at this address

source

pub fn instr_highlight( &self, addr: u64, arch: Option<CoreArchitecture> ) -> HighlightColor

§Example
let color = fun.instr_highlight(0x1337, None);
source

pub fn set_auto_instr_highlight( &self, addr: u64, color: HighlightColor, arch: Option<CoreArchitecture> )

Sets the highlights the instruction at the specified address with the supplied color

Use only in analysis plugins. Do not use in regular plugins, as colors won't be saved to the database.
  • addr - virtual address of the instruction to be highlighted
  • color - Color value to use for highlighting
  • arch - (optional) Architecture of the instruction if different from self.arch
source

pub fn set_user_instr_highlight( &self, addr: u64, color: HighlightColor, arch: Option<CoreArchitecture> )

Sets the highlights the instruction at the specified address with the supplied color

  • addr - virtual address of the instruction to be highlighted
  • color - Color value to use for highlighting
  • arch - (optional) Architecture of the instruction if different from self.arch
§Example
let color = HighlightColor::NoHighlightColor { alpha: u8::MAX };
fun.set_user_instr_highlight(0x1337, color, None);
source

pub fn instruction_containing_address( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Option<u64>

return the address, if any, of the instruction that contains the provided address

source

pub fn int_display_type( &self, instr_addr: u64, value: u64, operand: usize, arch: Option<CoreArchitecture> ) -> IntegerDisplayType

Get the current text display type for an integer token in the disassembly or IL views

See also see Function::int_display_type_and_typeid

  • instr_addr - Address of the instruction or IL line containing the token
  • value - field of the InstructionTextToken object for the token, usually the constant displayed
  • operand - Operand index of the token, defined as the number of OperandSeparatorTokens in the disassembly line before the token
  • arch - (optional) Architecture of the instruction or IL line containing the token
source

pub fn set_int_display_type( &self, instr_addr: u64, value: u64, operand: usize, display_type: IntegerDisplayType, arch: Option<CoreArchitecture>, enum_display_typeid: Option<impl BnStrCompatible> )

Change the text display type for an integer token in the disassembly or IL views

  • instr_addr - Address of the instruction or IL line containing the token
  • value - Field of the InstructionTextToken object for the token, usually the constant displayed
  • operand - Operand index of the token, defined as the number of OperandSeparatorTokens in the disassembly line before the token
  • display_type - Desired display type
  • arch - (optional) Architecture of the instruction or IL line containing the token
  • enum_display_typeid - (optional) Whenever passing EnumDisplayType to display_type, passing a type ID here will specify the Enumeration display type. Must be a valid type ID and resolve to an enumeration type.
source

pub fn int_enum_display_typeid( &self, instr_addr: u64, value: u64, operand: usize, arch: Option<CoreArchitecture> ) -> BnString

Get the current text display enum type for an integer token in the disassembly or IL views.

See also see Function::int_display_type_and_typeid

  • instr_addr - Address of the instruction or IL line containing the token
  • value - field of the InstructionTextToken object for the token, usually the constant displayed
  • operand - Operand index of the token, defined as the number of OperandSeparatorTokens in the disassembly line before the token
  • arch - (optional) Architecture of the instruction or IL line containing the token
source

pub fn int_display_type_and_typeid( &self, instr_addr: u64, value: u64, operand: usize, arch: Option<CoreArchitecture> ) -> (IntegerDisplayType, BnString)

Get the current text display type for an integer token in the disassembly or IL views

  • instr_addr - Address of the instruction or IL line containing the token
  • value - field of the InstructionTextToken object for the token, usually the constant displayed
  • operand - Operand index of the token, defined as the number of OperandSeparatorTokens in the disassembly line before the token
  • arch - (optional) Architecture of the instruction or IL line containing the token
source

pub fn register_value_at( &self, addr: u64, reg: u32, arch: Option<CoreArchitecture> ) -> RegisterValue

Get the value the provided string register address corresponding to the given virtual address

  • addr - virtual address of the instruction to query
  • reg - string value of native register to query
  • arch - (optional) Architecture for the given function
§Example
let reg = fun.arch().register_by_name("rdi").unwrap();
let value = fun.register_value_at(0x400dbe, reg.id(), None);
source

pub fn register_value_after( &self, addr: u64, reg: u32, arch: Option<CoreArchitecture> ) -> RegisterValue

Gets the value instruction address corresponding to the given virtual address

  • addr - virtual address of the instruction to query
  • reg - string value of native register to query
  • arch - (optional) Architecture for the given function
§Example
let reg = fun.arch().register_by_name("rdi").unwrap();
let value = fun.register_value_after(0x400dbe, reg.id(), None);
source

pub fn register_value_at_exit(&self, reg: u32) -> Conf<RegisterValue>

source

pub fn registers_read_by( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<CoreRegister>

source

pub fn registers_written_by( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<CoreRegister>

source

pub fn clobbered_registers(&self) -> Conf<Array<CoreRegister>>

Registers that are modified by this function

source

pub fn set_user_clobbered_registers<I>(&self, registers: I, confidence: u8)
where I: IntoIterator<Item = CoreRegister>,

source

pub fn set_auto_clobbered_registers<I>(&self, registers: I, confidence: u8)
where I: IntoIterator<Item = CoreRegister>,

source

pub fn stack_contents_at( &self, addr: u64, offset: i64, size: usize, arch: Option<CoreArchitecture> ) -> RegisterValue

source

pub fn stack_contents_after( &self, addr: u64, offset: i64, size: usize, arch: Option<CoreArchitecture> ) -> RegisterValue

source

pub fn stack_var_at_frame_offset( &self, addr: u64, offset: i64, arch: Option<CoreArchitecture> ) -> Option<(Variable, BnString, Conf<Ref<Type>>)>

source

pub fn stack_variables_referenced_by( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<StackVariableReference>

source

pub fn stack_variables_referenced_by_address_if_available( &self, addr: u64, arch: Option<CoreArchitecture> ) -> Array<StackVariableReference>

source

pub fn global_pointer_value(&self) -> Conf<RegisterValue>

Discovered value of the global pointer register, if the function uses one

source

pub fn type_tokens( &self, settings: Option<&DisassemblySettings> ) -> Array<DisassemblyTextLine>

source

pub fn is_call_instruction( &self, addr: u64, arch: Option<CoreArchitecture> ) -> bool

source

pub fn is_variable_user_defined(&self, var: &Variable) -> bool

source

pub fn is_pure(&self) -> Conf<bool>

source

pub fn set_user_pure<C>(&self, value: C)
where C: Into<Conf<bool>>,

source

pub fn set_auto_pure<C>(&self, value: C)
where C: Into<Conf<bool>>,

source

pub fn is_too_large(&self) -> bool

source

pub fn is_update_needed(&self) -> bool

source

pub fn mark_updates_required(&self, update_type: FunctionUpdateType)

Indicates that this function needs to be reanalyzed during the next update cycle

  • update_type - Desired update type
source

pub fn mark_caller_updates_required(&self, update_type: FunctionUpdateType)

Indicates that callers of this function need to be reanalyzed during the next update cycle

  • uppdate_type - Desired update type
source

pub fn mark_recent_use(&self)

source

pub fn merged_variables(&self) -> Array<MergedVariable>

source

pub fn merge_variables<'a>( &self, target: &Variable, sources: impl IntoIterator<Item = &'a Variable> )

Merge one or more varibles in sources into the target variable. All variable accesses to the variables in sources will be rewritten to use target.

  • target - target variable
  • sources - list of source variables
source

pub fn unmerge_variables<'a>( &self, target: &Variable, sources: impl IntoIterator<Item = &'a Variable> )

Undoes variable merging performed with Function::merge_variables. The variables in sources will no longer be merged into the target variable.

  • target - target variable
  • sources - list of source variables
source

pub fn split_variable(&self, var: &Variable)

Splits a varible at the definition site. The given var must be the variable unique to the definition and should be obtained by using mlil::MediumLevelILInstruction::get_split_var_for_definition at the definition site.

This function is not meant to split variables that have been previously merged. Use Function::unmerge_variables to split previously merged variables.

Binary Ninja automatically splits all variables that the analysis determines to be safely splittable. Splitting a variable manually with Function::split_variable can cause IL and decompilation to be incorrect. There are some patterns where variables can be safely split semantically but analysis cannot determine that it is safe. This function is provided to allow variable splitting to be performed in these cases by plugins or by the user.

  • var - variable to split
source

pub fn unsplit_variable(&self, var: &Variable)

Undoes varible splitting performed with Function::split_variable. The given var must be the variable unique to the definition and should be obtained by using mlil::MediumLevelILInstruction::get_split_var_for_definition at the definition site.

  • var - variable to unsplit
source

pub fn reanalyze(&self, update_type: FunctionUpdateType)

Causes this function to be reanalyzed. This function does not wait for the analysis to finish.

  • update_type - Desired update type

If analysis_skipped is true, using this API will not trigger re-analysis. Instead, use Function::set_analysis_skipped with false.

source

pub fn request_debug_report(&self, name: &str)

Generate internal debug reports for a variety of analysis. Current list of possible values include:

  • mlil_translator
  • stack_adjust_graph
  • high_level_il
  • name - Name of the debug report
source

pub fn auto(&self) -> bool

Whether function was automatically discovered s a result of some creation of a ‘user’ function. ‘user’ functions may or may not have been created by a user through the or API. For instance the entry point into a function is always created a ‘user’ function. ‘user’ functions should be considered the root of auto analysis.

source

pub fn call_sites(&self) -> Array<CodeReference>

Returns a list of possible call sites contained in this function. This includes ordinary calls, tail calls, and indirect jumps. Not all of the returned call sites are necessarily true call sites; some may simply be unresolved indirect jumps, for example.

source

pub fn caller_sites(&self) -> Array<CodeReference>

Returns a list of ReferenceSource objects corresponding to the addresses in functions which reference this function

source

pub fn calling_convention( &self ) -> Option<Conf<Ref<CallingConvention<CoreArchitecture>>>>

Calling convention used by the function

source

pub fn set_user_calling_convention<'a, I>(&self, value: Option<I>)

Set the User calling convention used by the function

source

pub fn set_auto_calling_convention<'a, I>(&self, value: Option<I>)

Set the calling convention used by the function

source

pub fn can_return(&self) -> Conf<bool>

source

pub fn set_user_can_return<I>(&self, value: I)
where I: Into<Conf<bool>>,

source

pub fn set_auto_can_return<I>(&self, value: I)
where I: Into<Conf<bool>>,

source

pub fn has_explicitly_defined_type(&self) -> bool

Whether function has explicitly defined types

source

pub fn has_user_annotations(&self) -> bool

source

pub fn has_variable_arguments(&self) -> Conf<bool>

source

pub fn set_user_has_variable_arguments<I>(&self, value: I)
where I: Into<Conf<bool>>,

source

pub fn set_auto_has_variable_arguments<I>(&self, value: I)
where I: Into<Conf<bool>>,

source

pub fn has_unresolved_indirect_branches(&self) -> bool

Has unresolved indirect branches

source

pub fn unresolved_indirect_branches(&self) -> Array<UnresolvedIndirectBranches>

List of address of unresolved indirect branches

source

pub fn provenance(&self) -> BnString

Returns a string representing the provenance. This portion of the API is under development. Currently the provenance information is undocumented, not persistent, and not saved to a database.

source

pub fn return_registers(&self) -> Conf<Array<CoreRegister>>

Get registers that are used for the return value

source

pub fn set_user_return_registers<I>(&self, values: I, confidence: u8)
where I: IntoIterator<Item = CoreRegister>,

source

pub fn set_auto_return_registers<I>(&self, values: I, confidence: u8)
where I: IntoIterator<Item = CoreRegister>,

source

pub fn unresolved_stack_adjustment_graph(&self) -> Option<Ref<FlowGraph>>

Flow graph of unresolved stack adjustments

source

pub fn create_graph( &self, view_type: FunctionViewType, settings: Option<DisassemblySettings> ) -> Ref<FlowGraph>

source

pub fn parent_components(&self) -> Array<Component>

Trait Implementations§

source§

impl CoreArrayProvider for Function

§

type Raw = *mut BNFunction

§

type Context = ()

§

type Wrapped<'a> = Guard<'a, Function>

source§

impl Debug for Function

source§

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

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

impl Hash for Function

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 Function

source§

fn eq(&self, other: &Self) -> 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 Function

§

type Owned = Ref<Function>

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 Function

source§

impl Send for Function

source§

impl Sync for Function

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

§

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.