feat: parse and display security info (M3)
Implement security info parsing including RSA signature, encrypted AES key, image/region/media flags, load address, SHA-1 digests, and page descriptors with section type classification. Add comprehensive unit and integration tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,11 +10,13 @@ pub mod display;
|
||||
pub mod error;
|
||||
pub mod header;
|
||||
pub mod optional;
|
||||
pub mod security;
|
||||
pub mod util;
|
||||
|
||||
use error::Result;
|
||||
use header::Xex2Header;
|
||||
use optional::OptionalHeaders;
|
||||
use security::SecurityInfo;
|
||||
|
||||
/// A parsed XEX2 file containing all extracted structures.
|
||||
#[derive(Debug)]
|
||||
@@ -23,6 +25,8 @@ pub struct Xex2File {
|
||||
pub header: Xex2Header,
|
||||
/// All parsed optional headers.
|
||||
pub optional_headers: OptionalHeaders,
|
||||
/// Security info (signatures, keys, page descriptors).
|
||||
pub security_info: SecurityInfo,
|
||||
}
|
||||
|
||||
/// Parses an XEX2 file from a byte slice.
|
||||
@@ -32,9 +36,11 @@ pub struct Xex2File {
|
||||
pub fn parse(data: &[u8]) -> Result<Xex2File> {
|
||||
let header = header::parse_header(data)?;
|
||||
let optional_headers = optional::parse_optional_headers(data, &header)?;
|
||||
let security_info = security::parse_security_info(data, header.security_offset)?;
|
||||
|
||||
Ok(Xex2File {
|
||||
header,
|
||||
optional_headers,
|
||||
security_info,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user