1
0
mirror of synced 2024-11-28 01:10:55 +01:00

Change namespace

This commit is contained in:
esuo1198 2024-04-24 07:10:10 +09:00
parent 3920cc22df
commit 849bbaba62
9 changed files with 43 additions and 43 deletions

View File

@ -66,12 +66,12 @@ library(
'src/helpers.cpp',
'src/poll.cpp',
'src/bnusio.cpp',
'src/patches/jp_nov_2020.cpp',
'src/patches/jp_apr_2023.cpp',
'src/patches/cn_jun_2023.cpp',
'src/patches/audio.cpp',
'src/patches/qr.cpp',
'src/patches/amauth.cpp',
'src/patches/versions/JPN08.cpp',
'src/patches/versions/JPN39.cpp',
'src/patches/versions/CHN00.cpp',
],
name_prefix: ''
)

View File

@ -3,7 +3,7 @@
enum class GameVersion : XXH64_hash_t {
UNKNOWN = 0,
JP_NOV_2020 = 0x67C0F3042746D488,
JP_APR_2023 = 0x49F643ADB6B18705,
CN_JUN_2023 = 0xA7EE39F2CC2C57C8,
JPN08 = 0x67C0F3042746D488,
JPN39 = 0x49F643ADB6B18705,
CHN00 = 0xA7EE39F2CC2C57C8,
};

View File

@ -73,9 +73,9 @@ GetGameVersion () {
free (buf);
switch (gameVersion) {
case GameVersion::JP_NOV_2020:
case GameVersion::JP_APR_2023:
case GameVersion::CN_JUN_2023: break;
case GameVersion::JPN08:
case GameVersion::JPN39:
case GameVersion::CHN00: break;
default: MessageBoxA (nullptr, "Unknown game version", nullptr, MB_OK); ExitProcess (0);
}
}
@ -132,12 +132,12 @@ DllMain (HMODULE module, DWORD reason, LPVOID reserved) {
if (version == "auto") {
GetGameVersion ();
} else if (version == "jp_nov_2020") {
gameVersion = GameVersion::JP_NOV_2020;
} else if (version == "jp_apr_2023") {
gameVersion = GameVersion::JP_APR_2023;
} else if (version == "cn_jun_2023") {
gameVersion = GameVersion::CN_JUN_2023;
} else if (version == "JPN08") {
gameVersion = GameVersion::JPN08;
} else if (version == "JPN39") {
gameVersion = GameVersion::JPN39;
} else if (version == "CHN00") {
gameVersion = GameVersion::CHN00;
} else {
MessageBoxA (nullptr, "Unknown patch version", nullptr, MB_OK);
ExitProcess (0);
@ -186,9 +186,9 @@ DllMain (HMODULE module, DWORD reason, LPVOID reserved) {
switch (gameVersion) {
case GameVersion::UNKNOWN: break;
case GameVersion::JP_NOV_2020: patches::JP_NOV_2020::Init (); break;
case GameVersion::JP_APR_2023: patches::JP_APR_2023::Init (); break;
case GameVersion::CN_JUN_2023: patches::CN_JUN_2023::Init (); break;
case GameVersion::JPN08: patches::JPN08::Init (); break;
case GameVersion::JPN39: patches::JPN39::Init (); break;
case GameVersion::CHN00: patches::CHN00::Init (); break;
}
}
return true;

View File

@ -51,17 +51,17 @@ Init () {
}
switch (gameVersion) {
case GameVersion::JP_NOV_2020: {
case GameVersion::JPN08: {
INSTALL_HOOK_DYNAMIC (NUSCDeviceInit, ASLR (0x140692E00));
INSTALL_HOOK_DYNAMIC (LoadASIODriver, ASLR (0x14069B750));
break;
}
case GameVersion::JP_APR_2023: {
case GameVersion::JPN39: {
INSTALL_HOOK_DYNAMIC (NUSCDeviceInit, ASLR (0x1407C8620));
INSTALL_HOOK_DYNAMIC (LoadASIODriver, ASLR (0x1407D0F70));
break;
}
case GameVersion::CN_JUN_2023: {
case GameVersion::CHN00: {
INSTALL_HOOK_DYNAMIC (NUSCDeviceInit, ASLR (0x140777F70));
INSTALL_HOOK_DYNAMIC (LoadASIODriver, ASLR (0x1407808C0));
break;

View File

@ -1,13 +1,13 @@
namespace patches {
namespace JP_NOV_2020 {
namespace JPN08 {
void Init ();
} // namespace JP_NOV_2020
namespace JP_APR_2023 {
} // namespace JPN08
namespace JPN39 {
void Init ();
} // namespace JP_APR_2023
namespace CN_JUN_2023 {
} // namespace JPN39
namespace CHN00 {
void Init ();
} // namespace CN_JUN_2023
} // namespace CHN00
namespace Audio {
void Init ();
} // namespace Audio

View File

@ -197,7 +197,7 @@ Update () {
if (!qrEnabled) return;
if (gState == State::Ready) {
if (IsButtonTapped (CARD_INSERT_1)) {
if (gameVersion != GameVersion::CN_JUN_2023) return;
if (gameVersion != GameVersion::CHN00) return;
std::cout << "Insert" << std::endl;
accessCode = "BNTTCNID";
@ -205,7 +205,7 @@ Update () {
gState = State::CopyWait;
gMode = Mode::Card;
} else if (IsButtonTapped (CARD_INSERT_2)) {
if (gameVersion != GameVersion::CN_JUN_2023) return;
if (gameVersion != GameVersion::CHN00) return;
std::cout << "Insert" << std::endl;
accessCode = "BNTTCNID";
@ -267,7 +267,7 @@ Init () {
SetConsoleOutputCP (CP_UTF8);
auto amHandle = (u64)GetModuleHandle ("AMFrameWork.dll");
switch (gameVersion) {
case GameVersion::JP_NOV_2020: {
case GameVersion::JPN08: {
INSTALL_HOOK_DYNAMIC (qrInit, (LPVOID)(amHandle + 0x1BA00));
INSTALL_HOOK_DYNAMIC (qrRead, (LPVOID)(amHandle + 0x1BC20));
INSTALL_HOOK_DYNAMIC (qrClose, (LPVOID)(amHandle + 0x1BBD0));
@ -279,7 +279,7 @@ Init () {
INSTALL_HOOK_DYNAMIC (copy_data, (LPVOID)(amHandle + 0x1C2A0));
break;
}
case GameVersion::JP_APR_2023: {
case GameVersion::JPN39: {
INSTALL_HOOK_DYNAMIC (qrInit, (LPVOID)(amHandle + 0x1EDC0));
INSTALL_HOOK_DYNAMIC (qrRead, (LPVOID)(amHandle + 0x1EFB0));
INSTALL_HOOK_DYNAMIC (qrClose, (LPVOID)(amHandle + 0x1EF60));
@ -291,7 +291,7 @@ Init () {
INSTALL_HOOK_DYNAMIC (copy_data, (LPVOID)(amHandle + 0x1F630));
break;
}
case GameVersion::CN_JUN_2023: {
case GameVersion::CHN00: {
INSTALL_HOOK_DYNAMIC (qrInit, (LPVOID)(amHandle + 0x161B0));
INSTALL_HOOK_DYNAMIC (qrRead, (LPVOID)(amHandle + 0x163A0));
INSTALL_HOOK_DYNAMIC (qrClose, (LPVOID)(amHandle + 0x16350));

View File

@ -1,10 +1,10 @@
#include "../patches.h"
#include "helpers.h"
#include "patches.h"
#include <safetyhook.hpp>
extern std::string chassisId;
namespace patches::CN_JUN_2023 {
namespace patches::CHN00 {
u8 *haspBuffer;
HOOK (i32, HaspDecrypt, PROC_ADDRESS ("hasp_windows_x64.dll", "hasp_decrypt")) { return 0; }
@ -133,8 +133,8 @@ Init () {
xRes = readConfigInt (res, "x", xRes);
yRes = readConfigInt (res, "y", yRes);
}
vsync = readConfigBool (patches, "vsync", vsync);
unlockSongs = readConfigBool (patches, "unlock_songs", unlockSongs);
vsync = readConfigBool (patches, "vsync", vsync);
unlockSongs = readConfigBool (patches, "unlock_songs", unlockSongs);
auto cn_jun_2023 = openConfigSection (patches, "cn_jun_2023");
if (cn_jun_2023) {
fixLanguage = readConfigBool (cn_jun_2023, "fix_language", fixLanguage);
@ -220,4 +220,4 @@ Init () {
patches::Audio::Init ();
patches::Qr::Init ();
}
} // namespace patches::CN_JUN_2023
} // namespace patches::CHN00

View File

@ -1,5 +1,5 @@
#include "../patches.h"
#include "helpers.h"
#include "patches.h"
#include <safetyhook.hpp>
extern u64 song_data_size;
@ -11,7 +11,7 @@ extern void *song_data;
instruction, (u8)(u64)(location), (u8)((u64)(location) >> 8), (u8)((u64)(location) >> 16), (u8)((u64)(location) >> 24), (u8)((u64)(location) >> 32), (u8)((u64)(location) >> 40), \
(u8)((u64)(location) >> 48), (u8)((u64)(location) >> 56)
namespace patches::JP_NOV_2020 {
namespace patches::JPN08 {
HOOK_DYNAMIC (char, __fastcall, AMFWTerminate, i64) { return 0; }
@ -179,4 +179,4 @@ Init () {
patches::Qr::Init ();
patches::AmAuth::Init ();
}
} // namespace patches::JP_NOV_2020
} // namespace patches::JPN08

View File

@ -1,8 +1,8 @@
#include "../patches.h"
#include "helpers.h"
#include "patches.h"
#include <safetyhook.hpp>
namespace patches::JP_APR_2023 {
namespace patches::JPN39 {
HOOK_DYNAMIC (char, __fastcall, AMFWTerminate, i64) { return 0; }
@ -138,4 +138,4 @@ Init () {
patches::Qr::Init ();
patches::AmAuth::Init ();
}
} // namespace patches::JP_APR_2023
} // namespace patches::JPN39