parse magic and reference

This commit is contained in:
eta 2022-12-29 00:26:54 +00:00
parent d1de3f3137
commit 18f0d19e6b

View File

@ -57,7 +57,18 @@ fn main() -> anyhow::Result<()> {
println!("[+] Loaded {} public keys!", iks.keys.len());
println!("[+] Reading ticket.dat...");
let ticket = fs::read_to_string("./ticket.dat")?;
if ticket.len() < 16 {
return Err(anyhow!("ticket too short"));
}
if &ticket[0..2] != "06" {
return Err(anyhow!(
"ticket isn't a RSP6 ticket: magic was {}",
&ticket[0..2]
));
}
let issuer_id = &ticket[13..15];
let ticket_reference = format!("{}{}", issuer_id, &ticket[2..11]);
println!("[+] RSP6 ticket, reference {}", ticket_reference);
println!("[+] Ticket issuer: {}", issuer_id);
let ticket = base26_decode(&ticket[15..]);
let keys = iks