Skip to main content

Item

Enum Item 

Source
pub enum Item {
    Comment(String),
    Function(FnDecl),
    Raw {
        addr: u64,
        bytes: Vec<u8>,
    },
    Strings {
        addr: u64,
        strings: Vec<String>,
    },
    Notes {
        addr: u64,
        entries: Vec<NoteEntry>,
    },
    Section {
        name: String,
        addr: u64,
        items: Vec<Item>,
    },
    JumpTable {
        addr: u64,
        dispatch: String,
        entries: Vec<JumpTableEntry>,
    },
}
Expand description

An item in the file: at the top level, or nested inside an Item::Section.

Variants§

§

Comment(String)

Free-floating // … line. Preserved on emit so structural notes survive parse → re-emit.

§

Function(FnDecl)

A function declaration.

§

Raw

@raw(0x…, [bytes]) — pin a slice of bytes at a virtual address. Used by the decompiler to fill the gaps between functions (alignment padding) and to capture the content of non-executable sections (.rodata, .data, etc.).

Fields

§addr: u64
§bytes: Vec<u8>
§

Strings

@strings(0x…, ["a", "b", …]) — a packed null-terminated string table. Lowers to each entry’s UTF-8 bytes followed by a single 0x00 terminator, in order. Used for ELF SHT_STRTAB sections (.dynstr, .strtab, .shstrtab) and for any well-known single-string sections like .interp (which is emitted as a one-entry list).

Fields

§addr: u64
§strings: Vec<String>
§

Notes

@notes(0x…, [{ type: …, name: "…", desc: [bytes] }, …]) — an ELF note section. Each entry has a 12-byte Elf64_Nhdr header (name_size, desc_size, type), a name padded to a 4-byte boundary, and a desc padded to a 4-byte boundary. Used for SHT_NOTE sections (.note.gnu.property, .note.ABI-tag, .note.gnu.build-id, …).

Fields

§addr: u64
§entries: Vec<NoteEntry>
§

Section

@section("name", 0x…) { items… } — group items under an ELF section. The section’s start address must equal the first nested item’s address; items are required to cover the section contiguously (no gaps) for lower to succeed.

Fields

§name: String
§addr: u64
§items: Vec<Item>
§

JumpTable

@jump_table(0x…, dispatch="…") { case_0: label_<addr>; … } — a structured switch jump table. Each entry names a case index and the address it dispatches to; the dispatch string tags the encoding kind (e.g. "gcc_pie_rel32", "msvc_va32") so lower knows whether to emit 4-byte signed offsets relative to the table base, absolute 32-bit VAs, or some other layout. Replaces the @raw byte run a jump table would otherwise occupy in .rodata, recovering the symbolic intent of the dispatch.

Fields

§addr: u64
§dispatch: String

Trait Implementations§

Source§

impl Clone for Item

Source§

fn clone(&self) -> Item

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Item

Source§

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

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

impl PartialEq for Item

Source§

fn eq(&self, other: &Item) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Eq for Item

Source§

impl StructuralPartialEq for Item

Auto Trait Implementations§

§

impl Freeze for Item

§

impl RefUnwindSafe for Item

§

impl Send for Item

§

impl Sync for Item

§

impl Unpin for Item

§

impl UnsafeUnpin for Item

§

impl UnwindSafe for Item

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.