Skip to main content

cfunc_t

Struct cfunc_t 

pub struct cfunc_t { /* private fields */ }
Expand description

Decompiled function. Decompilation result is kept here.

Implementations§

§

impl cfunc_t

pub unsafe fn build_c_tree(self: Pin<&mut Self>)

Generate the function body. This function (re)generates the function body from the underlying microcode.

pub unsafe fn print_dcl(&self, vout: *mut qstring_char_AutocxxConcrete)

Print function prototype. \param vout output buffer

pub unsafe fn print_func(&self, vp: Pin<&mut vc_printer_t>)

Print function text. \param vp printer helper class to receive the generated text.

pub unsafe fn get_func_type(&self, type_: *mut tinfo_t) -> bool

Get the function type. \param type variable where the function type is returned \return false if failure

pub unsafe fn get_lvars(self: Pin<&mut Self>) -> *mut lvars_t

Get vector of local variables. \return pointer to the vector of local variables. If you modify this vector, the ctree must be regenerated in order to have correct cast operators. Use build_c_tree() for that. Removing lvars should be done carefully: all references in ctree and microcode must be corrected after that.

pub unsafe fn get_stkoff_delta(self: Pin<&mut Self>) -> c_longlong

Get stack offset delta. The local variable stack offsets retrieved by v.location.stkoff() should be adjusted before being used as stack frame offsets in IDA. \return the delta to apply. example: ida_stkoff = v.location.stkoff() - f->get_stkoff_delta()

pub unsafe fn find_label(self: Pin<&mut Self>, label: c_int) -> *mut citem_t

Find the label. \return pointer to the ctree item with the specified label number.

pub unsafe fn remove_unused_labels(self: Pin<&mut Self>)

Remove unused labels. This function checks what labels are really used by the function and removes the unused ones. You must call it after deleting a goto statement.

pub unsafe fn redirect_gotos(self: Pin<&mut Self>, from: c_int, to: c_int)

Redirect all gotos targeting one label to another. This function walks the entire ctree and changes all goto statements that target \p from to target \p to instead. \param from source label number \param to target label number

pub unsafe fn get_user_cmt( &self, loc: &treeloc_t, rt: cmt_retrieval_type_t, ) -> *const c_char

Retrieve a user defined comment. \param loc ctree location \param rt should already retrieved comments retrieved again? \return pointer to the comment string or nullptr

pub unsafe fn set_user_cmt( self: Pin<&mut Self>, loc: &treeloc_t, cmt: *const c_char, )

Set a user defined comment. This function stores the specified comment in the cfunc_t structure. The save_user_cmts() function must be called after it. \param loc ctree location \param cmt new comment. if empty or nullptr, then an existing comment is deleted.

pub unsafe fn get_user_iflags(&self, loc: &citem_locator_t) -> c_int

Retrieve citem iflags. \param loc citem locator \return \ref CIT_ or 0

pub unsafe fn set_user_iflags( self: Pin<&mut Self>, loc: &citem_locator_t, iflags: c_int, )

Set citem iflags. \param loc citem locator \param iflags new iflags

pub unsafe fn has_orphan_cmts(&self) -> bool

Check if there are orphan comments.

pub unsafe fn del_orphan_cmts(self: Pin<&mut Self>) -> c_int

Delete all orphan comments. The save_user_cmts() function must be called after this call.

pub unsafe fn get_user_union_selection( self: Pin<&mut Self>, ea: c_ulonglong, path: *mut qvector_int_AutocxxConcrete, ) -> bool

Retrieve a user defined union field selection. \param ea address \param path out: path describing the union selection. \return pointer to the path or nullptr

pub unsafe fn set_user_union_selection( self: Pin<&mut Self>, ea: c_ulonglong, path: &qvector_int_AutocxxConcrete, )

Set a union field selection. The save_user_unions() function must be called after calling this function. \param ea address \param path in: path describing the union selection.

pub unsafe fn save_user_labels(&self)

Save user-defined labels into the database

pub unsafe fn save_user_cmts(&self)

Save user-defined comments into the database

pub unsafe fn save_user_numforms(&self)

Save user-defined number formats into the database

pub unsafe fn save_user_iflags(&self)

Save user-defined iflags into the database

pub unsafe fn save_user_unions(&self)

Save user-defined union field selections into the database

pub unsafe fn save_user_casts(&self)

Save user-defined casts into the database

pub unsafe fn get_line_item( self: Pin<&mut Self>, line: *const c_char, x: c_int, is_ctree_line: bool, phead: *mut ctree_item_t, pitem: *mut ctree_item_t, ptail: *mut ctree_item_t, ) -> bool

Get ctree item for the specified cursor position. \return false if failed to get the current item \param line line of decompilation text (element of \ref sv) \param x x cursor coordinate in the line \param is_ctree_line does the line belong to statement area? (if not, it is assumed to belong to the declaration area) \param phead ptr to the first item on the line (used to attach block comments). May be nullptr \param pitem ptr to the current item. May be nullptr \param ptail ptr to the last item on the line (used to attach indented comments). May be nullptr \sa vdui_t::get_current_item()

pub unsafe fn get_warnings<'a>( self: Pin<&'a mut Self>, ) -> Pin<&'a mut qvector_hexwarn_t_AutocxxConcrete>

Get information about decompilation warnings. \return reference to the vector of warnings

pub unsafe fn get_pseudocode<'a>( self: Pin<&'a mut Self>, ) -> &'a qvector_simpleline_t_AutocxxConcrete

Get pointer to decompilation output: the pseudocode. This function generates pseudocode if not done yet.

pub unsafe fn refresh_func_ctext(self: Pin<&mut Self>)

Refresh ctext after a ctree modification. This function informs the decompiler that ctree (\ref body) have been modified and ctext (\ref sv) does not correspond to it anymore. It also refreshes the pseudocode windows if there is any.

pub unsafe fn recalc_item_addresses(self: Pin<&mut Self>)

Recalculate item adresses. This function may be required after shuffling ctree items. For example, when adding or removing statements of a block, or changing ‘if’ statements.

pub unsafe fn find_addressable_item(&self, i: *const citem_t) -> *const citem_t

Find the closest addressable ancestor of an item. Try to locate the closest address to the citem_t \p i walking the tree and taking the most immediate parent with an address. \return the closest addressable item, or \p i itself if none was found

pub unsafe fn gather_derefs( &self, ci: &ctree_item_t, udm: *mut udt_type_data_t, ) -> bool

pub unsafe fn find_item_coords( self: Pin<&mut Self>, item: *const citem_t, px: *mut c_int, py: *mut c_int, ) -> bool

pub unsafe fn locked(&self) -> bool

§

impl cfunc_t

pub unsafe fn release(self: Pin<&mut cfunc_t>)

pub unsafe fn verify( self: &cfunc_t, aul: allow_unused_labels_t, even_without_debugger: bool, )

Verify the ctree. This function verifies the ctree. If the ctree is malformed, an internal error is generated. Use it to verify the ctree after your modifications. \param aul Are unused labels acceptable? \param even_without_debugger if false and there is no debugger, the verification will be skipped

pub unsafe fn get_user_cast<'a>( self: &'a cfunc_t, loc: &'a citem_locator_t, ) -> impl New<Output = tinfo_t> + 'a

Retrieve a user-defined cast.

pub unsafe fn set_user_cast( self: Pin<&mut cfunc_t>, loc: &citem_locator_t, type_: &tinfo_t, )

Set a user-defined cast.

pub unsafe fn serialize(self: Pin<&mut cfunc_t>, vout: *mut bytevec_t) -> bool

Serialize cfunc into a sequence of bytes.

pub unsafe fn deserialize( mba: *mut mba_t, bytes: *const u8, nbytes: usize, ) -> *mut cfunc_t

Deserialize a byte sequence into cfunc_t \param mba the matching mba object \param bytes pointer to the beginning of the byte sequence. \param nbytes number of bytes in the byte sequence. \return new cfunc_t object

pub unsafe fn new(mba: *mut mba_t) -> impl New<Output = Self>

Trait Implementations§

§

impl Drop for cfunc_t

§

fn drop(self: &mut cfunc_t)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
§

impl ExternType for cfunc_t

§

type Id = (c, f, u, n, c, __, t)

A type-level representation of the type’s C++ namespace and type name. Read more
§

type Kind = Opaque

§

impl MakeCppStorage for cfunc_t

§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut cfunc_t

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut cfunc_t)

Frees a C++ allocation which has not yet had a constructor called. Read more
§

impl SharedPtrTarget for cfunc_t

§

impl UniquePtrTarget for cfunc_t

§

impl WeakPtrTarget for cfunc_t

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

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.