pub struct Program {
pub subs: BTreeMap<Tid, Term<Sub>>,
pub extern_symbols: BTreeMap<Tid, ExternSymbol>,
pub entry_points: BTreeSet<Tid>,
pub address_base_offset: u64,
}
Expand description
The Program
structure represents a disassembled binary.
Fields§
§subs: BTreeMap<Tid, Term<Sub>>
The known functions contained in the binary
extern_symbols: BTreeMap<Tid, ExternSymbol>
Extern symbols linked to the binary by the linker.
entry_points: BTreeSet<Tid>
Entry points into to binary, i.e. the term identifiers of functions that may be called from outside of the binary.
address_base_offset: u64
An offset that has been added to all addresses in the program compared to the addresses as specified in the binary file.
In certain cases, e.g. if the binary specifies a segment to be loaded at address 0, the Ghidra backend may shift the whole binary image by a constant value in memory. Thus addresses as specified by the binary and addresses as reported by Ghidra may differ by a constant offset, which is stored in this value.
Implementations§
source§impl Program
impl Program
sourcepub fn find_block(&self, tid: &Tid) -> Option<&Term<Blk>>
pub fn find_block(&self, tid: &Tid) -> Option<&Term<Blk>>
Find a block term by its term identifier. WARNING: The function simply iterates through all blocks, i.e. it is very inefficient for large projects!
sourcepub fn find_sub_containing_jump(&self, jmp_tid: &Tid) -> Option<Tid>
pub fn find_sub_containing_jump(&self, jmp_tid: &Tid) -> Option<Tid>
Find the sub containing a specific jump instruction (including call instructions). WARNING: The function simply iterates though all blocks, i.e. it is very inefficient for large projects!
Trait Implementations§
source§impl<'de> Deserialize<'de> for Program
impl<'de> Deserialize<'de> for Program
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for Program
impl PartialEq for Program
impl Eq for Program
impl StructuralEq for Program
impl StructuralPartialEq for Program
Auto Trait Implementations§
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.