Commit Graph

14 Commits

Author SHA1 Message Date
Lioncash dade709f63 submission_package: Correct location of null check within SetTicketKeys()
If a ticket file was ever a null pointer, we'd cause a null pointer
dereference, as we were calling GetExtension() on the pointer instance.
2018-10-03 02:06:30 -04:00
Lioncash 02841052aa submission_package: Use std::string's rfind() when looking for the extension in InitializeExeFSAndRomFS()
When searching for a file extension, it's generally preferable to begin
the search at the end of the string rather than the beginning, as the
whole string isn't going to be walked just to check for something at the
end of it.
2018-10-03 01:51:01 -04:00
Lioncash 37ee05f7c0 submission_package: Ensure the 'extracted' member variable is always initialized
If an error occurs when constructing the PartitionFilesystem instance,
the constructor would be exited early, which wouldn't initialize the
extracted data member, making it possible for other code to perform an
uninitialized read by calling the public IsExtractedType() member
function. This prevents that.
2018-10-03 01:47:34 -04:00
Lioncash ccf0a9cb38 submission_package: Move ExeFS and RomFS initialization to its own function
Like the other two bits of factored out code, this can also be put
within its own function. We can also modify the code so that it accepts
a const reference to a std::vector of files, this way, we can
deduplicate the file retrieval.

Now the constructor for NSP isn't a combination of multiple behaviors in
one spot. It's nice and separate.
2018-10-03 01:46:07 -04:00
Lioncash fd312abedd submission_package: Move NCA reading code to its own function
This too, is completely separate behavior from what is in the
constructor, so we can move this to its own isolated function to keep
everything self-contained.
2018-10-03 01:35:41 -04:00
Lioncash 4f18d35888 submission_package: Move ticket key setting to its own function
This behavior is entirely independent of the surrounding code, so it can
be put in its own function to keep the behavior separate.
2018-10-03 01:20:57 -04:00
Lioncash 0d83f8f255 submission_package: Invert conditionals within NSP's constructor to reduce nesting
We can use early continues here to reduce the amount of nesting.
2018-10-03 01:11:16 -04:00
bunnei 94f193af65
Merge pull request #1242 from lioncash/file-sys
file_sys/submission_package: Replace includes with forward declarations where applicable
2018-09-05 18:53:32 -04:00
Lioncash 6bd6beee20 file_sys/submission_package: Correct constructor initialization list order
Orders the elements in the sequence to match the order in which they'll
actually be initialized in.
2018-09-05 13:44:42 -04:00
Lioncash c0b7ed8b58 file_sys/submission_package: Replace includes with forward declarations where applicable 2018-09-05 12:08:04 -04:00
Zach Hilman 92e26df00f nsp: Fix error masking issue with XCI files
Now display correct error instead of catch-all MissingProgramNCA
2018-09-04 16:24:24 -04:00
Zach Hilman 87be4bc283 main: Only show DRD deprecation warning once 2018-09-04 14:44:48 -04:00
Zach Hilman e4e55d064e nsp: Comply with style and performance guidelines 2018-09-04 14:29:19 -04:00
Zach Hilman 93703431e2 file_sys: Add Nintendo Submission Package (NSP) 2018-09-04 14:25:54 -04:00