pub struct Project {
    pub program: Term<Program>,
    pub cpu_architecture: String,
    pub stack_pointer_register: Variable,
    pub register_properties: Vec<RegisterProperties>,
    pub register_calling_convention: Vec<CallingConvention>,
    pub datatype_properties: DatatypeProperties,
}
Expand description

The project struct describing all known information about the binary.

Fields§

§program: Term<Program>

The program struct containing all binary-specific information.

§cpu_architecture: String

The CPU-architecture that the binary uses.

§stack_pointer_register: Variable

The stack pointer register of the CPU-architecture.

§register_properties: Vec<RegisterProperties>

Information about all CPU-architecture-specific registers.

§register_calling_convention: Vec<CallingConvention>

Information about known calling conventions for the given CPU architecture.

§datatype_properties: DatatypeProperties

Contains the properties of C data types. (e.g. size)

Implementations§

source§

impl Project

source

pub fn into_ir_project(self, binary_base_address: u64) -> IrProject

Convert a project parsed from Ghidra to the internally used IR.

The binary_base_address denotes the base address of the memory image of the binary according to the program headers of the binary.

source§

impl Project

source

pub fn normalize(&mut self) -> Vec<LogMessage>

This function runs normalization passes to bring the project into a form that can be translated into the internally used intermediate representation.

Currently implemented normalization passes:

Insert explicit LOAD instructions for implicit memory loads in P-Code.

Ghidra generates implicit loads for memory accesses, whose address is a constant. The pass converts them to explicit LOAD instructions.

Remove basic blocks of functions without correct starting block

Sometimes Ghidra generates a (correct) function start inside another function. But if the function start is not also the start of a basic block, we cannot handle it correctly (yet) as this would need splitting of basic blocks. So instead we generate a log message and handle the function as a function without code, i.e. a dead end in the control flow graph.

Trait Implementations§

source§

impl Clone for Project

source§

fn clone(&self) -> Project

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Project

source§

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

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

impl<'de> Deserialize<'de> for Project

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for Project

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 Project

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Project

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Project

source§

impl StructuralEq for Project

source§

impl StructuralPartialEq for Project

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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,

§

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

§

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

§

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,