pub struct Container<'a> { /* private fields */ }Expand description
Parsed IFPS blob.
Borrows from the original byte slice — names, decls, and bytecode regions all reference the original buffer rather than allocating.
Implementations§
Source§impl<'a> Container<'a>
impl<'a> Container<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Container<'a>, Error>
pub fn parse(bytes: &'a [u8]) -> Result<Container<'a>, Error>
Parses an IFPS blob from bytes.
§Errors
Returns whatever Header::parse or any of the per-table
walkers (types, procs, vars) surface — see Error for
the full set.
Sourcepub fn main_proc(&self) -> Option<&Proc<'a>>
pub fn main_proc(&self) -> Option<&Proc<'a>>
Returns the entry-point proc, or None when the blob has
no main proc (MainProcNo == u32::MAX).
Sourcepub fn display<'c>(
&'c self,
disasm: &'c ProcDisasm<'a>,
) -> DisasmDisplay<'a, 'c>
pub fn display<'c>( &'c self, disasm: &'c ProcDisasm<'a>, ) -> DisasmDisplay<'a, 'c>
Wraps disasm in a DisasmDisplay bound to this
container’s symbol tables, ready for format! /
println!. Convenience over constructing the wrapper
manually via DisasmDisplay::new.
Sourcepub fn display_summary(&self) -> ContainerSummary<'a, '_>
pub fn display_summary(&self) -> ContainerSummary<'a, '_>
Returns a ContainerSummary — single-line
fmt::Display-ready triage view (IFPS build N — A types, B procs (X internal / Y external), C vars, main=…).
Sourcepub fn disassemble(
&self,
proc_index: u32,
) -> Result<Option<ProcDisasm<'a>>, Error>
pub fn disassemble( &self, proc_index: u32, ) -> Result<Option<ProcDisasm<'a>>, Error>
Disassembles the bytecode body of the proc at
proc_index.
Returns Ok(None) when the requested proc is external
(no bytecode body to walk). Returns Ok(Some(_)) with the
fully decoded instruction stream when the proc is
internal. The returned ProcDisasm borrows from the
container’s IFPS blob.
§Errors
Error::TypeIndexOutOfRangewhenproc_index >= procs.len().Error::BytecodeOutOfRange/Error::UnknownBaseType/Error::Truncatedwhen an instruction can’t be decoded.