mirror of
https://github.com/NinjaCheetah/rustii.git
synced 2026-03-11 04:27:49 -04:00
Refactored entire way that title content is handled
The ContentRegion has been entirely dissolved. Its fields were not particularly useful, as the content records were just a duplicate from the TMD, the file data itself, and then two integers that were assigned during construction and then literally never referenced. Instead, the only copy of the content records now lives in the TMD, and the content is stored within the title directly since that was the only meaningful field. All the content related methods were moved from the ContentRegion struct over to the Title struct, since the content just lives there now. This should hopefully make things much easier to deal with as you no longer need to worry about keeping two separate copies of the content records in sync. This also might all change again in the future idk
This commit is contained in:
@@ -16,34 +16,34 @@ fn main() {
|
||||
let patch_count = title::iospatcher::ios_patch_sigchecks(&mut title, index).unwrap();
|
||||
println!("patches applied: {}", patch_count);
|
||||
|
||||
println!("Title ID from WAD via Title object: {}", hex::encode(title.tmd.title_id()));
|
||||
println!("Title ID from WAD via Title object: {}", hex::encode(title.tmd().title_id()));
|
||||
|
||||
let wad = wad::WAD::from_bytes(&data).unwrap();
|
||||
println!("size of tmd: {:?}", wad.tmd().len());
|
||||
println!("num content records: {:?}", title.tmd.content_records().len());
|
||||
println!("first record data: {:?}", title.tmd.content_records().first().unwrap());
|
||||
println!("TMD is fakesigned: {:?}",title.tmd.is_fakesigned());
|
||||
println!("num content records: {:?}", title.tmd().content_records().len());
|
||||
println!("first record data: {:?}", title.tmd().content_records().first().unwrap());
|
||||
println!("TMD is fakesigned: {:?}",title.tmd().is_fakesigned());
|
||||
|
||||
println!("title version from ticket is: {:?}", title.ticket.title_version());
|
||||
println!("title key (enc): {:?}", title.ticket.title_key());
|
||||
println!("title key (dec): {:?}", title.ticket.title_key_dec());
|
||||
println!("ticket is fakesigned: {:?}", title.ticket.is_fakesigned());
|
||||
println!("title version from ticket is: {:?}", title.ticket().title_version());
|
||||
println!("title key (enc): {:?}", title.ticket().title_key());
|
||||
println!("title key (dec): {:?}", title.ticket().title_key_dec());
|
||||
println!("ticket is fakesigned: {:?}", title.ticket().is_fakesigned());
|
||||
|
||||
println!("title is fakesigned: {:?}", title.is_fakesigned());
|
||||
|
||||
let cert_chain = &title.cert_chain;
|
||||
let cert_chain = &title.cert_chain();
|
||||
println!("cert chain OK");
|
||||
let result = cert::verify_ca_cert(&cert_chain.ca_cert()).unwrap();
|
||||
println!("CA cert {} verified successfully: {}", cert_chain.ca_cert().child_cert_identity(), result);
|
||||
|
||||
let result = cert::verify_child_cert(&cert_chain.ca_cert(), &cert_chain.tmd_cert()).unwrap();
|
||||
println!("TMD cert {} verified successfully: {}", cert_chain.tmd_cert().child_cert_identity(), result);
|
||||
let result = cert::verify_tmd(&cert_chain.tmd_cert(), &title.tmd).unwrap();
|
||||
let result = cert::verify_tmd(&cert_chain.tmd_cert(), title.tmd()).unwrap();
|
||||
println!("TMD verified successfully: {}", result);
|
||||
|
||||
let result = cert::verify_child_cert(&cert_chain.ca_cert(), &cert_chain.ticket_cert()).unwrap();
|
||||
println!("Ticket cert {} verified successfully: {}", cert_chain.ticket_cert().child_cert_identity(), result);
|
||||
let result = cert::verify_ticket(&cert_chain.ticket_cert(), &title.ticket).unwrap();
|
||||
let result = cert::verify_ticket(&cert_chain.ticket_cert(), title.ticket()).unwrap();
|
||||
println!("Ticket verified successfully: {}", result);
|
||||
|
||||
let result = title.verify().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user