Commit Graph

808 Commits

Author SHA1 Message Date
David Korth
2029a71346 [cmake] CheckNettle2or3.cmake: Also export NETTLE_FOUND in the PARENT_SCOPE.
NETTLE_FOUND may be used to determine if libnettle should be
linked to other libraries and/or executables.

This fixes a regression from commit 03ce73c612.
([cmake] CheckNettle2or3.cmake: Convert the macro to a function.)
2024-05-17 22:42:35 -04:00
David Korth
f86d5c4ad4 [cmake] CheckNettle2or3.cmake: Set HAVE_NETTLE locally *and* in PARENT_SCOPE.
Otherwise, encryption will be disabled, even if Nettle is available.

This fixes a regression from commit 03ce73c612.
([cmake] CheckNettle2or3.cmake: Convert the macro to a function.)

Also, remove the ENABLE_DECRYPTION section. That's a leftover from
rom-properties, and rvthtool *requires* support for decryption.
2024-05-17 22:37:44 -04:00
David Korth
86d340d407 [nusresign] print-info.cpp: Open the TMD using "rb", not "rb+".
We don't need to write to the TMD here.
2024-05-17 22:29:46 -04:00
David Korth
3aaa8363a4 appveyor-dpkg.sh: Missing '#' in the shebang. 2024-04-27 00:40:06 -04:00
David Korth
634438cc4a appveyor.yml: Remove clone_folder.
It's not needed, and it confuses the Linux builds.
2024-04-27 00:23:26 -04:00
David Korth
36324703d8 appveyor.cmd: Assume MSVC 2013 if %compiler% isn't set.
TODO: Restore MinGW-w64 support?
2024-04-27 00:05:20 -04:00
David Korth
17bf805ee3 Add AppVeyor Linux compile testing; remove travis-ci configuration files. 2024-04-27 00:01:41 -04:00
David Korth
658e84f06c appveyor.yml: Ignore the l10n_master branch from Crowdin. 2024-04-26 23:55:40 -04:00
David Korth
e2f342d38a [locale] Add initial (blank) translation files for de and es. 2024-04-26 22:37:02 -04:00
David Korth
fa815bb2b8 crowdin.yml: Initial Crowdin configuration file.
FIXME: rvthtool_en.ts is both a source *and* a translation file.
2024-04-26 22:31:58 -04:00
David Korth
a05900e7a1 README.md: No more travis-ci. 2024-04-26 21:47:57 -04:00
David Korth
e7c1eda56c [locale] Updated the translation files using lupdate.sh. 2024-04-26 21:46:45 -04:00
David Korth
736d626554 [cmake] CPUInstructionSetFlags.cmake: PowerPC should set CPU_ppc64 or CPU_ppc, *not* CPU_arm64 or CPU_arm.
Copy/paste error. Oops.

(copied over from rom-properties)
2024-04-26 21:30:17 -04:00
David Korth
eec1d68907 [cmake] Check64BitTimeSupport.cmake: Don't set TMP_TIME64_FOUND_TIME_BITS if C++ support is broken.
Not sure how I didn't notice this before... (probably because
I don't regularly test the 32-bit i386 version, and Ubuntu
didn't ship glibc-2.34 in any LTS releases.)

(copied over from rom-properties)
2024-04-26 21:29:20 -04:00
David Korth
8ef919bbcb [cmake] cmake_uninstall.cmake.in: Use EXECUTE_PROCESS() instead of EXEC_PROGRAM().
EXECUTE_PROCESS() has been around since at least 3.0, and EXEC_PROGRAM()
is deprecated as of 3.28:

CMake Warning (dev) at cmake/cmake_uninstall.cmake:12 (EXEC_PROGRAM):
  Policy CMP0153 is not set: The exec_program command should not be called.
  Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Use execute_process() instead.

(copied over from rom-properties)
2024-04-26 21:26:51 -04:00
David Korth
a2d0f7b31f [librvth] RefFile.hpp: Remove the C compatibility hack.
It's no longer needed.
2024-02-21 23:17:40 -05:00
David Korth
2c1220988e [librvth] RvtH::extract(): Fix a potential memory leak in an error path.
Found using clang-tidy from clang-17.0.1:

src/librvth/extract.cpp:513:11: warning: Potential leak of memory pointed to by 'sdk_header' [clang-analyzer-unix.Malloc]
  513 |                         ret = -errno;
      |                                ^
2024-02-20 23:56:20 -05:00
David Korth
fdc8c01367 [libwiicrypto] cert.c, cert_realsign_ticketOrTMD(): Remove duplicate initialization of hash_size.
Found using clang-tidy from clang-17.0.1.:

src/libwiicrypto/cert.c:533:4: warning: Value stored to 'hash_size' is never read [clang-analyzer-deadcode.DeadStores]
  533 |                         hash_size = SHA1_DIGEST_SIZE;
      |                         ^
src/libwiicrypto/cert.c:533:4: note: Value stored to 'hash_size' is never read
src/libwiicrypto/cert.c:537:4: warning: Value stored to 'hash_size' is never read [clang-analyzer-deadcode.DeadStores]
  537 |                         hash_size = SHA256_DIGEST_SIZE;
      |                         ^
src/libwiicrypto/cert.c:537:4: note: Value stored to 'hash_size' is never read
2024-02-20 23:53:09 -05:00
David Korth
e3f6c26281 [cmake] SplitDebugInformation.cmake: Add --strip-all to the second objcopy command.
Combining the removal of .gnu_debuglink into the objcopy command had the
effect of losing `strip`'s usual stripping functionality. Add the
`--strip-all` parameter to restore it.

Copied over from rom-properties.

This fixes a regression from commit 43372103cb.
(Port over CMake changes from rom-properties.)
2024-02-20 23:44:36 -05:00
David Korth
03ce73c612 [cmake] CheckNettle2or3.cmake: Convert the macro to a function.
Set HAVE_NETTLE in PARENT_SCOPE.
2024-02-20 23:43:07 -05:00
David Korth
6c0cd37d14 Update the startup message copyright years in command-line tools. 2024-02-20 23:33:50 -05:00
David Korth
1d2731e2e4 [qrvthtool] Update copyright years. 2024-02-20 23:32:51 -05:00
David Korth
c3e5186d58 [qrvthtool] MessageSound: The KF6 Framework Integration Plugin is in kf6/. 2024-02-20 23:28:14 -05:00
David Korth
754a2da58b [qrvthtool] Replace deprecated <=qt-4.7 QtDBus annotations with current ones. 2024-02-20 19:49:49 -05:00
David Korth
5eef2e9221 [qrvthtool] Update to build with KF6 if QT_VERSION == 6.
- Set KF_NS == KF5 or KF6.
- Increase the minimum version for ECM for KF6.
- Link to the correct KF WidgetsAddons library.
- Use HAVE_KF_WidgetsAddons instead of HAVE_KF5WIDGETSADDONS.
- Use HAVE_QtDBus instead of HAVE_Qt5DBus.
2024-02-20 19:40:01 -05:00
David Korth
66c8afb410 Increase minimum CMake version to 3.5; move CMP0048/CMP0063 settings to the top-level CMakeLists.txt file.
Ubuntu 16.04 has CMake 3.5, so we can target that as the minimum
version. Also, recent CMake versions (3.27+) have started printing
warnings if the minimum is less than 3.5.

CMake Deprecation Warning at CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

Also, remove CMAKE_MINIMUM_REQUIRED() from all subdirectories.
2024-02-20 19:23:06 -05:00
David Korth
46b533520b [nusresign] print-info.cpp: If lowercase CID files don't exist, try with an uppercase CID.
This is needed in some cases on Linux systems.
2024-01-24 22:34:58 -05:00
David Korth
1ceacfffa1 [nusresign] print-info.cpp: Explicitly cast title version values to unsigned int.
Should fix a printf format string error on some systems where gcc
implicitly converts the shifted value to int.
2024-01-21 20:34:55 -05:00
David Korth
f00669ca87 [wadresign] Increase maximum WAD size from 128 MB to 256 MB. 2023-12-10 18:02:21 -05:00
David Korth
b2f5d8977d [qrvthtool] AboutDialog: nettle-3.9.1 was released in 2023. 2023-11-25 12:09:30 -05:00
David Korth
fcf321dea7 [nettle] Update the Win32 precompiled build of Nettle from 3.8.1 to 3.9.1.
Compiled using gcc-13.2.0 and MinGW-w64 11.0.0.

NOTE: The .debug files are no longer included because no one used them.
2023-11-25 12:05:48 -05:00
David Korth
983d6c624b [qrvthtool] AboutDialog: MSVC 2013 doesn't like it when we put the git version macros in QStringLiteral. 2023-11-25 11:32:14 -05:00
David Korth
abd8543660 [qrvthtool] MSVC 2013 doesn't like concatenated strings within QStringLiteral.
We're still using MSVC 2013 in the AppVeyor build right now.

Also, the APLERR_SIMMEMSIZE_NOT_LE_PHYSMEMSIZE message was missing a space
after the first line. In the rvthtool CLI, a newline is used instead of a
space.
2023-11-25 11:09:08 -05:00
David Korth
bc65a8b5a1 [qrvthtool] Use the multi-string QString::arg() functions instead of repeated arg() calls where possible. 2023-11-25 10:58:28 -05:00
David Korth
22ce6af987 [qrvthtool] Use QStringLiteral instead of QLatin1String, QString::fromLatin1(), or QString::fromUtf8() where possible.
QStringLiteral encodes a QString struct directly into the executable.
This has some more overhead compared to a Latin-1 or UTF-8 string,
but it means nothing needs to be copied into RAM at runtime.

Related changes:
- Consolidate some string building into QStringLiteral().arg().
- Update copyrights for 2023 where applicable.
2023-11-25 10:53:23 -05:00
David Korth
5e0a1ba149 [qrvthtool] QRvtHToolWindowPrivate::getDisplayFileName(): Use a case-insensitive string comparison on Windows.
Similar to qrvthtool.cpp.
2023-11-25 10:49:25 -05:00
David Korth
0f4d834813 [qrvthtool] qrvthtool.cpp: Also fix Qt::CaseInsensitive's position.
It's an argument for filename.startsWith(), not QLatin1String().

This seemingly didn't cause a problem with QLatin1String, since the
constructor takes an optional size parameter. It didn't *work*
correctly, though.

This *does* cause a problem when switching to QStringLiteral.
2023-11-25 10:43:55 -05:00
David Korth
c68875d5c0 [qrvthtool] qrvthtool.cpp: The device name check was backwards.
It's "\\\\.\\PhysicalDrive" for Windows, and "/dev/" for Linux and other
Unix-like operating systems.
2023-11-25 10:41:22 -05:00
David Korth
64e16c74bd [qrvthtool] qrvthtool.cpp: Remove ".desktop" from the desktop filename.
Qt6 complains:

QGuiApplication::setDesktopFileName: the specified desktop file name ends
with .desktop. For compatibility reasons, the .desktop suffix will be
removed. Please specify a desktop file name without .desktop suffix
2023-11-25 10:20:43 -05:00
David Korth
3dc3a473ed [qrvthtool] MessageWidgetStack: Delete all MessageWidgets before clearing d->messageWidgets.
Otherwise, stray deletion signals could trigger messageWidget_destroyed_slot()
after the std::set is deleted, which results in a crash.
2023-11-25 10:17:16 -05:00
David Korth
46430299a7 [qrvthtool] MessageWidgetStack: Use std::set instead of QSet.
It's crashing on Windows if a MessageWidget is visible when closing
the main window. Something is trying to use the std::set (and previously
the QSet) after it's destroyed...
2023-11-25 10:13:51 -05:00
David Korth
43372103cb Port over CMake changes from rom-properties.
- CPUInstructionSetFlags.cmake: Add more CPU architectures.

- DirInstallPaths.cmake: Set ${TARGET_CPU_ARCH} and add more
  CPU architectures.

- FindNETTLE.cmake: Use ${TARGET_CPU_ARCH}.

- SplitDebugInformation.cmake: Add the `mold` workaround.

- options.cmake: Disable split debug by default on macOS.

- platform.cmake: Minor cleanups.

- gcc.cmake: Code coverage cleanup, check for "--no-undefined" and
  "--no-allow-shlib-undefined" (but only allow them on Linux),
  and check for "-ftree-vectorize".

- msvc.cmake:
  - Add: /we4477 /MP /guard:cf /guard:ehcont /permissive-
  - On i386 only: /SAFESEH
  - Disable /Zc:externC /Zc:noexceptTypes on Clang.
  - Disable thread-safe statics only on i386 and amd64.

- win32-gcc.cmake, win32-msvc.cmake:
  - Various flag changes.
2023-11-25 10:09:48 -05:00
David Korth
6b49dfaa0f CMakeLists.txt: FIXME: Windows SDK prior to 10.0.18362.0 has issues when compiling as either C11 or C17.
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winbase.h(8816,5): warning C5105: macro expansion producing 'defined' has undefined behavior
C:\Program Files (x86)\Windows Kits\8.1\Include\um\oaidl.h(473,17): warning C5103: pasting '/' and '/' does not result in a valid preprocessing token
C:\Program Files (x86)\Windows Kits\8.1\Include\shared\wtypes.h(742,1): message : in expansion of macro '_VARIANT_BOOL'
C:\Program Files (x86)\Windows Kits\8.1\Include\um\oaidl.h(473,17): error C2059: syntax error: '/'

Force C99 when compiling with MSVC for now.
2023-11-25 09:44:46 -05:00
David Korth
af560c4ee9 Use CMAKE_<LANG>_STANDARD instead of custom macros.
CMake 3.1 added CMAKE_<LANG>_STANDARD, which allows CMake to determine
what flags are needed to select a particular language version.

Set it to C17 and C++17. Previously, we were using C11 and C++11,
though gcc11 switched the default C++ version to C++17. The custom
macro handled this by not adding flags for C++, but it still added
the C11 flag, which prevented use of C17.

Ported over from rom-properties.
2023-11-25 09:43:53 -05:00
David Korth
f43a461c35 [rvthtool] verify.cpp: Fix a few TCHAR errors. [missing _T() macros]
verify.cpp(180,13): warning C4477: 'wprintf' : format string '%s' requires
an argument of type 'wchar_t *', but variadic argument 3 has type 'const char *'

verify.cpp(182,13): warning C4477: 'wprintf' : format string '%s' requires
an argument of type 'wchar_t *', but variadic argument 2 has type 'const char *'
2023-11-25 09:37:14 -05:00
David Korth
95d3c50b7f .gitignore: Don't ignore .a files.
Add the 64-bit versions of libhogweed.dll.a and libnettle.dll.a
to the repository.

NOTE: This was originally done on 2022/08/07 06:25 PM EDT, but I forgot
to commit the changes...
2023-11-25 09:31:53 -05:00
David Korth
a2bcb8ac1e [librvth] Reader.cpp: Add some more SDK header detection code from rom-properties. 2022-09-17 21:11:33 -04:00
David Korth
4179a5dcdf [rvthtool] verify.cpp: Print better messages for disc images. 2022-08-16 01:04:26 -04:00
David Korth
d92bfecd7b [rvthtool] verify.cpp: Print the total number of hash errors.
[librvth] RvtH::verifyWiiPartitions(): Accept a pointer to a 5-element
unsigned int array to get the total number of hash errors. This is for
both actual hash errors and hash table copy errors.
2022-08-16 01:00:42 -04:00
David Korth
5601647630 [rvthtool] query.c: #include "tcharx.h"
The no-query path uses _fputts(), which requires tcharx.h on Linux.
2022-08-16 00:48:49 -04:00