From c2f62255007b01586cfd4ee05b3909ff307ab96b Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Fri, 20 Dec 2024 19:21:53 -0500 Subject: [PATCH] Entirely restructured API documentation, now much easier to navigate --- docs/source/api.md | 21 ++++ docs/source/archive/archive.md | 18 ++++ docs/source/archive/ash.md | 10 ++ docs/source/archive/u8.md | 10 ++ docs/source/conf.py | 1 + docs/source/index.md | 11 ++- docs/source/libWiiPy.archive.md | 28 ------ docs/source/libWiiPy.md | 36 ------- docs/source/libWiiPy.nand.md | 27 ----- docs/source/libWiiPy.title.md | 99 ------------------- .../{libWiiPy.media.md => media/banner.md} | 5 +- docs/source/media/media.md | 16 +++ docs/source/modules.md | 7 -- docs/source/nand/emunand.md | 10 ++ docs/source/nand/nand.md | 20 ++++ docs/source/nand/setting.md | 10 ++ docs/source/nand/sys.md | 10 ++ docs/source/title/cert.md | 10 ++ docs/source/title/commonkeys.md | 10 ++ docs/source/title/content.md | 10 ++ docs/source/title/crypto.md | 10 ++ docs/source/title/iospatcher.md | 10 ++ docs/source/title/nus.md | 10 ++ docs/source/title/ticket.md | 10 ++ docs/source/title/title.md | 36 +++++++ docs/source/title/title.title.md | 10 ++ docs/source/title/tmd.md | 10 ++ docs/source/title/util.md | 10 ++ docs/source/title/wad.md | 10 ++ docs/source/titles/extracting-titles.md | 16 ++- src/libWiiPy/title/title.py | 30 +++--- 31 files changed, 307 insertions(+), 224 deletions(-) create mode 100644 docs/source/api.md create mode 100644 docs/source/archive/archive.md create mode 100644 docs/source/archive/ash.md create mode 100644 docs/source/archive/u8.md delete mode 100644 docs/source/libWiiPy.archive.md delete mode 100644 docs/source/libWiiPy.md delete mode 100644 docs/source/libWiiPy.nand.md delete mode 100644 docs/source/libWiiPy.title.md rename docs/source/{libWiiPy.media.md => media/banner.md} (60%) create mode 100644 docs/source/media/media.md delete mode 100644 docs/source/modules.md create mode 100644 docs/source/nand/emunand.md create mode 100644 docs/source/nand/nand.md create mode 100644 docs/source/nand/setting.md create mode 100644 docs/source/nand/sys.md create mode 100644 docs/source/title/cert.md create mode 100644 docs/source/title/commonkeys.md create mode 100644 docs/source/title/content.md create mode 100644 docs/source/title/crypto.md create mode 100644 docs/source/title/iospatcher.md create mode 100644 docs/source/title/nus.md create mode 100644 docs/source/title/ticket.md create mode 100644 docs/source/title/title.md create mode 100644 docs/source/title/title.title.md create mode 100644 docs/source/title/tmd.md create mode 100644 docs/source/title/util.md create mode 100644 docs/source/title/wad.md diff --git a/docs/source/api.md b/docs/source/api.md new file mode 100644 index 0000000..6a25d25 --- /dev/null +++ b/docs/source/api.md @@ -0,0 +1,21 @@ +# API Documentation + +libWiiPy is divided up into a few subpackages to organize related features. + +| Package | Description | +|--------------------------------------|-----------------------------------------------------------------| +| [libWiiPy.archive](/archive/archive) | Used to pack and extract archive formats used on the Wii | +| [libWiiPy.media](/media/media) | Used for parsing and manipulating media formats used on the Wii | +| [libWiiPy.nand](/nand/nand) | Used for working with EmuNANDs and core system files on the Wii | +| [libWiiPy.title](/title/title) | Used for parsing and manipulating Wii titles | + +## Full Package Contents + +```{toctree} +:maxdepth: 4 + +/archive/archive +/media/media +/nand/nand +/title/title +``` diff --git a/docs/source/archive/archive.md b/docs/source/archive/archive.md new file mode 100644 index 0000000..a1692be --- /dev/null +++ b/docs/source/archive/archive.md @@ -0,0 +1,18 @@ +# libWiiPy.archive Package + +## Modules +The `libWiiPy.archive` package contains modules for packing and extracting archive formats used by the Wii. This currently includes packing and unpacking support for U8 archives and decompression support for ASH archives. + +| Module | Description | +|--------------------------------------|---------------------------------------------------------| +| [libWiiPy.archive.ash](/archive/ash) | Provides support for decompressing ASH archives | +| [libWiiPy.archive.u8](/archive/u8) | Provides support for packing and extracting U8 archives | + +### libWiiPy.archive Package Contents + +```{toctree} +:maxdepth: 4 + +/archive/ash +/archive/u8 +``` diff --git a/docs/source/archive/ash.md b/docs/source/archive/ash.md new file mode 100644 index 0000000..56d8819 --- /dev/null +++ b/docs/source/archive/ash.md @@ -0,0 +1,10 @@ +# libWiiPy.archive.ash Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.archive.ash + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/archive/u8.md b/docs/source/archive/u8.md new file mode 100644 index 0000000..1417296 --- /dev/null +++ b/docs/source/archive/u8.md @@ -0,0 +1,10 @@ +# libWiiPy.archive.u8 Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.archive.u8 + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/conf.py b/docs/source/conf.py index 5d332bf..06c313e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,6 +11,7 @@ from datetime import date project = 'libWiiPy' copyright = f'{date.today().year}, NinjaCheetah & Contributors' author = 'NinjaCheetah & Contributors' +version = 'main' release = 'main' # -- General configuration --------------------------------------------------- diff --git a/docs/source/index.md b/docs/source/index.md index bede17e..0827c32 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -4,9 +4,11 @@ sd_hide_title: true # Overview -# libWiiPy API Docs +# libWiiPy Documentation -Welcome to the API documentation website for libWiiPy! libWiiPy is a modern Python 3 library for handling the various files and formats found on the Wii. +Welcome to the documentation website for libWiiPy! libWiiPy is a modern Python 3 library for handling the various files and formats found on the Wii. + +Just need to see the API? [libWiiPy API Documentation](/api) ```{toctree} :hidden: @@ -34,13 +36,12 @@ titles/nus-downloading.md ```{toctree} :hidden: -:caption: Other Useful Pages +:caption: More -modules.md +api.md ``` ## Indices and tables * [Full Index]() -* [Module Index]() * diff --git a/docs/source/libWiiPy.archive.md b/docs/source/libWiiPy.archive.md deleted file mode 100644 index f5b1830..0000000 --- a/docs/source/libWiiPy.archive.md +++ /dev/null @@ -1,28 +0,0 @@ -# libWiiPy.archive package - -## Submodules - -### libWiiPy.archive.ash module - -```{eval-rst} -.. automodule:: libWiiPy.archive.ash - :members: - :undoc-members: - :show-inheritance: -``` -### libWiiPy.archive.u8 module - -```{eval-rst} -.. automodule:: libWiiPy.archive.u8 - :members: - :undoc-members: - :show-inheritance: -``` -## Module contents - -```{eval-rst} -.. automodule:: libWiiPy.archive - :members: - :undoc-members: - :show-inheritance: -``` diff --git a/docs/source/libWiiPy.md b/docs/source/libWiiPy.md deleted file mode 100644 index 3e6cea9..0000000 --- a/docs/source/libWiiPy.md +++ /dev/null @@ -1,36 +0,0 @@ -# libWiiPy package - -## Subpackages - -```{toctree} -:maxdepth: 4 - -libWiiPy.archive -libWiiPy.media -libWiiPy.nand -libWiiPy.title -``` - -## Submodules - -### libWiiPy.shared module - -libWiiPy's ``shared`` module is private and contains only private functions used by other modules. - -```{eval-rst} -.. automodule:: libWiiPy.shared - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.types module - -libWiiPy's ``types`` module is private and contains only private classes used by other modules. - -```{eval-rst} -.. automodule:: libWiiPy.types - :members: - :undoc-members: - :show-inheritance: -``` diff --git a/docs/source/libWiiPy.nand.md b/docs/source/libWiiPy.nand.md deleted file mode 100644 index 8d82fb1..0000000 --- a/docs/source/libWiiPy.nand.md +++ /dev/null @@ -1,27 +0,0 @@ -# libWiiPy.nand package - -## Submodules - -### libWiiPy.nand.emunand module -```{eval-rst} -.. automodule:: libWiiPy.nand.emunand - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.nand.setting module -```{eval-rst} -.. automodule:: libWiiPy.nand.setting - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.nand.sys module -```{eval-rst} -.. automodule:: libWiiPy.nand.sys - :members: - :undoc-members: - :show-inheritance: -``` diff --git a/docs/source/libWiiPy.title.md b/docs/source/libWiiPy.title.md deleted file mode 100644 index 1cd3dc7..0000000 --- a/docs/source/libWiiPy.title.md +++ /dev/null @@ -1,99 +0,0 @@ -# libWiiPy.title package - -## Submodules - -### libWiiPy.title.cert module -```{eval-rst} -.. automodule:: libWiiPy.title.cert - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.commonkeys module -```{eval-rst} -.. automodule:: libWiiPy.title.commonkeys - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.content module -```{eval-rst} -.. automodule:: libWiiPy.title.content - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.crypto module -```{eval-rst} -.. automodule:: libWiiPy.title.crypto - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiipy.title.iospatcher module -```{eval-rst} -.. automodule:: libWiiPy.title.iospatcher - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.nus module -```{eval-rst} -.. automodule:: libWiiPy.title.nus - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.ticket module -```{eval-rst} -.. automodule:: libWiiPy.title.ticket - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.title module -```{eval-rst} -.. automodule:: libWiiPy.title.title - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.tmd module -```{eval-rst} -.. automodule:: libWiiPy.title.tmd - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.util module -```{eval-rst} -.. automodule:: libWiiPy.title.util - :members: - :undoc-members: - :show-inheritance: -``` - -### libWiiPy.title.wad module -```{eval-rst} -.. automodule:: libWiiPy.title.wad - :members: - :undoc-members: - :show-inheritance: -``` - -## Module contents -```{eval-rst} -.. automodule:: libWiiPy.title - :members: - :undoc-members: - :show-inheritance: -``` diff --git a/docs/source/libWiiPy.media.md b/docs/source/media/banner.md similarity index 60% rename from docs/source/libWiiPy.media.md rename to docs/source/media/banner.md index 77dc566..684b0db 100644 --- a/docs/source/libWiiPy.media.md +++ b/docs/source/media/banner.md @@ -1,8 +1,7 @@ -# libWiiPy.media package +# libWiiPy.media.banner Module -## Submodules +## Module Contents -### libWiiPy.media.banner module ```{eval-rst} .. automodule:: libWiiPy.media.banner :members: diff --git a/docs/source/media/media.md b/docs/source/media/media.md new file mode 100644 index 0000000..50fbbeb --- /dev/null +++ b/docs/source/media/media.md @@ -0,0 +1,16 @@ +# libWiiPy.media Package + +## Modules +The `libWiiPy.media` package contains modules used for parsing and editing media formats used by the Wii. This currently only includes limited support for parsing channel banners. + +| Module | Description | +|----------------------------------------|---------------------------------------------------| +| [libWiiPy.media.banner](/media/banner) | Provides support for basic channel banner parsing | + +### libWiiPy.media Package Contents + +```{toctree} +:maxdepth: 4 + +/media/banner +``` diff --git a/docs/source/modules.md b/docs/source/modules.md deleted file mode 100644 index 3a438a7..0000000 --- a/docs/source/modules.md +++ /dev/null @@ -1,7 +0,0 @@ -# Modules Overview - -```{toctree} -:maxdepth: 4 - -libWiiPy -``` diff --git a/docs/source/nand/emunand.md b/docs/source/nand/emunand.md new file mode 100644 index 0000000..3b85d51 --- /dev/null +++ b/docs/source/nand/emunand.md @@ -0,0 +1,10 @@ +# libWiiPy.nand.emunand Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.nand.emunand + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/nand/nand.md b/docs/source/nand/nand.md new file mode 100644 index 0000000..685c8d0 --- /dev/null +++ b/docs/source/nand/nand.md @@ -0,0 +1,20 @@ +# libWiiPy.nand Package + +## Modules +The `libWiiPy.nand` package contains modules for parsing and manipulating EmuNANDs as well as modules for parsing and editing core system files found on the Wii's NAND. + +| Module | Description | +|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------| +| [libWiiPy.nand.emunand](/nand/emunand) | Provides support for parsing, creating, and editing EmuNANDs | +| [libWiiPy.nand.setting](/nand/setting) | Provides support for parsing, creating, and editing `setting.txt`, which is used to store the console's region and serial number | +| [libWiiPy.nand.sys](/nand/sys) | Provides support for parsing, creating, and editing `uid.sys`, which is used to store a log of all titles run on a console | + +### libWiiPy.nand Package Contents + +```{toctree} +:maxdepth: 4 + +/nand/emunand +/nand/setting +/nand/sys +``` diff --git a/docs/source/nand/setting.md b/docs/source/nand/setting.md new file mode 100644 index 0000000..b833f1c --- /dev/null +++ b/docs/source/nand/setting.md @@ -0,0 +1,10 @@ +# libWiiPy.nand.setting Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.nand.setting + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/nand/sys.md b/docs/source/nand/sys.md new file mode 100644 index 0000000..d2cc45a --- /dev/null +++ b/docs/source/nand/sys.md @@ -0,0 +1,10 @@ +# libWiiPy.nand.sys Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.nand.sys + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/cert.md b/docs/source/title/cert.md new file mode 100644 index 0000000..8ad0510 --- /dev/null +++ b/docs/source/title/cert.md @@ -0,0 +1,10 @@ +# libWiiPy.title.cert Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.cert + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/commonkeys.md b/docs/source/title/commonkeys.md new file mode 100644 index 0000000..6e39ee1 --- /dev/null +++ b/docs/source/title/commonkeys.md @@ -0,0 +1,10 @@ +# libWiiPy.title.commonkeys Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.commonkeys + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/content.md b/docs/source/title/content.md new file mode 100644 index 0000000..f2807e6 --- /dev/null +++ b/docs/source/title/content.md @@ -0,0 +1,10 @@ +# libWiiPy.title.content Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.content + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/crypto.md b/docs/source/title/crypto.md new file mode 100644 index 0000000..d914ee5 --- /dev/null +++ b/docs/source/title/crypto.md @@ -0,0 +1,10 @@ +# libWiiPy.title.crypto Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.crypto + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/iospatcher.md b/docs/source/title/iospatcher.md new file mode 100644 index 0000000..35bff1e --- /dev/null +++ b/docs/source/title/iospatcher.md @@ -0,0 +1,10 @@ +# libWiiPy.title.iospatcher Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.iospatcher + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/nus.md b/docs/source/title/nus.md new file mode 100644 index 0000000..bdb876a --- /dev/null +++ b/docs/source/title/nus.md @@ -0,0 +1,10 @@ +# libWiiPy.title.nus Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.nus + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/ticket.md b/docs/source/title/ticket.md new file mode 100644 index 0000000..4ab64c5 --- /dev/null +++ b/docs/source/title/ticket.md @@ -0,0 +1,10 @@ +# libWiiPy.title.ticket Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.ticket + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/title.md b/docs/source/title/title.md new file mode 100644 index 0000000..f4e1a6a --- /dev/null +++ b/docs/source/title/title.md @@ -0,0 +1,36 @@ +# libWiiPy.title Package + +## Modules +The `libWiiPy.title` package contains modules for interacting with Wii titles. This is the most complete package in libWiiPy, and therefore offers the most functionality. + +| Module | Description | +|------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------| +| [libWiiPy.title.cert](/title/cert) | Provides support for parsing and validating the certificates used for title verification | +| [libWiiPy.title.commonkeys](/title/commonkeys) | Provides easy access to all common encryption keys | +| [libWiiPy.title.content](/title/content) | Provides support for parsing and editing content included as part of digital titles | +| [libWiiPy.title.crypto](/title/crypto) | Provides low-level cryptography functions used to handle encryption in other modules | +| [libWiiPy.title.iospatcher](/title/iospatcher) | Provides an easy interface to apply patches to IOSes | +| [libWiiPy.title.nus](/title/nus) | Provides support for downloading TMDs, Tickets, encrypted content, and the certificate chain from the Nintendo Update Servers | +| [libWiiPy.title.ticket](/title/ticket) | Provides support for parsing and editing Tickets used for content decryption | +| [libWiiPy.title.title](/title/title.title) | Provides high-level support for parsing and editing an entire title with the context of each component | +| [libWiiPy.title.tmd](/title/tmd) | Provides support for parsing and editing TMDs (Title Metadata) | +| [libWiiPy.title.util](/title/util) | Provides some simple utility functions relating to titles | +| [libWiiPy.title.wad](/title/wad) | Provides support for parsing and editing WAD files, allowing you to load each component into the other available classes | + +### libWiiPy.title Package Contents + +```{toctree} +:maxdepth: 4 + +/title/cert +/title/commonkeys +/title/content +/title/crypto +/title/iospatcher +/title/nus +/title/ticket +/title/title.title +/title/tmd +/title/util +/title/wad +``` diff --git a/docs/source/title/title.title.md b/docs/source/title/title.title.md new file mode 100644 index 0000000..0ef05fc --- /dev/null +++ b/docs/source/title/title.title.md @@ -0,0 +1,10 @@ +# libWiiPy.title.title Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.title + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/tmd.md b/docs/source/title/tmd.md new file mode 100644 index 0000000..b144afb --- /dev/null +++ b/docs/source/title/tmd.md @@ -0,0 +1,10 @@ +# libWiiPy.title.tmd Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.tmd + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/util.md b/docs/source/title/util.md new file mode 100644 index 0000000..c33fedf --- /dev/null +++ b/docs/source/title/util.md @@ -0,0 +1,10 @@ +# libWiiPy.title.util Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.util + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/title/wad.md b/docs/source/title/wad.md new file mode 100644 index 0000000..21f64d9 --- /dev/null +++ b/docs/source/title/wad.md @@ -0,0 +1,10 @@ +# libWiiPy.title.wad Module + +## Module Contents + +```{eval-rst} +.. automodule:: libWiiPy.title.wad + :members: + :undoc-members: + :show-inheritance: +``` diff --git a/docs/source/titles/extracting-titles.md b/docs/source/titles/extracting-titles.md index 6b89368..8ca6c48 100644 --- a/docs/source/titles/extracting-titles.md +++ b/docs/source/titles/extracting-titles.md @@ -34,7 +34,7 @@ And viola! We have a WAD object that we can use to get each separate part of our ## Picking the WAD Apart -Now that we have our WAD loaded, we need to separate it out into its components. On top of the parts we already established, a WAD also contains a certificate, checked by IOS during official title installations to ensure that a title was signed by Nintendo, and potentially two more areas called the footer and the CRL. Footers aren't a necessary part of a WAD, and when they do exist, they typically only contain the build timestamp and the machine it was built on. CRLs are even less common, and have never actually been found inside any WAD, but we know they exist because of things we've seen that Nintendo would really rather we hadn't. Because these three components don't have data we can edit, they're only ever represented as bytes, and do not have their own classes. +Now that we have our WAD loaded, we need to separate it out into its components. On top of the parts we already established, a WAD also contains a certificate chain, which is used by IOS during official title installations to ensure that a title was signed by Nintendo, and potentially two more areas called the footer and the CRL. Footers aren't a necessary part of a WAD, and when they do exist, they typically only contain the build timestamp and the machine it was built on. CRLs are even less common, and have never actually been found inside any WAD, but we know they exist because of things we've seen that Nintendo would really rather we hadn't. Certificate chains also have a class that we'll cover after the main three components, but the latter two components don't have data we can edit, so they're only ever represented as bytes and do not have their own classes. ### The TMD @@ -110,11 +110,19 @@ Now that we know things are working, why don't we speed things up a little by us And just like that, we have our TMD, Ticket, and decrypted content all extracted! From here, what you do with them is up to you and whatever program you're working on. For example, to make a simple WAD extractor, you may want to write all these files to an output directory. +### The Certificate Chain + +As mentioned at the start of this guide, WADs also contain a certificate chain. We don't necessarily need this data right now, but getting it is very similar to the other components: +```pycon +>>> certificate_chain = libWiiPy.title.CertificateChain() +>>> certificate_chain.load(wad.get_cert_data()) +>>> +``` + ### The Other Data -As mentioned earlier in this guide, WADs also contain up to three extra regions of data: the certificate, the footer, and the CRL. The procedure for extracting all of these is pretty simple, and follows the same formula as any other data in a WAD: +Also mentioned earlier in this guide, WADs may contain two additional regions of data know as the footer (or "meta"), and the CRL. The procedure for extracting all of these is pretty simple, and follows the same formula as any other data in a WAD: ```pycon ->>> certificate = wad.get_cert_data() >>> footer = wad.get_meta_data() >>> crl = wad.get_crl_data() >>> @@ -123,7 +131,7 @@ As mentioned earlier in this guide, WADs also contain up to three extra regions Beyond getting their raw data, there isn't anything you can directly do with these components with libWiiPy. If one of these components doesn't exist, libWiiPy will simply return an empty bytes object. :::{note} -Managed to find a WAD somewhere with CRL data? I'd love to here more, so feel free to email me at [ninjacheetah@ncxprogramming.com](mailto:ninjacheetah@ncxprogramming.com). +Managed to find a WAD somewhere with CRL data? I'd love to hear more, so feel free to email me at [ninjacheetah@ncxprogramming.com](mailto:ninjacheetah@ncxprogramming.com). :::
diff --git a/src/libWiiPy/title/title.py b/src/libWiiPy/title/title.py index c93e510..90b4cab 100644 --- a/src/libWiiPy/title/title.py +++ b/src/libWiiPy/title/title.py @@ -4,11 +4,11 @@ # See https://wiibrew.org/wiki/Title for details about how titles are formatted import math -from .cert import CertificateChain -from .content import ContentRegion -from .ticket import Ticket -from .tmd import TMD -from .wad import WAD +from .cert import CertificateChain as _CertificateChain +from .content import ContentRegion as _ContentRegion +from .ticket import Ticket as _Ticket +from .tmd import TMD as _TMD +from .wad import WAD as _WAD from .crypto import encrypt_title_key @@ -32,11 +32,11 @@ class Title: A ContentRegion object containing the title's contents. """ def __init__(self): - self.wad: WAD = WAD() - self.cert_chain: CertificateChain = CertificateChain() - self.tmd: TMD = TMD() - self.ticket: Ticket = Ticket() - self.content: ContentRegion = ContentRegion() + self.wad: _WAD = _WAD() + self.cert_chain: _CertificateChain = _CertificateChain() + self.tmd: _TMD = _TMD() + self.ticket: _Ticket = _Ticket() + self.content: _ContentRegion = _ContentRegion() def load_wad(self, wad: bytes) -> None: """ @@ -49,19 +49,19 @@ class Title: The data for the WAD you wish to load. """ # Create a new WAD object based on the WAD data provided. - self.wad = WAD() + self.wad = _WAD() self.wad.load(wad) # Load the certificate chain. - self.cert_chain = CertificateChain() + self.cert_chain = _CertificateChain() self.cert_chain.load(self.wad.get_cert_data()) # Load the TMD. - self.tmd = TMD() + self.tmd = _TMD() self.tmd.load(self.wad.get_tmd_data()) # Load the ticket. - self.ticket = Ticket() + self.ticket = _Ticket() self.ticket.load(self.wad.get_ticket_data()) # Load the content. - self.content = ContentRegion() + self.content = _ContentRegion() self.content.load(self.wad.get_content_data(), self.tmd.content_records) # Ensure that the Title IDs of the TMD and Ticket match before doing anything else. If they don't, throw an # error because clearly something strange has gone on with the WAD and editing it probably won't work.