Commit Graph

55 Commits

Author SHA1 Message Date
Liam 5a09ba7255 vfs: ensure key area keys are validated 2023-08-28 22:22:00 -04:00
Liam 50eee9b218 fssystem: rework for yuzu style 2023-08-15 17:47:40 -04:00
Liam 86f6b6b7b2 vfs: expand support for NCA reading 2023-08-15 17:47:25 -04:00
Tobias 04868ab9da
file_sys/content_archive: Detect compressed NCAs (#11047) 2023-07-12 23:17:18 +02:00
Liam 9737615948 general: fix compile for Apple Clang 2022-11-22 22:22:28 -05:00
Liam d11547024c general: fix compilation on GCC 12 2022-06-13 20:09:30 -04:00
Morph 99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
ReinUsesLisp 1ef64112b3 content_archive: Remove unnecessary include to <ranges>
Fixes build issues on clang.
2021-07-12 03:37:56 -03:00
Lioncash 1da72c7792 file_sys: Resolve cases of variable shadowing
Brings us closer to enabling -Wshadow as an error in the core code.
2021-05-02 02:59:57 -04:00
ReinUsesLisp 3ff978aa4f common/common_funcs: Rename INSERT_UNION_PADDING_{BYTES,WORDS} to _NOINIT
INSERT_PADDING_BYTES_NOINIT is more descriptive of the underlying behavior.
2021-01-15 16:27:28 -03:00
Lioncash b1657b8c6b vfs: Use existing type aliases consistently
Makes use of the VirtualDir and VirtualFile aliases across the board
instead of having a few isolated places that don't use it.
2020-12-10 01:44:43 -05:00
Lioncash 6b7320add4 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.
2020-12-07 23:02:23 -05:00
bunnei 3d592972dc
Revert "core: Fix clang build" 2020-10-20 19:07:39 -07:00
Lioncash be1954e04c core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.

Fixes #4795
2020-10-17 19:50:39 -04:00
Lioncash ff45c39578 General: Make use of std::nullopt where applicable
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.

This also makes it consistent how we return empty optionals.
2020-09-22 17:32:33 -04:00
Lioncash 01d1b5cdaf file_sys: Replace inclusions with forward declarations where applicable
Same behavior, minus unnecessary inclusions where not necessary.
2020-08-23 17:02:55 -04:00
Lioncash 15660bd857 aes_util: Allow SetIV to be non-allocating
In a few places, the data to be set as the IV is already within an array.
We shouldn't require this data to be heap-allocated if it doesn't need
to be. This allows certain callers to reduce heap churn.
2020-08-03 14:29:58 -04:00
FearlessTobi 9f82a9a244 crypto: Make KeyManager a singleton class
Previously, we were reading the keys everytime a KeyManager object was created, causing yuzu to reread the keys file multiple hundreds of times when loading the game list.
With this change, it is only loaded once.
On my system, this decreased game list loading times by a factor of 20.
2020-05-20 21:28:16 +02:00
bunnei 1bdae0fe29 common_func: Use std::array for INSERT_PADDING_* macros.
- Zero initialization here is useful for determinism.
2019-11-03 22:22:41 -05:00
Zach Hilman e018a48460 content_archive: Add accessors for Rights ID and SDK Version 2019-09-21 16:43:10 -04:00
jonsn0w e78d069a81
Update content_archive.cpp
log clutter in debug logs when theres really no need
2019-06-19 22:01:41 -04:00
Zach Hilman 318bf7c8e3 content_archive: Add getter for logo section of NCA 2019-01-15 16:00:29 -05:00
Zach Hilman e20db909ee content_archive: Add optional KeyManager parameter to constructor
Allows resuing a common KeyManager when a large amount of NCAs are handled by the same class. Should the parameter not be provided, a new KeyManager will be constructed, as was the default behavior prior to this.
2018-11-01 20:22:29 -04:00
Frederic L 7a5eda5914 global: Use std::optional instead of boost::optional (#1578)
* get rid of boost::optional

* Remove optional references

* Use std::reference_wrapper for optional references

* Fix clang format

* Fix clang format part 2

* Adressed feedback

* Fix clang format and MacOS build
2018-10-30 00:03:25 -04:00
Zach Hilman a25d79cfaa vfs: Remove InterpretAsDirectory and related functions
When writing VFS, it initally seemed useful to include a function to in-place convert container files into directories in one homogenous directory structure, but re-evaluating it now there have been plenty of chances to use it and there has always been a better way. Removing as it is unused and likely will not be used.
2018-10-19 14:02:07 -04:00
Lioncash 871350ae35 content_archive: Simpify assignment of bktr_base_romfs in the constructor
std::move doesn't actually dereference the data, so it doesn't matter
whether or not the type is null.
2018-10-16 13:22:31 -04:00
Lioncash 441b5b97bd content_archive: Make IsValidNCA() an internally linked function
This is only ever used within the cpp file, so it can just be an
internal function.
2018-10-16 13:22:31 -04:00
Lioncash 53e77ffbfe content_archive: Simplify rights ID check
This is the same as using std::any_of with an inverted predicate.
2018-10-16 13:22:31 -04:00
Lioncash d6604fa765 content_archive: Split loading into separate functions
The constructor alone is pretty large, the reading code should be split
into its consistuent parts to make it easier to understand it without
having to build a mental model of a 300+ line function.
2018-10-16 13:22:28 -04:00
Lioncash 4783ad54de content_archive: Pass and take NCASectionHeader instance by reference
Each header is 512 bytes in size, which is kind of an excessive amount
to copy all the time when it's possible to avoid doing so.
2018-10-16 12:08:17 -04:00
Zach Hilman 90c07e0d33 content_archive: Move get key log to Trace level
Avoids printing live keys in the general log.
2018-10-12 23:25:59 -04:00
Lioncash 05ef9dfc10 file-sys: Default heavy-weight class destructors in the cpp file
Several classes have a lot of non-trivial members within them, or don't
but likely should have the destructor defaulted in the cpp file for
future-proofing/being more friendly to forward declarations.

Leaving the destructor unspecified allows the compiler to inline the
destruction code all over the place, which is generally undesirable from
a code bloat perspective.
2018-09-19 19:34:08 -04:00
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Zach Hilman c913136eb2 bktr: Fix bucket overlap error 2018-09-04 17:01:54 -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 a6e75cd45b bktr: Implement IVFC offset shifting
Fixes base game read errors
2018-09-04 16:24:02 -04:00
Zach Hilman 1efe5a76b1 content_archive: Add BKTR header parsing to NCA 2018-09-04 16:22:25 -04:00
Lioncash a813c10e1c file_sys: Replace includes with forward declarations where applicable
Cuts down on include dependencies, resulting in less files that need to
be rebuilt when certain things are changed.
2018-09-03 22:52:24 -04:00
Zach Hilman 4f18c17df7 content_archive: Add update title detection
This is needed because the title IDs of update NCAs will not use the update title ID. The only sure way to tell is to look for a partition with BKTR crypto.
2018-08-23 18:53:13 -04:00
Zach Hilman c4845df3d4 xts_encryption_layer: Implement XTSEncryptionLayer 2018-08-23 11:52:44 -04:00
Zach Hilman ec3bef7b4c loader: Add more descriptive errors
Full list of new errors and descriptions in core/loader/loader.h
2018-08-09 21:06:59 -04:00
bunnei fd9da4232b
Merge pull request #850 from DarkLordZach/icon-meta
Add Icons and Metadata Support
2018-08-08 12:27:19 -04:00
Zach Hilman 91cfe70301 loader: Add icon and title support to XCI 2018-08-06 23:13:42 -04:00
Zach Hilman 2cc962e171 content_archive: Add support for titlekey cryptography 2018-08-04 14:57:21 -04:00
Zach Hilman 13cdf1f159 Add missing parameter to files.push_back() 2018-08-01 00:16:54 -04:00
Zach Hilman 187d8e215f Use more descriptive error codes and messages 2018-08-01 00:16:54 -04:00
Zach Hilman a9c921a41d Use ErrorEncrypted where applicable and fix no keys crash 2018-08-01 00:16:54 -04:00
Zach Hilman 03149d3e4a Add missing includes and use const where applicable 2018-08-01 00:16:54 -04:00
Zach Hilman 239a3113e4 Make XCI comply to review and style guidelines 2018-08-01 00:16:54 -04:00
Zach Hilman df5b75694f Remove files that are not used 2018-08-01 00:16:54 -04:00