1
1
mirror of synced 2025-02-25 05:44:43 +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"; auto configPath = std::filesystem::current_path () / "config.toml";
toml_table_t *config = openConfig (configPath); toml_table_t *config = openConfig (configPath);
if (config) { if (config) {
auto amauth = openConfigSection(config, "amauth"); auto amauth = openConfigSection (config, "amauth");
if (amauth) { if (amauth) {
server = readConfigString(amauth, "server", server); server = readConfigString (amauth, "server", server);
} }
toml_free (config); toml_free (config);
} }

View File

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

View File

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

View File

@ -17,10 +17,13 @@ enum class State {
Ready, Ready,
CopyWait, CopyWait,
AfterCopy1, AfterCopy1,
AfterCopy2, AfterCopy2
}; };
enum class Mode { Card, Data }; enum class Mode {
Card,
Data
};
State gState = State::Ready; State gState = State::Ready;
Mode gMode = Mode::Card; 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) { if (gMode == Mode::Card) {
std::string card = ""; std::string card = "";
if (config) { if (config) {
auto qr = openConfigSection(config, "qr"); auto qr = openConfigSection (config, "qr");
if (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); 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); songNoes = readConfigIntArray (data, "song_no", songNoes);
} }
} }
toml_free (config);
} }
BYTE serial_length = static_cast<BYTE> (serial.size ()); BYTE serial_length = static_cast<BYTE> (serial.size ());