1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-13 22:16:45 +00:00
Commit graph

19 commits

Author SHA1 Message Date
Pablo Curiel
d402776032 Custom devoptab wrappers (part 1).
This commit implements a devoptab wrapper for Partition FS sections within NCAs, using code from pfs.c/h.

Other changes include:

* codebase: use NX_IGNORE_ARG macro where needed.

* hfs: slight tweaks to some of the static functions.

* pfs: slight tweaks to some of the static functions.
* pfs: use pfsIsValidContext() where needed.

* utils: update utilsInitializeResources() to use __system_argc and __system_argv variables from libnx.

* todo: update text file.
2023-12-20 20:32:48 +01:00
Pablo Curiel
98ed7d1c29 poc: cancel USB xfer on NSP dump error. 2023-11-11 12:16:29 +01:00
Pablo Curiel
e1df86fb27 Fix building with latest libnx + QoL changes.
libnx now implements fsDeviceOperatorGetGameCardIdSet(), so I got rid of my own implementation.

Other changes include:

* cnmt: add cnmtVerifyContentHash().

* defines: add SHA256_HASH_STR_SIZE.

* fs_ext: add FsCardId1MakerCode, FsCardId1MemoryType and FsCardId2CardType enums.
* fs_ext: update FsCardId* structs.

* gamecard: change all package_id definitions from u64 -> u8[0x8].
* gamecard: fix misleading struct member names in GameCardHeader.
* gamecard: rename gamecardGetIdSet() -> gamecardGetCardIdSet().

* gamecard_tab: fix Package ID printing.
* gamecard_tab: add Card ID Set printing.

* host: add executable flag to Python scripts.

* keys: detect if we're dealing with a wiped eTicket RSA device key (e.g. via set:cal blanking). If so, the application will still launch, but all operations related to personalized titlekey crypto are disabled.

* pfs: rename PartitionFileSystemFileContext -> PartitionFileSystemImageContext and propagate the change throughout the codebase.
* pfs: rename PFS_FULL_HEADER_ALIGNMENT -> PFS_HEADER_PADDING_ALIGNMENT and update pfsWriteImageContextHeaderToMemoryBuffer() accordingly.

* poc: print certain button prompts with reversed colors, in the hopes of getting the user's attention.
* poc: NSP, Ticket and NCA submenus for updates and DLC updates now display the highest available title by default.
* poc: simplified output path generation for extracted NCA FS section dumps.
* poc: handle edge cases where a specific NCA from an update has no matching equivalent by type/ID offset in its base title (e.g. Fall Guys' HtmlDocument NCA).
* poc: implement NCA checksum validation while generating NSP dumps.

* romfs: update romfsInitializeContext() to allow its base_nca_fs_ctx argument to be NULL.

* usb: use USB_BOS_SIZE only once.

* workflow: update commit hash referenced by "rewrite-prerelease" tag on update.
2023-11-03 02:22:47 +01:00
Pablo Curiel
c474435ea8 nca_storage: set original substorage while initializing a patch NCA storage.
ncaStorageInitializeContext() now takes an extra input argument. ncaStorageSetPatchOriginalSubStorage() is now a static function that's only used internally.

Fixes issues with "AKIBA'S TRIP: Undead & Undressed Director's Cut" compressed storage initialization while using an update. Big thanks to @Arch9SK7 for reporting the issue.
2023-09-24 18:41:39 +02:00
Pablo Curiel
bafe23b14e poc: implement PFS dumping (user titles only).
Other changes include:

* nca: add title_id and title_type fields to NcaContext; redefine title_version field in NcaContext; redefine ncaInitializeContext() function signature (now requiring NcmContentMetaKey and NcmContentInfo objects); modify ncaInitializeFsSectionContext() to make it skip extra boundary checks on FS sections with a bogus sparse storage.

* config: rename "nsp/write_section_image" flag to "nsp/write_raw_section".

* nxdt_utils: modify utilsGeneratePath() to make it also check if the first character from the filename is a slash.

* pfs: modify pfsGetEntryIndexByName() to only log an error if the entry name being looked up isn't "main.npdm".
2023-05-30 01:22:12 +02:00
Pablo Curiel
9a4b8b573d Update copyright year 2023-04-08 13:42:22 +02:00
Pablo Curiel
7bb708e394 Many small changes (sorry, I need to push these).
* Use forward declarations for type definitions wherever suitable (e.g. NcaContext, BucketTreeContext).
* Replace references to "DumpDestination" with "OutputStorage".
* Replace references to "append key area" with "prepend key area".
* Update LZ4 to v1.9.4.
* Update Material Icons font to 2022-08-01.
* RootView: change USB-related icons, reflect how many UMS devices are currently connected to the console, provide a way for child views to retrieve the populated UMS devices vector.
* Tasks: implement GetUmsDevices().
* Update borealis.
* Update libusbhsfs.
* Begin implementation of a DumpOptionsFrame class to display configurable options before starting a new dump process.
* bktr: rename bktrIsValidSubstorage() to bktrIsValidSubStorage(), use bktrIsValidSubStorage() in bktrInitializeCompressedStorageContext(), fixed a bug in bktrReadCompressedStorage() where Sparse substorages wouldn't be allowed.
* GamecardTab: push a DumpOptionsFrame object onto the view stack if the XCI option is clicked.
2022-09-12 20:19:10 +02:00
Pablo Curiel
5cc83491c1 Use verbosity-level-based log macros everywhere.
Also, Result codes are now just printed using %X.
2022-07-12 18:34:49 +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
de6eb1a7e8 romfs: add support for Patch RomFS.
Uses the new NCA storage interface.

Also implemented ncaStorageGetHashTargetExtents().
2022-07-04 14:30:48 +02:00
Pablo Curiel
aad7af702f Fix some minor issues. 2022-07-04 02:20:51 +02:00
Pablo Curiel
8ac190686f romfs: use new NCA storage interface. 2022-07-04 02:01:12 +02:00
Pablo Curiel
c2a8f025b3 pfs: use new NCA storage interface. 2022-07-04 01:36:01 +02:00
Pablo Curiel
4507af9e34 Add missing sparse layer checks to pfs/romfs. 2022-06-29 10:41:23 +02:00
Pablo Curiel
c1e3dc719f More NCA changes.
* Made ncaGenerateEncryptedFsSectionBlock() entirely private. There's no point in keeping it public.

* Moved NCA FS section context initialization into its own function, ncaInitializeFsSectionContext().

* Hash data boundaries are now checked while initializing each NCA FS section context, using ncaFsSectionValidateHashDataBoundaries(). Both ncaValidateHierarchicalSha256Offsets() and ncaValidateHierarchicalIntegrityOffsets() have been removed.

* Improved hash region access detection in _ncaReadFsSection() by implementing ncaFsSectionCheckHashRegionAccess().

* ncaGetFsSectionHashTargetProperties() is now used in pfs.c, romfs.c and bktr.c to retrieve the properties from the target hash layer.

* Updated sanity checks in pfsInitializeContext(), romfsInitializeContext() and bktrInitializeContext().
2022-06-29 08:55:35 +02:00
Pablo Curiel
e0cf57d8a5 nca: SparseInfo support (part 2).
Handle the has_sparse_flag wherever needed.
2022-03-21 03:19:39 +01:00
Pablo Curiel
2fa61dc228 Update copyright year. 2022-03-17 13:58:40 +01: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
Renamed from source/pfs.c (Browse further)