Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/me.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ impl ME {
}
}

// Find an ME partition in a given slice, and if an FPT is detected, get the
// parse result, which includes the offset as its base address.
pub fn scan(data: &[u8], debug: bool) -> Option<Result<Self, String>> {
for o in (0..data.len() - FPT_SIZE - 0x10).step_by(0x40) {
if let Some(r) = Self::parse(&data[o..], o, debug) {
return Some(r);
}
}
None
}

// Scan for all CPDs (there may be some not listed in FPT)
pub fn cpd_scan(data: &[u8]) -> Vec<CodePartitionDirectory> {
let mut gen3dirs = Vec::<CodePartitionDirectory>::new();
Expand Down