1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-08 19:52:12 +00:00
Commit graph

34 commits

Author SHA1 Message Date
Pablo Curiel
fb58d20fe3 I'm a terrible person and an even worse developer.
And I don't need anyone to tell me so, thank you very much.

* PoC: remove gc_dumper and nsp_dumper PoC; create nxdt_rw_poc with all gc_dumper and nsp_dumper capabilities + standalone ticket dumping + raw NCA dumping; use ftruncate() to set output file sizes whenever possible. PoC code is a mess, as always. Expect the features from the rest of the PoCs to be implemented into nxdt_rw_poc soon.

* workflow: temporarily disable borealis build generation; comment out manual installation of up-to-date packages from Leseratte's mirrors because the latest devkitA64 Docker image has them all.

* borealis: update to fix building issues with latest devkitA64.

* bfttf: error out on invalid NCA signatures.

* config: save configuration to the current working directory; parse and validate new "gamecard/write_raw_hfs_partition" flag.

* defines: remove CONFIG_PATH macro; rename CONFIG_FILE_NAME.

* gamecard: rename fs_ctx -> hfs_ctx everywhere; use HFS function calls to retrieve partition names.

* hfs: move GameCardHashFileSystemPartitionType enum from gamecard.h and rename it to HashFileSystemPartitionType; add hfsIsValidContext(); add hfsGetPartitionNameString().

* nca/npdm: update comments to reflect latest HOS version.

* nxdt_bfsar: always generate absolute SD card paths with the device name; error out on an invalid NCA signature.

* nxdt_includes: include dirent.h; refactor Version struct to make it a union of all known *Version structs.

* nxdt_log: don't write session separator if the logfile is empty.

* nxdt_utils: log appletIsGamePlayRecordingSupported() errors; add utilsDeleteDirectoryRecursively().

* rsa: provide clearer function descriptions in header file.

* services: handle usb:ds initialization.

* tik: update tikConvertPersonalizedTicketToCommonTicket() to allow NULL input pointers as raw certificate chain arguments (much needed for standalone ticket dumping).

* title: add titleGetApplicationIdByMetaKey().

* usb: refactor interface (de)initialization code; slightly improve ABI usage (console-side only); redefine ABI version field in StartSession command blocks; upgrade ABI to v1.1.

* FatFs: rename DIR -> FDIR to avoid conflicts with definitions from stdlib's dirent.h.

* gamecard_tab: display package ID from the inserted gamecard; fix displayed version numbers from bundled system updates below 3.0.0.

* todo: add notes about creating devoptab devices for HFS/PFS/RomFS file tree dumping.
2023-05-24 21:05:34 +02:00
Pablo Curiel
9a4b8b573d Update copyright year 2023-04-08 13:42:22 +02:00
Pablo Curiel
d8c0984115 romfs: slightly improve interface. 2022-07-06 11:57:31 +02:00
Pablo Curiel
942a407247 Codebase cleanup.
Remove legacy code and trailing whitespace from all files.
2022-07-05 03:04:28 +02:00
Pablo Curiel
91dc20b7f3 Fix some issues + update PoCs.
ncaStorageSetPatchOriginalSubStorage: allow Patch title version to be equal to the Base title version (e.g. sparse titles).

ncaStorageGetHashTargetExtents: actually set proper storage extents.

bktrGetTreeNodeEntryIndex: fix index lookup algorithm.

bktrStorageNodeFind: fix binary search.

bktrVisitorMoveNext / bktrVisitorMovePrevious: fix integer overflows.
2022-07-05 01:25:28 +02:00
Pablo Curiel
8b0ed76011 Fix bugs + improve bktr interface.
* Check for sparse layers in nsp_dumper and xml_generator PoCs before attempting to initialize content-type-specific contexts.

* system_title_dumper now builds.

* gamecardCloseStorageArea() no longer returns prematurely on application exit.

* Fix section size for sparse sections in ncaInitializeFsSectionContext().

* Fix ncaFsSectionValidateHashDataBoundaries().

* Implement bktrInitializeIndirectStorage() and bktrInitializeAesCtrExStorage().
2022-06-29 14:41:58 +02:00
Pablo Curiel
590495d012 bktr: added ID offset and title version checks. 2022-06-29 09:55:46 +02:00
Pablo Curiel
fabb15bbe4 Fix home button exit on all PoCs. 2022-02-19 06:03:06 +01:00
Pablo Curiel
cd300fe149 Fix PoC building. 2021-09-04 00:17:17 -04:00
Pablo Curiel
230e3d2cee PoC: fix building + implement AuthoringTool data option. 2021-08-03 02:37:04 -04:00
Pablo Curiel
04abb342bb Small code refactor (part 3).
* Both gamecard header and decrypted CardInfo area are now retrieved upon gamecard insertion. LAFW version is checked against the CardInfo LAFW version right afterwards.

* Expanded GameCardStatus enum to add NoGameCardPatchEnabled and LotusAsicFirmwareUpdateRequired values.

* Updated utilsReplaceIllegalCharacters() to perform replacements on a per-codepoint basis, which means that invalid multibyte UTF-8 codepoints can now be replaced with a single ASCII underscore.

* Updated utilsGeneratePath() to truncate path elements that exceed 255 UTF-8 codepoints (safe limit for FAT and NTFS filesystems).

* Heavily simplified core logic in title functions by using newly defined TitleStorage elements (which hold the NCM database/storage handles, a TitleInfo array and a title counter) instead of the old, global index-based methods.

* Simplified background gamecard title thread logic by always returning duplicated TitleInfo data to the user.

* Update title API to account for the previously mentioned changes, including functions to free duplicated title data.

* Fallback gamecard filename string now also holds the gamecard package ID whenever possible.

* Implemented HDCP patching for Control NCAs.
2021-05-31 21:12:15 -04:00
Pablo Curiel
f82d7a3db4 Small code refactor (part 2).
* Rewrote mutex handling throughout the code to use a small, macro-based scoped lock implementation.

* Removed extern variables from common.h - launch path management is now completely handled in utils.c.

* Updated NpdmSystemCallId_Count to reflect changes introduced in 12.0.0.

* Added NcaMainSignatureKeyGeneration enum.

* NCA main signature moduli are now retrieved from FS .rodata at runtime.

* Simplified lock management in usb.c by using a single global mutex with scoped locks instead of three different r/w locks.

* Updated FatFs to R0.14b.

* Enabled 64-bit LBA support in FatFs to potentially support custom eMMC replacements / resized USER partitions in the future.

* Updated LZ4 to v1.9.3.

* Fixed typos.

* USB gamecard dumper PoC now only dumps the Initial Data area.

* Updated to-do list.
2021-05-18 08:32:43 -04:00
Pablo Curiel
85f146f50c Add uppercase hex string generation to utilsGenerateHexStringFromData(). 2021-05-11 18:36:15 -04:00
Pablo Curiel
17dd24bc92 Modified NCA key area handling + restored PoC building.
* Avoid performing any crypto operations on null NCA key area entries.

* Added commented out code to handle the aes_ctr_ex NCA key area entry, just in case we end up needing it at some point.
2021-04-25 19:10:34 -04:00
Pablo Curiel
11da814fb2 Fix building issues with Borealis. 2021-03-26 00:35:14 -04:00
Pablo Curiel
c6c5667bf0 Change project layout + upgrade license to GPLv3. 2021-03-25 15:26:58 -04:00
Pablo Curiel
8be5460229 Store last log message using a small stack buffer.
Will be used to print error messages down the road.
2021-03-08 10:44:11 -04:00
Pablo Curiel
43f744326f Minor fixes.
* The new logfile handler should now work properly.

* A UTF-8 BOM is now written at the start of every new logfile.
2021-03-08 07:11:28 -04:00
Pablo Curiel
c29f994b35 Support for HOS 11.0.0.
* Updated hardcoded system title list to match HOS 11.0.0.
* Updated NcaKeyGeneration_Current.
* Updated button input handling to match the new pad API from libnx.
2020-12-04 02:38:44 -04:00
Pablo Curiel
477c321773 Remove unnecessary code.
libusbhsfs doesn't return FsFileSystem objects, that's why.
2020-11-21 06:29:29 -04:00
Pablo Curiel
7e2aa976b4 Rename KEY_NONE definition. 2020-10-22 16:13:00 -04:00
Pablo Curiel
6f4cb98033 Cleanup startup logfile messages. 2020-10-14 19:08:01 -04:00
Pablo Curiel
e6bb15d608 Implemented BFTTF font loading and decoding.
Some people may call me a madman but I don't want to see any more nxdumptool screenshots with a Disney-like font. *war flashbacks*
2020-10-14 09:23:49 -04:00
Pablo Curiel
ba4fdcd01c Code cleanup.
* Added 'encrypted_header' members to both NcaContext and NcaFsSectionContext. In-place re-encryption isn't desirable in this case.
* Fixed FsAccessControl-related type naming for ACI0 blocks.
2020-10-13 10:00:03 -04:00
Pablo Curiel
40fc21b5a3 Fix ProgramInfo and NSO issues.
XML generation confirmed to be working. The new algorithm faithfully reproduces the same output from legacy nxdumptool with much less overhead and memory usage.
2020-10-11 20:40:54 -04:00
Pablo Curiel
1de967ed42 NSO structs (thanks 0Liam). 2020-10-10 11:35:14 -04:00
Pablo Curiel
3e59d15bc4 Minor template tweaks + LegalInfo fix. 2020-10-10 06:10:50 -04:00
Pablo Curiel
fa1b9c70a5 NCA changes. 2020-10-02 22:37:05 -04:00
Pablo Curiel
98b7a309b3 CNMT AuthoringTool-like XML generation. 2020-10-02 05:53:58 -04:00
Pablo Curiel
6e32829cf1 CNMT parsing. 2020-10-01 02:17:59 -04:00
Pablo Curiel
e26637125b Add slightly better scrolling + title counter. 2020-08-03 17:41:00 -04:00
Pablo Curiel
3105540c99 Block HOME button presses during dumping operations in code templates. 2020-08-03 14:13:24 -04:00
Pablo Curiel
ca333bd71d Missing fs commit changes. 2020-08-01 00:52:40 -04:00
Pablo Curiel
7c4e7a4db0 New test app: system title NCA section dumper. 2020-07-29 17:02:21 -04:00