1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-10 04:31:44 +00:00
Commit graph

149 commits

Author SHA1 Message Date
Pablo Curiel
974790944f More changes.
* Added NSP dumper PoC (SD card only atm, single-threaded).
* Cert: replaced a wrong strcmp() with a proper strncmp().
* CNMT: added functions to update content info entries and generate/write Partition FS patches.
* NCA: encrypt key area right after removing titlekey crypto.
* NPDM/ProgramInfo: changed function names.
* NPDM: check if the NCA has been modified before attempting to patch ACID data + calculate RSA-PSS signature *after* generating the PFS patch, not before. lol
* PFS: restore name table size value before writing the header padding.
* Tik: reworked the ticket lookup algorithm. Now uses information from ticket_list.bin to properly calculate the offset to the requested ticket in ticket.bin.
* Title: changed title type strings used for filename generation.
* Updated to-do list.
2020-10-22 00:38:14 -04:00
Pablo Curiel
15431ec2c8 Many changes.
* AES: moved CTR initializing/updating functions here from nca.c.
* BKTR/RomFS/PFS: check if we're dealing with a NCA with titlekey crypto and the titlekey hasn't been retrieved.
* BFTTF: use void pointers for output font data.
* Mem: Only exclude Unmapped/Uo/ThreadLocal/Reserved memory pages if dealing with FS.
* NCA: use content type context pointers inside NCA contexts to manage ContentMeta, ProgramInfo, Nacp and LegalInfo contexts.
* NCA: added 'written' bool elements to patch structs to indicate patch write completion.
* NPDM: remove unnecessary inline functions, generate PFS patch right after changing ACID data, add a pfsWriteEntryPatchToMemoryBuffer wrapper.
* PFS: added PartitionFileSystemFileContext and related functions to deal with NSP headers.
* ProgramInfo: removed unnecessary inline functions.
* Save: added commented code to dump a full system savefile - will probably use it down the road.
* Tik: added support for volatile tickets (thanks to @shchmue and @Whovian9369!), added a rights ID string representation to the Ticket struct, clear Volatile and ELicenseRequired flags in conversions to common tickets.
* Title: added a function to calculate the number of titles (current + siblings) from a TItleInfo block.
* Utils: added a function to generate a dynamically allocated path string using a prefix, a filename and a extension.
* Removed explicit offset checks throughout all the code.
* Codestyle fixes.
* Updated to-do.
2020-10-21 00:27:48 -04:00
Pablo Curiel
bd98fd4c32 Replace unnecessary strlen() calls with pointer dereferences or calculations using info available at runtime (when possible).
This should probably improve performance a little bit in certain sections.
2020-10-14 20:06:53 -04:00
Pablo Curiel
6f4cb98033 Cleanup startup logfile messages. 2020-10-14 19:08:01 -04:00
Pablo Curiel
5b22fe07f2 More code cleanup. 2020-10-14 14:58:33 -04:00
Pablo Curiel
13efdb6074 Update bfttf.h 2020-10-14 09:24:56 -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
44965430b3 Even more code cleanup.
* Added a function to write re-encrypted NCA and/or FS section headers. Getting ready to re-implement NSP dumping.
* Added more CNMT XML fields (thanks 0Liam).
* Updated my to-do list because I'm dummy.
2020-10-13 20:15:21 -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
3ab65d8dca Fix support for CNMTs with no ContentInfo entries. 2020-10-12 22:46:59 -04:00
Pablo Curiel
ebd97d7c82 Add FsAccessControlData to ProgramInfo XML.
Also:

* Fixed support for NSOs with invalid module_name, api_info, dynstr and/or dynsym offsets/sizes.
* Updated the XML generator example to generate XML data for all available NCAs, regardless of their ID offset values.
2020-10-12 16:35:47 -04:00
Pablo Curiel
84f651eae8 Further improvements to the ProgramInfo XML generation code. 2020-10-12 12:02:44 -04:00
Pablo Curiel
7059bacfce Improved ProgramInfo XML generation.
Also added some additional fields. Thanks to 0Liam.
2020-10-12 00:59:50 -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
3affe1f4d0 ProgramInfo AuthoringTool-like XML generation.
Untested. Completely reworked both Middleware and ELF symbol parsing from NSOs.
2020-10-11 15:55:01 -04:00
Pablo Curiel
495e331306 Fix support for NSOs without a valid .api_info section + ProgramInfo context.
ProgramInfo XML generation is still missing. Getting real close to reimplementing NSP dumping.
2020-10-11 14:13:09 -04:00
Pablo Curiel
f45d1a21b5 Verify decompressed .rodata segment hash. 2020-10-11 13:23:58 -04:00
Pablo Curiel
e3e6552c4e NSO context.
Also updated LZ4 to latest stable release to allow for in-place decompression.
2020-10-11 11:22:26 -04:00
Pablo Curiel
62945728c7 Fix wrong NCA ACID signature area size. 2020-10-10 17:12:35 -04:00
Pablo Curiel
9f010c4129 NPDM ACID public key replacement + NCA ACID signature recalculation. 2020-10-10 17:08:17 -04:00
Pablo Curiel
2066b11d5a NPDM context. 2020-10-10 15:29:14 -04:00
Pablo Curiel
dcbedbf13a Remove homebrew-only NSO extensions. 2020-10-10 11:38:06 -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
d1f0361725 Update NPDM structs (thanks to 0Liam) + LegalInformation XML retrieval.
From now on, I'll delete code from the legacy codebase directory as soon as specific features from it are rewritten... Because it's a mess to navigate.
2020-10-09 05:58:53 -04:00
Pablo Curiel
4425666395 NPDM support (part 1).
Only added header file with structs and enums. Actual functions come next but I'm tired atm.
2020-10-08 17:52:31 -04:00
Pablo Curiel
1c15a096b5 Codestyle fixes + prepare code for NPDM support. 2020-10-08 14:31:09 -04:00
Pablo Curiel
e943e84380 Unified XML generator + finished NACP parsing.
Big thanks to 0Liam.
2020-10-06 11:41:26 -04:00
Pablo Curiel
2859f26cb3 NACP: add NeighborDetectionClientConfiguration and RequiredAddOnContentsSetBinaryDescriptor to XML generation.
This is tentative. I need to look into how these fields are really parsed / appended to the XML.
2020-10-06 02:00:18 -04:00
Pablo Curiel
7573c53457 Fix silly bug in titleGetNcmContentMetaTypeName. 2020-10-04 06:40:56 -04:00
Pablo Curiel
afa99ba445 Added info about XCI header keys. 2020-10-04 05:25:42 -04:00
Pablo Curiel
1e41148c02 NACP parsing (part 2).
NeighborDetectionClientConfiguration and RequiredAddOnContentsSetBinaryDescriptor haven't been implemented (yet).
2020-10-04 03:05:05 -04:00
Pablo Curiel
d385d40862 NACP parsing (part 1).
God, I'm so tired. I'll go play some good old MGS3 and continue this stuff at a later time. It builds, though.
2020-10-03 13:09:29 -04:00
Pablo Curiel
fa1b9c70a5 NCA changes. 2020-10-02 22:37:05 -04:00
Pablo Curiel
d440d88bbe CNTM: type name consistence. 2020-10-02 06:28:41 -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
97d9603e93 BKTR: add support for games with base Program NCAs without a RomFS section. 2020-09-26 06:49:18 -04:00
Pablo Curiel
1a6f2ee50c Rename some reserved fields. 2020-09-24 13:03:26 -04:00
Pablo Curiel
38f19351a9 Add build script. 2020-09-22 21:13:39 -04:00
Pablo Curiel
083874bd4e Fix unaligned reads from the gamecard secure storage area.
Big thanks to Whovian for finding the bug and testing the change.
2020-09-19 06:21:23 -04:00
Pablo Curiel
b806c2e7d0 Support multi-program titles in the RomFS dumper. 2020-09-19 02:59:31 -04:00
Pablo Curiel
01ff151946 Update fs_ext.h 2020-09-18 23:18:32 -04:00
Pablo Curiel
679aa170b5 Some small changes.
* tik: check for common certificate availability before attempting to convert a personalized ticket to a common one. The raw common certificate chain data for the ticket signature issuer is now returned.

* usb: skip waitMulti call in the USB background thread if an invalid endpoint max packet size was received from the USB host in the previous while loop iteration.
2020-08-27 15:18:31 -04:00
Pablo Curiel
d6cdfe5c06 Perform title sorting at startup and in the background gamecard title info thread, not while retrieving data using non-static functions.
Orphan titles are now sorted by title ID.
2020-08-20 20:18:05 -04:00
Pablo Curiel
a19d3f2338 Ditched C threads in favor of libnx threads.
Preemptive multithreading is still used, just like libnx's newlib implementation.

Also changed the version number because the rewrite deserves it.
2020-08-18 01:04:13 -04:00
Pablo Curiel
1e50cec315 Update usb.c 2020-08-17 17:31:24 -04:00
Pablo Curiel
dfa425790a Get endpoint max packet size from USB host to properly enable ZLT packets when needed.
Also updated the diff patch for ns-usbloader.
2020-08-17 17:30:47 -04:00
Pablo Curiel
f724eaa9a9 Update utils.c 2020-08-15 17:25:40 -04:00
Pablo Curiel
6b8b3184ac Fixes for development units + diff patch for ns-usbloader.
Big thanks to ZachyCatGames.
2020-08-15 17:22:49 -04:00