* Added functions to deal with title info and application metadata reallocations, greatly reducing the number of references to realloc() throughout the code.
* Tweaked gamecardGetHashFileSystemContext() to not return a pointer to a dynamic context.
* Added a type field to Hash FS contexts.
* usb: copy command ID and block size before moving command data within the USB transfer buffer.
* nsp_dumper_usb: now spans a background thread for the dump process, progress is now displayed, process can now be cancelled by holding B, updated to properly make use of the new usbCancelFileTransfer() behavior.
* usb_gc_dumper: updated to properly make use of the new usbCancelFileTransfer() behavior.
* usb_romfs_dumper: updated to properly make use of the new usbCancelFileTransfer() behavior.
* Updated ns-usbloader patch. Must be used on commit `8771d551a4e6fa2d645e519d504a377e34cbd730`.
* Temporarily changed tracked libusbhsfs branch from main to dev.
* Minor improvements in ums.c/h.
* Refactored nsp_dumper_sd into nsp_dumper_stor - now capable of dumping NSPs to a mounted partition from a UMS device.
* Fixed utilsWaitForButtonPress() when no button mask is provided.
* Refactored utilsGetFreeSpaceFromFileSystemByPath() into utilsGetFileSystemStatsByPath().
* 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.
* Cancel USB file transfer if something goes wrong during a NSP transfer via USB.
* Added SD card RomFS dumper.
* Further optimizations to the *WriteNcaPatch() functions.
* Change struct naming in nso.c/h (thanks @0Liam !).
* Replace fsp-usb with libusbhsfs. ( ͡° ͜ʖ ͡°)
* Fixed possible invalid memory accesses using TitleInfo pointers from gamecard titles if the gamecard they belong to is taken out.
* Fixed invalid for loop condition in _titleGetInfoFromStorageByTitleId() if no gamecard titles have been retrieved.
* 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.
* 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.
* 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.
* 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.
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.
XML generation confirmed to be working. The new algorithm faithfully reproduces the same output from legacy nxdumptool with much less overhead and memory usage.
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.
Key area and certificate can be optionally appended and/or preserved, respectively. Trimming is supported.
Also added a bunch of ZLT packet related fixes to usb.c, as well as a function to properly cancel an ongoing file transfer.