Ported all NUS download functions from libWiiPy and corresponding CLI commands

Also adds the basics of U8 archive packing/unpacking, however they are not in a usable state yet and there are no working CLI commands associated with them.
This commit is contained in:
2025-04-08 20:47:35 -04:00
parent e55edc10fd
commit be9148fcfa
13 changed files with 2126 additions and 33 deletions

View File

@@ -50,11 +50,11 @@ impl fmt::Display for TitleType {
#[derive(Debug, Clone)]
pub enum ContentType {
Normal,
Development,
HashTree,
DLC,
Shared,
Normal = 1,
Development = 2,
HashTree = 3,
DLC = 16385,
Shared = 32769,
}
impl fmt::Display for ContentType {
@@ -70,8 +70,8 @@ impl fmt::Display for ContentType {
}
pub enum AccessRight {
AHB,
DVDVideo,
AHB = 0,
DVDVideo = 1,
}
#[derive(Debug, Clone)]
@@ -332,10 +332,7 @@ impl TMD {
/// Gets whether a specified access right is enabled in a TMD.
pub fn check_access_right(&self, right: AccessRight) -> bool {
match right {
AccessRight::AHB => (self.access_rights & (1 << 0)) != 0,
AccessRight::DVDVideo => (self.access_rights & (1 << 1)) != 0,
}
self.access_rights & (1 << right as u8) != 0
}
/// Gets the name of the certificate used to sign a TMD as a string.