diff --git a/lib/src/dllmain.cpp b/lib/src/dllmain.cpp index 04a91f5..73b960d 100644 --- a/lib/src/dllmain.cpp +++ b/lib/src/dllmain.cpp @@ -32,7 +32,7 @@ namespace Hook { uint16_t BitConverter_ToUInt16(ByteArray* val, const int startIndex) { const auto ret = CALL_ORIGIN(BitConverter_ToUInt16, val, startIndex); - if (ret == 0xAB89 && ReadMapped(val->vector, 2) == 1655) { + if (ret == 0xAB89 && ReadMapped(val->vector, 2) == 7450) { const auto headLength = ReadMapped(val->vector, 4); const auto dataLength = ReadMapped(val->vector, 6); const auto cStr = base64_encode(val->vector + 10 + headLength, dataLength) + "\n"; @@ -45,8 +45,8 @@ namespace Hook { } void Run(HMODULE* phModule) { - //AllocConsole(); - //freopen_s((FILE**)stdout, "CONOUT$", "w", stdout); + AllocConsole(); + freopen_s((FILE**)stdout, "CONOUT$", "w", stdout); while ((unityWnd = FindMainWindowByPID(GetCurrentProcessId())) == nullptr) { Sleep(1000); } @@ -63,6 +63,7 @@ void Run(HMODULE* phModule) { checksum += string(reinterpret_cast(&result->vector[0]), result->max_length); baClass = result->klass; } + printf("Checksum=%s\n", checksum.c_str()); HookManager::install(Genshin::BitConverter_ToUInt16, Hook::BitConverter_ToUInt16); *(void**) ppRecordUserData = (void*) &Hook::UnityEngine_RecordUserData; hPipe = CreateFile(R"(\\.\pipe\YaeAchievementPipe)", GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr); diff --git a/lib/src/il2cpp-functions.h b/lib/src/il2cpp-functions.h index ab4a9be..2665c5f 100644 --- a/lib/src/il2cpp-functions.h +++ b/lib/src/il2cpp-functions.h @@ -2,8 +2,8 @@ using namespace Genshin; // DO_APP_FUNC(CN_OFFSET, OS_OFFSET, RETURN, FUNC_NAME, (ARGS...)); -DO_APP_FUNC(0x00522FD0, 0x00522840, ByteArray*, il2cpp_array_new_specific, (void* arrayTypeInfo, uint64_t length)); +DO_APP_FUNC(0x005DDC40, 0x006A2A90, ByteArray*, il2cpp_array_new_specific, (void* arrayTypeInfo, uint64_t length)); -DO_APP_FUNC(0x07315A30, 0x0710F580, ByteArray*, RecordUserData, (int32_t nType)); +DO_APP_FUNC(0x06F7D5B0, 0x06C68BE0, ByteArray*, RecordUserData, (int32_t nType)); -DO_APP_FUNC(0x0D257150, 0x0D244830, uint16_t, BitConverter_ToUInt16, (ByteArray* val, int startIndex)); +DO_APP_FUNC(0x0D1C10F0, 0x0D1BA490, uint16_t, BitConverter_ToUInt16, (ByteArray* val, int startIndex)); diff --git a/res/proto/AchievementAllDataNotify.proto b/res/proto/AchievementAllDataNotify.proto index a737783..2c1420a 100644 --- a/res/proto/AchievementAllDataNotify.proto +++ b/res/proto/AchievementAllDataNotify.proto @@ -10,12 +10,12 @@ message Achievement { REWARD_TAKEN = 3; } uint32 timestamp = 13; - uint32 current = 6; + uint32 current = 15; uint32 total = 9; - uint32 id = 1; - Status status = 2; + uint32 id = 14; + Status status = 8; } message AchievementAllDataNotify { - repeated Achievement list = 11; + repeated Achievement list = 8; } diff --git a/src/GlobalVars.cs b/src/GlobalVars.cs index 271b3d5..68773ac 100644 --- a/src/GlobalVars.cs +++ b/src/GlobalVars.cs @@ -20,8 +20,8 @@ public static class GlobalVars { public static readonly string CachePath = Path.Combine(DataPath, "cache"); public static readonly string LibFilePath = Path.Combine(DataPath, "YaeAchievement.dll"); - public const uint AppVersionCode = 46; - public const string AppVersionName = "3.6"; + public const uint AppVersionCode = 47; + public const string AppVersionName = "3.7"; public const string PipeName = "YaeAchievementPipe"; public const string BucketHost = "https://cn-cd-1259389942.file.myqcloud.com";