Added rustii CLI wad edit command and required library features

This required a LOT more backend work than I expected. But hey, some of this stuff is being done better than it was in libWiiPy/WiiPy, so that's a win in my book.
When changing both the Title ID and type of a WAD, the updated TID will only be written once (which also means the Title Key will only be re-encrypted once). This is an improvement over WiiPy where it will be updated as part of both changes.
Some TMD fields have been made private and moved to getter/setter methods only as they are actually in use now and should only be set through the correct means.
This commit is contained in:
2025-04-29 22:03:55 -04:00
parent 481594345d
commit a30a0f2c5b
10 changed files with 232 additions and 80 deletions

View File

@@ -7,7 +7,7 @@ use rustii::title;
fn main() {
let data = fs::read("sm.wad").unwrap();
let title = title::Title::from_bytes(&data).unwrap();
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());