CoreCallingConvention

Struct CoreCallingConvention 

Source
pub struct CoreCallingConvention { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl AsRef<CoreCallingConvention> for CoreCallingConvention

Source§

fn as_ref(&self) -> &CoreCallingConvention

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

impl CallingConvention for CoreCallingConvention

Source§

fn global_pointer_reg(&self) -> Option<RegisterId>

Deprecated. Use CallingConvention::global_pointer_regs instead.

Source§

fn caller_saved_registers(&self) -> Vec<RegisterId>

Gets the list of registers that are not preserved across a call (caller-saved / volatile registers).
Source§

fn callee_saved_registers(&self) -> Vec<RegisterId>

Gets the list of registers that a callee must preserve across a call (callee-saved / non-volatile registers).
Source§

fn int_arg_registers(&self) -> Vec<RegisterId>

Gets the registers used to pass integer and pointer arguments, in the order they are used.
Source§

fn float_arg_registers(&self) -> Vec<RegisterId>

Gets the registers used to pass floating point arguments, in the order they are used.
Source§

fn required_argument_registers(&self) -> Vec<RegisterId>

Gets the set of registers that must be arguments for heuristic calling convention detection to consider this calling convention as a valid option.
Source§

fn required_clobbered_registers(&self) -> Vec<RegisterId>

Gets the set of registers that must be clobbered for heuristic calling convention detection to consider this calling convention as a valid option.
Source§

fn arg_registers_shared_index(&self) -> bool

Whether the integer and floating point argument registers share a single argument index. Read more
Source§

fn reserved_stack_space_for_arg_registers(&self) -> bool

Whether stack space is reserved by the caller for the register arguments (for example, the shadow/home space used by the Windows x64 calling convention).
Source§

fn stack_adjusted_on_return(&self) -> bool

Whether the callee adjusts the stack to remove the arguments before returning (as in stdcall), rather than leaving the caller to clean up the stack (as in cdecl).
Source§

fn is_eligible_for_heuristics(&self) -> bool

Whether this calling convention may be selected by heuristic calling convention detection.
Source§

fn return_int_reg(&self) -> Option<RegisterId>

Gets the register that holds the integer return value.
Source§

fn return_hi_int_reg(&self) -> Option<RegisterId>

Gets the register that holds the high part of an integer return value that is too large to fit in a single register.
Source§

fn return_float_reg(&self) -> Option<RegisterId>

Gets the register that holds the floating point return value.
Source§

fn global_pointer_regs(&self) -> Vec<RegisterId>

Source§

fn implicitly_defined_registers(&self) -> Vec<RegisterId>

Gets the registers that are implicitly given a known value on function entry by this calling convention.
Source§

fn are_argument_registers_used_for_var_args(&self) -> bool

Whether argument registers are used to pass variadic arguments.
Source§

fn incoming_register_value( &self, reg: RegisterId, func: Option<&Function>, ) -> RegisterValue

The known value of a register on entry to a function. The default implementation models the top of a register stack (such as the x87 floating point stack) as the constant zero and leaves all other registers undetermined.
Source§

fn incoming_flag_value( &self, flag: FlagId, func: Option<&Function>, ) -> RegisterValue

The known value of a flag on entry to a function. The default implementation leaves all flags undetermined.
Source§

fn incoming_variable_for_parameter_variable( &self, var: &Variable, func: Option<&Function>, ) -> Variable

The incoming variable used to pass the given parameter variable.
Source§

fn parameter_variable_for_incoming_variable( &self, var: &Variable, func: Option<&Function>, ) -> Variable

The parameter variable corresponding to the given incoming variable.
Source§

fn is_return_type_register_compatible( &self, view: Option<&BinaryView>, ty: &Type, ) -> bool

Whether a value of the given type can be returned in registers, as opposed to being returned indirectly through memory. The default implementation allows register returns for types that fit in a single register, have a size equal to two registers when CallingConvention::return_hi_int_reg is a valid register, or are a floating point type when CallingConvention::return_float_reg is a valid register.
Source§

fn indirect_return_value_location(&self) -> Variable

The location used to pass the hidden pointer argument for return values that are returned indirectly through memory. The default location is the first integer argument register, or the first stack slot if there are no integer argument registers.
Source§

fn returned_indirect_return_value_pointer(&self) -> Option<Variable>

The location in which the hidden indirect return value pointer is returned to the caller, for calling conventions that return it.
Source§

fn is_argument_type_register_compatible( &self, view: Option<&BinaryView>, ty: &Type, ) -> bool

Whether a value of the given type can be passed as an argument in registers. The default implementation allows register arguments for types that fit in a single register, or are a floating point type when CallingConvention::float_arg_registers has valid registers.
Source§

fn is_non_register_argument_indirect( &self, view: Option<&BinaryView>, ty: &Type, ) -> bool

Whether an argument that cannot be passed in registers is passed indirectly by pointer, as opposed to being passed directly on the stack.
Source§

fn are_stack_arguments_naturally_aligned(&self) -> bool

Whether arguments passed on the stack are aligned to their natural alignment. If false, arguments are aligned to the address size.
Source§

fn are_stack_arguments_pushed_left_to_right(&self) -> bool

Whether arguments passed on the stack are pushed left-to-right, as opposed to the more common right-to-left order.
Source§

fn call_layout( &self, view: Option<&BinaryView>, return_value: &ReturnValue, params: &[FunctionParameter], permitted_registers: Option<&[RegisterId]>, ) -> CallLayout

Computes the complete call layout (parameter locations, return value location, and stack adjustments) for a call with the given return value and parameters. The default implementation uses CallingConvention::return_value_location, CallingConvention::parameter_locations, CallingConvention::stack_adjustment_for_locations, and CallingConvention::stack_adjustment_for_locations to compute the layout. Read more
Source§

fn return_value_location( &self, view: Option<&BinaryView>, return_value: &ReturnValue, ) -> ValueLocation

Computes the location of the return value for the given return value type. The default implementation checks CallingConvention::is_return_type_register_compatible and places the return value in registers if it can, or uses an indirect return by pointer if not. If an indirect return is required, then CallingConvention::indirect_return_value_location and CallingConvention::returned_indirect_return_value_pointer are used to provide the location of the indirect return value.
Source§

fn parameter_locations( &self, view: Option<&BinaryView>, return_value: Option<&ValueLocation>, params: &[FunctionParameter], permitted_registers: Option<&[RegisterId]>, ) -> Vec<ValueLocation>

Source§

fn parameter_ordering_for_variables( &self, view: Option<&BinaryView>, params: &[(Variable, Ref<Type>)], ) -> Vec<Variable>

Computes the order in which the given parameter variables are passed. The default implementation first checks CallingConvention::arg_registers_shared_index to see if the parameter ordering is well defined. If the arguments do not share an index, it places all integer arguments before the floating point arguments. Arguments that are not passed in a normal location are placed last.
Source§

fn stack_adjustment_for_locations( &self, view: Option<&BinaryView>, return_value: Option<&ValueLocation>, params: &[(ValueLocation, Ref<Type>)], ) -> i64

Computes the stack adjustment applied on return for a call with the given return value and parameter locations. The default implementation first checks CallingConvention::stack_adjusted_on_return, and returns zero if that returns false. Otherwise, it checks the stack parameter locations and CallingConvention::are_stack_arguments_naturally_aligned to compute the stack adjustment necessary to cover all parameters.
Source§

fn register_stack_adjustments( &self, view: Option<&BinaryView>, return_value: Option<&ValueLocation>, params: &[ValueLocation], ) -> BTreeMap<RegisterId, i32>

Computes the per-register-stack adjustments (for architectures with register stacks, such as the x87 floating point stack) for a call with the given return value and parameter locations. The default implementation compares the register stack slots used by the parameters and the return value to compute the adjustments.
Source§

impl CoreArrayProvider for CoreCallingConvention

Source§

impl Debug for CoreCallingConvention

Source§

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

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

impl Hash for CoreCallingConvention

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 CoreCallingConvention

Source§

fn eq(&self, rhs: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToOwned for CoreCallingConvention

Source§

type Owned = Ref<CoreCallingConvention>

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 CoreCallingConvention

Source§

impl Send for CoreCallingConvention

Source§

impl Sync for CoreCallingConvention

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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>,

Source§

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

Source§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more