1
1
mirror of synced 2025-02-24 21:34:44 +01:00
This commit is contained in:
esuo1198 2023-09-24 01:35:01 +09:00
parent db6a0c061b
commit bde65eec20
4 changed files with 26 additions and 23 deletions

View File

@ -114,9 +114,9 @@ DllMain (HMODULE module, DWORD reason, LPVOID reserved) {
auto configPath = std::filesystem::current_path () / "config.toml";
toml_table_t *config = openConfig (configPath);
if (config) {
auto amauth = openConfigSection(config, "amauth");
auto amauth = openConfigSection (config, "amauth");
if (amauth) {
server = readConfigString(amauth, "server", server);
server = readConfigString (amauth, "server", server);
}
toml_free (config);
}

View File

@ -22,8 +22,8 @@ HOOK (i32, HaspRead, PROC_ADDRESS ("hasp_windows_x64.dll", "hasp_read"), i32, i3
void
Init () {
i32 xRes = 1360;
i32 yRes = 768;
i32 xRes = 1920;
i32 yRes = 1080;
bool unlockSongs = true;
bool sharedAudio = true;
bool vsync = false;
@ -48,7 +48,7 @@ Init () {
auto configPath = std::filesystem::current_path () / "config.toml";
toml_table_t *config = openConfig (configPath);
if (config) {
auto patches = openConfigSection(config, "patches");
auto patches = openConfigSection (config, "patches");
if (patches) {
auto res = openConfigSection (patches, "res");
if (res) {

View File

@ -13,8 +13,8 @@ void *song_data;
namespace patches::JP_NOV_2020 {
void
Init () {
i32 xRes = 1360;
i32 yRes = 768;
i32 xRes = 1920;
i32 yRes = 1080;
bool unlockSongs = true;
bool sharedAudio = true;
bool vsync = false;
@ -22,7 +22,7 @@ Init () {
auto configPath = std::filesystem::current_path () / "config.toml";
toml_table_t *config = openConfig (configPath);
if (config) {
auto patches = openConfigSection(config, "patches");
auto patches = openConfigSection (config, "patches");
if (patches) {
auto res = openConfigSection (patches, "res");
if (res) {
@ -119,18 +119,17 @@ Init () {
}
// Move various files to current directory
auto amHandle = GetModuleHandle ("AMFrameWork.dll");
WRITE_MEMORY ((u64)amHandle + 0x33EF7, u8, 0xEB);
WRITE_MEMORY ((u64)amHandle + 0x3404A, u8, 0xEB);
WRITE_MEMORY ((u64)amHandle + 0x34429, u8, 0xEB);
WRITE_MEMORY ((u64)amHandle + 0x3457C, u8, 0xEB);
WRITE_MEMORY ((u64)amHandle + 0x3497A, u8, 0xEB);
WRITE_MEMORY ((u64)amHandle + 0x34ACD, u8, 0xEB);
WRITE_MEMORY ((u64)amHandle + 0x148AF, u8, 0xEB);
WRITE_MEMORY ((u64)amHandle + 0x14A1A, u8, 0xEB);
auto amHandle = reinterpret_cast<uintptr_t> (GetModuleHandle ("AMFrameWork.dll"));
WRITE_MEMORY (amHandle + 0x33EF7, u8, 0xEB);
WRITE_MEMORY (amHandle + 0x3404A, u8, 0xEB);
WRITE_MEMORY (amHandle + 0x34429, u8, 0xEB);
WRITE_MEMORY (amHandle + 0x3457C, u8, 0xEB);
WRITE_MEMORY (amHandle + 0x3497A, u8, 0xEB);
WRITE_MEMORY (amHandle + 0x34ACD, u8, 0xEB);
WRITE_MEMORY (amHandle + 0x148AF, u8, 0xEB);
WRITE_MEMORY (amHandle + 0x14A1A, u8, 0xEB);
patches::Qr::Init ();
patches::AmAuth::Init ();
}
} // namespace patches::JP_NOV_2020

View File

@ -17,10 +17,13 @@ enum class State {
Ready,
CopyWait,
AfterCopy1,
AfterCopy2,
AfterCopy2
};
enum class Mode { Card, Data };
enum class Mode {
Card,
Data
};
State gState = State::Ready;
Mode gMode = Mode::Card;
@ -72,11 +75,11 @@ HOOK_DYNAMIC (int64_t, __fastcall, copy_data, int64_t this_, void *dest, int len
if (gMode == Mode::Card) {
std::string card = "";
if (config) {
auto qr = openConfigSection(config, "qr");
auto qr = openConfigSection (config, "qr");
if (qr) {
card = readConfigString(qr, "card", "");
card = readConfigString (qr, "card", "");
}
toml_free(config);
toml_free (config);
}
memcpy (dest, card.c_str (), card.size () + 1);
@ -97,6 +100,7 @@ HOOK_DYNAMIC (int64_t, __fastcall, copy_data, int64_t this_, void *dest, int len
songNoes = readConfigIntArray (data, "song_no", songNoes);
}
}
toml_free (config);
}
BYTE serial_length = static_cast<BYTE> (serial.size ());