mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-16 05:04:22 +02:00
invincible_image: add V2 key
This commit is contained in:
@@ -5,6 +5,10 @@ use binrw::BinRead;
|
||||
pub static V3_KEY: [u8; 16] = [0x32, 0xe5, 0x26, 0x1e, 0x22, 0x67, 0x5e, 0x93, 0x20, 0xcf, 0x35, 0x91, 0x7c, 0x63, 0x7a, 0x36];
|
||||
pub static V3_IV: [u8; 16] = [0xe3, 0x9f, 0x36, 0x39, 0x56, 0x9a, 0x6b, 0x8d, 0x3f, 0x2e, 0xc9, 0x44, 0xd9, 0xbc, 0xec, 0x43];
|
||||
|
||||
//v2 key + iv
|
||||
pub static V2_KEY: [u8; 16] = [0x2e, 0x90, 0xe7, 0xea, 0xf6, 0x33, 0xb7, 0x26, 0xa7, 0xbf, 0x70, 0x17, 0x89, 0xc5, 0x8e, 0xad];
|
||||
pub static V2_IV: [u8; 16] = [0x23, 0x7e, 0x3b, 0x90, 0x7d, 0x24, 0x3f, 0xce, 0x43, 0xa4, 0xa3, 0x32, 0x1e, 0x92, 0x98, 0xfe];
|
||||
|
||||
#[derive(BinRead)]
|
||||
pub struct Header {
|
||||
_magic_bytes: [u8; 16], // INVINCIBLE_IMAGE
|
||||
|
||||
@@ -26,7 +26,7 @@ pub fn extract_invincible_image(app_ctx: &AppContext, _ctx: Box<dyn Any>) -> Res
|
||||
let mut file = app_ctx.file().ok_or("Extractor expected file")?;
|
||||
|
||||
let header: Header = file.read_le()?;
|
||||
println!("File info -\nFile Version: {}\nVersion(1): {}\nVersion(2): {}\nVersion(3): {}\nVersion(4): {}\nData size: {}\nChunk count: {}\nChunk size: {}\n\nPayload Count: {}",
|
||||
println!("File info -\nKey ID: {}\nVersion(1): {}\nVersion(2): {}\nVersion(3): {}\nVersion(4): {}\nData size: {}\nChunk count: {}\nChunk size: {}\n\nPayload Count: {}",
|
||||
header.file_infos[0], header.ver1(), header.ver2(), header.ver3(), header.ver4(), header.data_size, header.chunk_count, header.chunk_size, header.payload_count);
|
||||
|
||||
let mut entries: Vec<Entry> = Vec::new();
|
||||
@@ -40,7 +40,8 @@ pub fn extract_invincible_image(app_ctx: &AppContext, _ctx: Box<dyn Any>) -> Res
|
||||
|
||||
let (aes_key, aes_iv) = match header.file_infos[0] {
|
||||
3 => (V3_KEY, V3_IV),
|
||||
_ => return Err("Unsupported format version! (Unknown key)".into())
|
||||
2 => (V2_KEY, V2_IV),
|
||||
_ => return Err("Unsupported Key ID!".into())
|
||||
};
|
||||
|
||||
file.seek(SeekFrom::Start(header.data_start_offset.into()))?;
|
||||
|
||||
Reference in New Issue
Block a user