feat: show decrypted session key in inspect output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-03-28 22:24:23 +01:00
parent ee5e0b60f8
commit 4ed8fadd4c
3 changed files with 8 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
/// Pretty-print formatting for parsed XEX2 structures.
use crate::crypto;
use crate::header::Xex2Header;
use crate::optional::{
format_hex_bytes, format_rating, format_timestamp, CompressionInfo, HeaderKey, OptionalHeaders,
@@ -266,6 +267,11 @@ pub fn display_security_info(security: &SecurityInfo) {
"AES Key (encrypted): {}",
format_hex_bytes(&security.aes_key)
);
let session_key = crypto::derive_session_key(&security.aes_key);
println!(
"AES Key (decrypted): {}",
format_hex_bytes(&session_key)
);
if security.export_table == 0 {
println!("Export Table: 0x00000000 (none)");