summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/NANDContentLoader.cpp
AgeCommit message (Collapse)Author
2017-03-05Merge pull request #5007 from lioncash/swapMat M
Common: Move byte swapping utilities into their own header
2017-03-04IOS/ES: Implement ES_GetOwnedTitlesLéo Lam
2017-03-03Common: Move byte swapping utilities into their own headerLioncash
This moves all the byte swapping utilities into a header named Swap.h. A dedicated header is much more preferable here due to the size of the code itself. In general usage throughout the codebase, CommonFuncs.h was generally only included for these functions anyway. These being in their own header avoids dumping the lesser used utilities into scope. As well as providing a localized area for more utilities related to byte swapping in the future (should they be needed). This also makes it nicer to identify which files depend on the byte swapping utilities in particular. Since this is a completely new header, moving the code uncovered a few indirect includes, as well as making some other inclusions unnecessary.
2017-03-01Add ES::Content::IsShared to avoid hardcoding 0x8000Léo Lam
2017-02-27IOS/ES: Implement ES_Export* ioctlvsLéo Lam
This should allow channels to be copied to the SD properly.
2017-02-26ES: Make sure the TMD and ticket are valid before useLéo Lam
2017-02-26Move AES code to Common/CryptoLéo Lam
2017-02-26Use ESFormats for TMDsLéo Lam
We already have a TMDReader, so let's actually use it. And move ESFormats to IOS::ES, since it's definitely part of IOS. This adds a DiscIO dependency on Core which will be fixed in a follow-up PR.
2017-02-26Move the ticket code to ESFormatsLéo Lam
This moves some parsing code for tickets and ticket views to ESFormats instead of duplicating it over DiscIO and Core.
2017-02-10Get rid of a singleton for NAND shared contentsLéo Lam
This also allows shared contents to be installed to the configured root when installing a WAD.
2017-02-10Always use configured root when installing WADLéo Lam
This prevents Dolphin from writing to /sys/uid.sys (on the host; root partition) when installing a WAD before starting emulation, because the session root is not initialized at that moment. Incidentally, this also gets rid of a singleton.
2017-01-23DiscIO: Fix out-of-bounds access in NANDContentDataBufferLéo Lam
Accessing buffer[start + size] triggers an error (and a crash) in debug builds. Using std::copy_n fixes this.
2017-01-14DiscIO: Export GetKeyFromTicketPierre Bourdon
This function has more uses than just in DiscIO (e.g. WFS).
2017-01-14DiscIO: Implement functions to lookup ticketsPierre Bourdon
These two functions load either a signed ticket or a raw ticket from the emulated NAND. The ticket signature skip is refactored out of the ticket writing in order to be usable by the raw ticket reading function.
2017-01-14IOS/ES: Implement ES_AddTicket.Pierre Bourdon
Refactor the existing DiscIO::AddTicket to not require the caller to pass the requested title ID. We do not have the title ID in the ES case, and it needs to be extracted from the ticket. Since this is always a safe operation to do (title ID is always in the ticket), the implementation is made default.
2017-01-02DiscIO: Add GetRegion function and Region enumJosJuice
Instead of needing different switch cases for converting countries to regions in multiple places, we now only need a single country-to-region switch case (in DiscIO/Enums.cpp), and we get a nice Region type.
2016-12-06Common: Add alignment headerLéo Lam
Gets rid of duplicated alignment code.
2016-10-14NANDContentLoader: Add IOFile forward declarationLioncash
This would previously fail to compile when included in files that do not include FileUtil.h due to lack of a type declaration. This moves the constructor and destructor into the cpp file in order to satisfy the requirements of unique_ptr construction and deletion. That is, unique_ptr requires a concrete type at the point of construction and destruction. If the constructor or destructor is left in the header, then at the point of construction or destruction, IOFile will still be considered an incomplete type, as unique_ptr's deleter will still only be able to see the forward declaration, which it can't use.
2016-09-14NANDContentLoader: Delay vector construction until needed in Get()Lioncash
No need to construct the vector right off the bat.
2016-09-14NANDContentLoader: Make CNANDContentData's Get function return by non-const ↵Lioncash
value const specifiers like this are practically pointless and can inhibit move construction.
2016-09-14DiscIO: Fix NAND Memory LeakEmptyChaos
CNANDContentData is a base class with a non-virtual destructor so derived classes don't get destroyed causing them to leak resources.
2016-07-13Move DiscIO enums to a new fileJosJuice
At first there weren't many enums in Volume.h, but the number has been growing, and I'm planning to add one more for regions. To not make Volume.h too large, and to avoid needing to include Volume.h in code that doesn't use volume objects, I'm moving the enums to a new file. I'm also turning them into enum classes while I'm at it.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-03-20properly open/close the file to avoid rapid open/close cyclesBhaaL
ES_OPENCONTENT and ES_CLOSECONTENT now call Open and Close respectively, as the old code did.
2016-03-20hide the distinction between WAD and File from ESBhaaL
instead, leave all the management with the NANDContentLoader. for file data (directly on the NAND), this opens the file on-demand and returns the requested chunk when asked for it. for on-the-fly decrypted WAD data, we just keep the decoded buffer in memory, like we've done before - except that we don't give away any objects we don't want to.
2016-03-20fix some style inconsistencies that drove me nutsBhaaL
2016-01-03Debug Builds: Fixed vector assertionSepalani
2015-12-19NANDContentLoader/WiiWAD: Get rid of raw delete and newLioncash
2015-10-16Merge pull request #3139 from JosJuice/fix-wii-rootflacs
Mark which Wii root to use in the NAND path code
2015-10-16Mark which Wii root to use in the NAND path code.comex
It's used by both the GUI to do things like install WADs and check up on the system menu, in which case the global root should be used, and by /dev/es, in which case the local one should. The latter isn't *terribly* useful today, since no contents will ever be installed in temporary roots (although it's still relevant for data directories), but converting the whole thing makes sense because then it will Just Work once the entire NAND is synced. Because it would have been a bit of work to split it up (but I can if desired), this commit also contains some basic cleanup of NANDContentLoader: (1) The useless interface class INANDContentLoader is removed and the methods are changed to just return CNANDContentLoader (the only implementation); (2) CNANDContentManager is changed to use unique_ptr and cleaned up a bit.
2015-10-07NANDContentLoader: Replace a string rbegin() call with a back() callLioncash
2015-10-03Merge pull request #3091 from Tilka/mbedtlsshuffle2
Update mbed TLS (PolarSSL)
2015-09-26Common: Remove other Common prefixed headers from Common.hLioncash
2015-09-25mbedTLS: run rename.pl script and fix errorsTillmann Karras
2015-06-02Merge pull request #1556 from comex/project-morationcomex
Rudimentary version of Wii IPC determinism. Ported from my old udpnet branch.
2015-05-28Pass strings by const reference where possibleLioncash
2015-05-28Add a mode to use a dummy Wii NAND.comex
Eventually, netplay will be able to use the host's NAND, but this could still be useful in some cases; for TAS it definitely makes sense to have a way to avoid using any preexisting NAND. In terms of implementation: remove D_WIIUSER_IDX, which was just WIIROOT + "/", as well as some other indices which are pointless to have as separate variables rather than just using the actual path (fixed, since they're actual Wii NAND paths) at the call site. Then split off D_SESSION_WIIROOT_IDX, which can point to the dummy NAND directory, from D_WIIROOT_IDX, which always points to the "real" one the user configured.
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras
2015-03-09Don't construct NANDContentLoader classes before Main.cpp runsJosJuice
The cUIDsys constructor writes to <Wii user path>/sys/uid.sys. This must not be done before Main.cpp sets the correct user paths.
2015-02-28General FormattingStevoisiak
2014-11-24More formatting and consistency fixesStevoisiak
2014-09-08Include CommonTypes.h instead of Common.h.Rohit Nirmal
2014-09-01DiscIO: Prefix class member variables with "m_"Lioncash
2014-08-30Get rid of C-style empty function parameter indicatorsLioncash
2014-06-25Centralize the logging code into its own folder in Common.Lioncash
2014-06-18Kill off replaceable usages of s[n]printf.Lioncash
2014-03-11Fixes spacing for "for", "while", "switch" and "if"Matthew Parlane
Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining.
2014-03-09clang-modernize -use-nullptrTillmann Karras
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09clang-modernize -loop-convertTillmann Karras
and some manual adjustments