Struct cwe_checker_lib::pcode::Project
source · 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
impl Project
sourcepub fn into_ir_project(self, binary_base_address: u64) -> IrProject
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
impl Project
sourcepub fn normalize(&mut self) -> Vec<LogMessage>
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<'de> Deserialize<'de> for Project
impl<'de> Deserialize<'de> for Project
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 Project
impl PartialEq for Project
impl Eq for Project
impl StructuralEq for Project
impl StructuralPartialEq for Project
Auto Trait Implementations§
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnwindSafe for Project
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.