Commit graph

627 commits

Author SHA1 Message Date
Alex Barney
5a15118706 Use Aes128CtrTransform in DecryptRsaKey 2018-12-09 18:31:53 -06:00
Alex Barney
ac6d528a30 Make StorageStream check the read/write status of base Storages 2018-12-09 18:31:53 -06:00
Alex Barney
da9ecaec98 Fix build not detecting dotnet version 2018-12-09 14:47:14 -06:00
Alex Barney
bb14125542
Add build script (#20) 2018-11-21 22:57:18 -05:00
Alex Barney
3d50085e22
Use Storage throughout the library instead of Stream (#18)
*Create an IStorage interface and Storage abstract class to use instead of Stream

* Improve AES-XTS performance by ~16x

* Double AES-CTR performance: 800 MB/s -> 1600 MB/s on a 6700K

* Add AES-XTS tests

* Add AES benchmark and AES-CTR writing

* Add support for a hashed FAT in save files

* Add option to export decrypted NCA

* Allow opening decrypted package1 and package2

* Make sure romfs disposal can cascade all the way down

* Validate NCA, NPDM and package2 signatures
2018-11-18 23:20:34 -05:00
jonnysp
f20fac5459 Npdm Support (#15)
* Npdm Support

from Ryujinx with adjustments

* move to namespace

* all classes public

* read the nacp as Stream & add Language to the descriptions

* better naming & fix binary reader

* Tweak formatting and naming
2018-11-03 11:38:54 -06:00
Alex Barney
92d0a2e6c2 Version 0.1.3 2018-10-22 18:00:52 -05:00
Alex Barney
0abd48cfb5 Print key info in MissingKeyException message 2018-10-22 17:59:02 -05:00
Alex Barney
8c934e51c7
Merge pull request #16 from Thealexbarney/save-additions
Add save file writing and improvements
2018-10-22 14:58:00 -06:00
Alex Barney
e9f7556635 Ensure the save header is flushed when committing 2018-10-22 12:51:30 -05:00
Alex Barney
7a7946a26c Add Savefile.CommitHeader method 2018-10-18 18:18:39 -05:00
Alex Barney
f83a284b96 Add verification option to save files 2018-10-18 17:54:24 -05:00
Alex Barney
f8e7c00ef4 Tweak how IVFC validation is done 2018-10-18 16:10:51 -05:00
Alex Barney
da5eec1b3d Writing for all save file layers 2018-10-17 17:15:57 -05:00
Alex Barney
c0393449f1 IVFS writing 2018-10-16 15:01:16 -05:00
Alex Barney
0eaefba071 Make SaveFs writable 2018-10-15 21:17:53 -05:00
Alex Barney
4a43c330b6 Add RemapStorage class 2018-10-15 20:53:49 -05:00
Alex Barney
75cb28364f Create SaveFs class 2018-10-14 19:23:18 -05:00
Alex Barney
6935983b71 Add Seek to AllocationTableStream 2018-10-14 18:00:46 -05:00
Alex Barney
ae649182ce Rename "Savefile" namespace to "Save" 2018-10-13 15:12:10 -05:00
Alex Barney
a27c9f78c7
Merge pull request #13 from Thealexbarney/nca
- Read only the NCA header when first opening an NCA. This allows for reading of partial NCAs and slightly improves performance when opening an NCA.
- Add a separate NCA method to validate master hashes now that it's not automatically done when opening the NCA.
- Fix possible hang when reading BKTR sections.
- When keys required to decrypt an NCA are missing, throw an exception with information about the missing keys.
- Add more sanity checks when reading an NCA.
- Add a cache to prevent validation an IntegrityVerificationStream block twice.
- Add section validation for all hashed NCA sections
- Fix a bug in ConbinationStream when reading across boundaries
- Add option to verify NCAs in a SwitchFS or SD card
- Don't error if the an patch NCA's base NCA has no RomFS
2018-10-12 20:32:07 -06:00
Alex Barney
e9602d35da Modify check for ExeFS NCA sections 2018-10-12 21:28:05 -05:00
Alex Barney
75dafd9cbe Remove old classes 2018-10-12 21:08:16 -05:00
Alex Barney
e1b9f9b935 Don't error if the a patch's base has no RomFS 2018-10-12 18:07:46 -05:00
Alex Barney
6213111af9 Add option to verify SwitchFS and SD cards 2018-10-12 17:52:15 -05:00
Alex Barney
e21c384a9c Fix bug in ConbinationStream when reading across boundaries 2018-10-12 16:51:09 -05:00
Alex Barney
fb089b0700 Integrity verification improvements
- Add a cache to prevent validation an IntegrityVerificationStream block twice.
- Add section validation for all hashed NCA sections
2018-10-09 18:10:44 -05:00
Alex Barney
24e6434765 Use an enum instead of a bool for integrity checking levels 2018-10-09 15:33:56 -05:00
Alex Barney
a64cbeca5b Continue NCA improvements
- Read only the NCA header when first opening an NCA. This allows for reading of partial NCAs and slightly improves performance when opening an NCA.
- Add a separate NCA method to validate master hashes now that it's not automatically done when opening the NCA.
- Fix possible hang when reading BKTR sections.
- When keys required to decrypt an NCA are missing, throw an exception with information about the missing keys.
- Add more sanity checks when reading an NCA.

Hactoolnet: Don't hard-crash when hitting an unhandled exception
2018-10-08 21:04:39 -05:00
Alex Barney
209d81187a NCA reading improvements
Add on-the-fly Partition FS hash verification
Do some cleanup on NCA classes
2018-10-07 20:29:27 -05:00
Alex Barney
47a3eda0ed Fix key printing 2018-10-05 12:29:52 -05:00
Alex Barney
db00267ef4 Dispose SharedStreamSource. Temp fix for switchfs reading without title keys 2018-10-05 12:23:18 -05:00
Alex Barney
0300f55da5 Give RomfsDir and RomfsFile a common base 2018-10-04 21:40:59 -05:00
jonnysp
d12f419d8d Add Partition FS extraction (#12)
Add Partition FS extraction + misc. changes
2018-10-03 14:14:23 -06:00
Alex Barney
e798a8dd45 Add key file exporting to hactoolnet 2018-10-02 22:00:57 -05:00
Alex Barney
e740d13bbe Enforce "var" style 2018-10-02 17:25:58 -05:00
Alex Barney
372370db82 Code style naming fixes 2018-10-01 13:07:20 -05:00
Alex Barney
56115ace39 Fix casing of names 2018-10-01 13:00:09 -05:00
Alex Barney
a21283bf44 Print information about save files 2018-10-01 12:55:10 -05:00
Alex Barney
7a5bd2347d Read additional portion of patch content metadata files 2018-09-25 18:28:49 -05:00
Alex Barney
64c98df5b3 Fix hactoolnet build 2018-09-24 14:42:06 -05:00
Alex Barney
54319145c1
Merge pull request #10 from jonnysp/master
added XCI File and Partition HashValidity
2018-09-24 13:40:03 -06:00
Alex Barney
b5c7f14d55
Merge pull request #11 from shadowninja108/master
Add partial NSO support
2018-09-23 20:22:39 -06:00
Alex Barney
fba8a7c6e0 Code style tweaks 2018-09-23 21:18:20 -05:00
shadowninja108
86aa80c87b Fixed Nso implementation
Added more keyset printing
2018-09-23 00:24:14 -07:00
shadowninja108
0efc550fa6 Better handling of the IsCompressed flag in Nso.cs 2018-09-22 21:52:30 -07:00
shadowninja108
e694833e0c Switched to Ryujinx's implementation of LZ4
Fixed stream handling in Nso.cs
2018-09-22 21:46:15 -07:00
shadowninja108
73b472befa Add partial NSO support 2018-09-22 20:19:27 -07:00
Alex Barney
34c3ffd37e Make sure the title key for an NCA exists when loading 2018-09-22 18:48:44 -05:00
jonnysp
f7b23c3f83 correction ECB CBC 2018-09-22 08:42:00 +02:00