summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeVerifier.cpp
AgeCommit message (Collapse)Author
2024-10-15Merge pull request #13090 from mitaclaw/ranges-modernization-1-trivialJosJuice
Ranges Algorithms Modernization - Trivial
2024-10-11Merge pull request #13095 from mitaclaw/ranges-modernization-6-nTilka
Ranges Algorithms Modernization - N
2024-10-10Modernize `std::find_if` with rangesmitaclaw
In BTEmu.cpp, `std::mem_fn` was not necessary for the predicate to compile.
2024-10-10Modernize `std::binary_search` with rangesmitaclaw
In VolumeVerifier.cpp, constructing a `std::string_view` of the volume's GameID is unnecessary, as `std::`(`ranges::`)`binary_search` supports heterogeneous lookup. The usage in GameFile.cpp is a perfect example.
2024-10-07Simplify `std::copy` with `std::copy_n`mitaclaw
+ a surprise `std::memcpy` in VolumeVerifier.cpp.
2024-09-28VolumeVerifier: Promote `DEBUG_ASSERT` to `static_assert`mitaclaw
This runtime assertion was added before `std::is_sorted` became constexpr in the codebase.
2023-08-19DiscIO: Don't keep volume pointer in DiscScrubberJosJuice
Keeping the pointer creates use-after-free opportunities, and we don't have much reason to keep it around anyway.
2023-05-15IOS/ES: Split ESDevice into ESCore and ESDevice.Admiral H. Curtiss
ESCore implements the core functionality that can also be used outside of emulation. ESDevice implements the IOS device and is only available during emulation.
2023-01-24Common: Replace StringBeginsWith/StringEndsWith with std equivalentsLioncash
Obsoletes these functions in favor of the standard member functions added in C++20.
2022-10-29VolumeVerifier: fix bogus "serial/version missing" errorTillmann Karras
When searching for a disc where the revision doesn't match any disc in the datfile, the loop would never get to the part where serials_exist is set to true, leading to a bogus error message.
2022-09-23VolumeVerifier: Add missing assignment to summary_text.Admiral H. Curtiss
2022-08-16fix verifying wii dev signaturesShawn Hoffman
allows verifying dev-signed discs and wads
2022-08-04DiscIO/VolumeVerifier: Add a note about NFS bad dumpsJosJuice
2022-08-04DiscIO/VolumeVerifier: Small logic cleanupJosJuice
Just for ease of reading. No behavioral difference.
2022-08-04DiscIO: Adjust GetDataSizeType logic for NFSJosJuice
2022-08-04DiscIO: Replace IsDataSizeAccurate with GetDataSizeTypeJosJuice
Previously, we had WBFS and CISO which both returned an upper bound of the size, and other formats which returned an accurate size. But now we also have NFS, which returns a lower bound of the size. To allow VolumeVerifier to make better informed decisions for NFS, let's use an enum instead of a bool for the type of data size a blob has.
2022-08-04DiscIO/VolumeWii: Decouple "is encrypted" from "is hashed"JosJuice
Needed for the next commit. NFS disc images are hashed but not encrypted. While we're at it, also get rid of SupportsIntegrityCheck. It does the same thing as old IsEncryptedAndHashed and new HasWiiHashes.
2022-08-02VolumeVerifier: enable fast hash functions by defaultShawn Hoffman
sets defaults based on cpu support.
2022-08-01Common/Hash: use zlib-ng for adler32. small cleanups.Shawn Hoffman
2022-07-30Merge pull request #10899 from shuffle2/sha1Admiral H. Curtiss
add hw-accelerated SHA1
2022-07-28VolumeVerifier: Fix read_succeeded conditionJosJuice
We shouldn't set m_read_errors_occurred to true just because is_data_needed was false.
2022-07-26introduce wrapper for SHA1 functionalityShawn Hoffman
2022-07-25StripSpaces: only strip spacesShawn Hoffman
StripWhitespace maintains old behavior
2022-07-17VolumeVerifier: Ignore case when looking for IOS on update partitionJosJuice
One of the Dragon Quest X expansions (S4SJGD) uses lowercase instead of the usual uppercase for the IOS59 file on its update partition.
2022-07-13DiscIO/VolumeVerifier: Don't try to verify data that would read out of bounds.Admiral H. Curtiss
2022-06-06CMake: rename minizip to minizip-ngTillmann Karras
minizip-ng is the new name used by the upstream project as well as all distros other than Fedora (but it looks like it will be renamed there).
2022-03-12VolumeVerifier: Skip "lacks some data" check for Datel discsJosJuice
Turns out there's some Freeloader disc for the GC that triggers this despite being a good dump. This warning is mostly intended to catch Wii games that have been truncated at the 4.00 GiB or 4.38 GiB mark anyway, and if someone does have a Datel dump that has been truncated, they'll still get the "unusual size" warning.
2022-02-13Fix integer sign difference comparison warningsPokechu22
2022-01-14Fix static initialisation order fiasco issue for Version variablesLéo Lam
Fixes a crash that could occur if the static constructor function for the MainSettings.cpp TU happened to run before the variables in Common/Version.cpp are initialised. (This is known as the static initialisation order fiasco.) By using wrapper functions, those variables are now guaranteed to be constructed on first use.
2022-01-01Replace remaining uses of zlib crc32 with Common/Hash.hPokechu22
2021-08-15VolumeVerifier: Use correct IOS filename for development discs.David Korth
Retail-signed discs use the format: IOS56-64-v5661.wad Debug-signed discs use the format: firmware.64.56.22.29.wad Debug-signed discs usually have a 128 version of the firmware as well, since some devkits have 128 MB MEM2. (Retail has 64 MB.)
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-05-26VolumeVerifier: increase problem severity for incorrectly signed TMDsMateus B. Cassiano
2021-04-02Replace uses of cassert with Common/Assert.hPokechu22
2021-03-22VolumeVerifier: Align partition reads to groupsJosJuice
This improves the speed of verifying Wii WIA/RVZ files. For me, the verification speed for LZMA2-compressed files has gone from 11-12 MiB/s to 13-14 MiB/s. One thing VolumeVerifier does to achieve parallelism is to compute hashes for one chunk of data while reading the next chunk of data. In master, when reading data from a Wii partition, each such chunk is 32 KiB. This is normally fine, but with WIA and RVZ it leads to rather lopsided read times (without the compute times being lopsided): The first 32 KiB of each 2 MiB takes a long time to read, and the remaining part of the 2 MiB can be read nearly instantly. (The WIA/RVZ code has to read the entire 2 MiB in order to compute hashes which appear at the beginning of the 2 MiB, and then caches the result afterwards.) This leads to us at times not doing much reading and at other times not doing much computation. To improve this, this change makes us use 2 MiB chunks instead of 32 KiB chunks when reading from Wii partitions. (block = 32 KiB, group = 2 MiB)
2021-03-22VolumeVerifier: Handle contents overlappingJosJuice
This can't actually happen in practice due to how WAD files work, but it's very easy to add support for thanks to the last commit, so we might as well add support for it.
2021-03-22VolumeVerifier: Handle overlapping blocks more efficientlyJosJuice
The performance gains of doing this aren't too important since you normally wouldn't run into any disc image that has overlapping blocks (which by extension means overlapping partitions), but this change also lets us get rid of things like VolumeVerifier's mutex that used to exist just for the sake of handling overlapping blocks.
2021-03-16Merge pull request #9573 from JosJuice/volumeverifier-cancel-crashLéo Lam
VolumeVerifier: Fix potential crash when cancelling
2021-03-10DiscIO: Move magic constants for discs to DiscUtilsJosJuice
2021-03-10DiscIO: Move some code from VolumeVerifier to DiscUtilsJosJuice
2021-03-09DiscIO: Move some code from DiscExtractor to new file DiscUtilsJosJuice
2021-03-07VolumeVerifier: Fix potential crash when cancellingJosJuice
The async operations may contain references to class members, so any running async operations must end before destroying the class.
2021-02-12IOS: Use less ambiguous names for classesLéo Lam
Some of the device names can be ambiguous and require fully or partly qualifying the name (e.g. IOS::HLE::FS::) in a somewhat verbose way. Additionally, insufficiently qualified names are prone to breaking. Consider the example of IOS::HLE::FS:: (namespace) and IOS::HLE::Device::FS (class). If we use FS::Foo in a file that doesn't know about the class, everything will work fine. However, as soon as Device::FS is declared via a header include or even just forward declared, that code will cease to compile because FS:: now resolves to Device::FS if FS::Foo was used in the Device namespace. It also leads to having to write IOS::ES:: to access ES types and utilities even for code that is already under the IOS namespace. The fix for this is simple: rename the device classes and give them a "device" suffix in their names if the existing ones may be ambiguous. This makes it clear whether we're referring to the device class or to something else. This is not any longer to type, considering it lets us get rid of the Device namespace, which is now wholly unnecessary. There are no functional changes in this commit. A future commit will fix unnecessarily qualified names.
2021-01-27rename Common/File to Common/IOFileShawn Hoffman
2020-11-16Use positional arguments in all translatable fmt stringsJosJuice
We want to use positional arguments in translatable strings that have more than one argument so that translators can change the order of them, but the question is: Should we also use positional arguments in translatable strings with only one argument? I think it makes most sense that way, partially so that translators don't even have to be aware of the non-positional syntax and partially because "translatable strings use positional arguments" is an easier rule for us to remember than "transitional strings which have more than one argument use positional arguments". But let me know if you have a different opinion.
2020-11-11DiscIO: Make use of fmt-capable panic alertsLioncash
Migrates the DiscIO code over to fmt.
2020-10-23Merge pull request #8782 from Pokechu22/missing-serial-version-dataLéo Lam
Explain how to fix "Serial and/or version data is missing"
2020-10-22DiscIO: Migrate logging over to fmtLioncash
Eliminates quite a bit of the PRI* macros used for handling 64-bit values.
2020-10-21Explain how to fix "Serial and/or version data is missing"Pokechu22
2020-10-19VolumeVerifier: Make "no valid data in partition" hide some other errorsJosJuice
Not much use in knowing that the H3 hashes are wrong when the partition consists of complete garbage.