Commit Graph

159 Commits

Author SHA1 Message Date
Maschell
c57cee987a Use the default readFile implementation for the FSTDataProviderNUSTitle 2019-04-26 10:08:53 +02:00
Maschell
ddee4b9f5d Refactor and fix FST parsing.
- Fix a bug when parsing certain FST of system titles.
- Remove the Content reference on the FSTEntry. The Content can get be get via the TMD using getContentByIndex. To get the FSTInfo for the content use FSTUtils.getFSTInfoForContent.
- Children are added manually to a FSTEntry (getting ride of side effects).
- The NUSTitleLoader sets the FST to the dataprovider. The WUDDataProvider needs the FST to get access to the FSTContentInfo (=> calculating the offsets of the content files).
- Remove some unused functions from the FSTEntry class
- To get the FSTEntries for the certain content use getFSTEntriesByContentIndex
2019-04-26 10:08:09 +02:00
Maschell
157957f3ee Add default implementiation for the readFile function of the FSTDataProvider interface 2019-04-26 09:57:05 +02:00
Maschell
794d4b5146 Remove "abstract" keywords from interface 2019-04-26 09:56:27 +02:00
Maschell
448eea1092 Clean up NUSTitle class, move functions to FSTUtils class 2019-04-26 09:55:52 +02:00
Maschell
5a57d42c52 Check partial file reads on a different location 2019-04-26 09:51:28 +02:00
Maschell
995d548c11 Swap offset and size arguments in decrypt functions 2019-04-26 09:49:50 +02:00
Maschell
6981345467 Force the use "/" as the path separator internally 2019-04-24 13:53:07 +02:00
Maschell
c1a1961e03 Minor formatting 2019-04-24 13:28:59 +02:00
Maschell
0d39c037ad Increase the size of the PipedStream buffers. This increases the performance. 2019-04-24 13:28:47 +02:00
Maschell
1f02e9d41d Give the NUSDataProvider implementation a hint to limit the length of the content stream 2019-04-24 13:27:54 +02:00
Maschell
a58c1c5b77 Make sure to always read the expected Blocksize from a stream of a hashed content. 2019-04-24 13:27:02 +02:00
Maschell
06184da8d3 Only throw an exception in the FSTService when a content for a given wasn't found if the Map is emtpy 2019-04-24 13:26:25 +02:00
Maschell
03181f6078 Close file properly on compressWUDToWUX function 2019-04-24 13:25:22 +02:00
Maschell
254d16a584 Simplify the ByteArrayWrapper constructor 2019-04-24 13:24:08 +02:00
Maschell
59411e4c7d Throw proper exception while hashing 2019-04-19 14:47:39 +02:00
Maschell
9f6f9aaabe Make sure all streams are really closed via try/finally block. Added a "closeAll" function in StreamUtils which helps to close a list of closeables 2019-04-19 11:41:12 +02:00
Maschell
fccd8f8bf4 Throw an Exception when a FSTDataProviderNUSTitle has no FSTEntry root 2019-04-19 11:39:09 +02:00
Maschell
a5929f346d Replace System.exit with throwing an Exception 2019-04-19 11:38:02 +02:00
Maschell
39d10291a2 Fix the warning when you try to decrypt a FSTEntry where the content is empty. 2019-04-19 11:37:22 +02:00
Maschell
dbad684549 Check for execptions when reading an inputstream 2019-04-19 11:36:49 +02:00
Maschell
ef878f7e41 Return an empty HashMap instead of null. 2019-04-19 10:57:18 +02:00
Maschell
1ebe37b77e Adjust log levels 2019-04-19 10:56:59 +02:00
Maschell
4aa6f532f0 Organize imports 2019-04-19 10:56:43 +02:00
Maschell
9b38f9c8c6 The readToFile function of the FSTDataProvider Interface now does return a value value to indicate success 2019-04-19 10:56:24 +02:00
Maschell
194b3084ae Add a missing input.close() when an exception happens. 2019-04-19 10:45:01 +02:00
Maschell
d3f2361803 Throw an exception instead of doing a System.exit when the offset is too big. 2019-04-19 10:44:08 +02:00
Maschell
3a6f592294 Use break on reading error instead of return, this way the streams will be closed properly. 2019-04-19 10:43:32 +02:00
Maschell
c47c9913ac Change the content and parent attribute of a FSTEntry to an Optional 2019-04-19 10:42:33 +02:00
Maschell
75e28a733b Some minor code cleanup for the WUDInfoParser 2019-04-18 23:28:01 +02:00
Maschell
a9fc37244a Only throw an exception when no content was found for files that are actually in the title (and not a directory) 2019-04-18 23:27:39 +02:00
Maschell
f8146ce56b Make SHA2 attribute of ContentInfo Optional 2019-04-18 23:25:20 +02:00
Maschell
7c9fe334a8 The FST and Ticket attribute of the NUSTitle are now optionals 2019-04-18 11:18:32 +02:00
Maschell
73440af121 Return false instead of throwing an exception while trying to extract missing files 2019-04-16 12:59:34 +02:00
Maschell
a521b045ab - Fix non-gm parition with FST > 0x8000 bytes.
- Wrap reading from discReader in WUDInfoParser.
- Only save the complete WUDPartitionHeader in the game partition
- Replace the WUDPartitio.getAbsolutePartitionOffset by getPartitionOffset.
2019-04-14 22:09:15 +02:00
Maschell
54536f29ab Add simple wrapper for the "readFileAsStream" function of the FSTDataProvider 2019-04-14 20:39:37 +02:00
Maschell
151ad6e2a6 Add support for titles without FST. 2019-04-14 14:50:01 +02:00
Maschell
1698acb3f6 Don't swallow the exception on checksum errors. 2019-04-14 14:49:47 +02:00
Maschell
7d8bb58cc4 Make SI partitions optional for Wii U discs 2019-04-14 13:24:35 +02:00
Maschell
6e9b8df971 Update .gitignore 2019-04-11 17:57:16 +02:00
Maschell
cbfe6539a5 Check if the TMD is from a WiiU by checking the titleID 2019-04-11 17:56:59 +02:00
Maschell
2f820bbe17 Add a new DecryptionService using a FSTDataProvider. 2019-04-11 13:29:08 +02:00
Maschell
40f6b2af73 Remove FSTUtil functions from the NUSTitle class, they were just wrappers to the FSTUtils class are now unused. 2019-04-11 13:28:44 +02:00
Maschell
8c75a1a43e Move the decryption of a inputstream into a output stream in the NUSDecryption class. 2019-04-11 13:28:12 +02:00
Maschell
fbceae0558 - Replace the readFileAsStream (to InputStream) function with a default implementation in the FSTDataProvider interface. This way the implementations only need to provide a function to write into a outputstream.
- Optimize the readEncryptedToStream function on the DiscReader. The normal wud reader don't need to pipe the stream anymore.
2019-04-11 13:27:21 +02:00
Maschell
89d5927acd Add a readFileToStream function to the FSTDataProvider interface while allows your to read a file to a outputstream 2019-04-11 13:14:50 +02:00
Maschell
53993dc8c4 Remove DecryptionService for now 2019-04-10 20:13:52 +02:00
Maschell
88c0bb8a9e Add/Update copyright information. Minor cleanup, moved some interfaces 2019-04-10 20:13:38 +02:00
Maschell
c0cdebba97 Add a WUDLoader utility class to load a WUD/WUX and get the Partitions as NUSTitles or FSTDataProvider. 2019-04-10 20:03:48 +02:00
Maschell
4d703d631a Add a FSTDataProvider implementation using a WUDDataPartition. 2019-04-10 20:01:52 +02:00