mirror of
https://github.com/HolographicHat/Yae.git
synced 2026-03-23 21:09:45 +08:00
4.8
This commit is contained in:
@@ -15,20 +15,12 @@ namespace Genshin {
|
||||
|
||||
using std::string;
|
||||
|
||||
void InitIL2CPP(void* &ppRecordUserData) {
|
||||
void InitIL2CPP() {
|
||||
TCHAR szFileName[MAX_PATH];
|
||||
GetModuleFileName(nullptr, szFileName, MAX_PATH);
|
||||
const auto isCN = strstr(szFileName, "YuanShen.exe");
|
||||
const auto uBase = reinterpret_cast<uint64_t>(GetModuleHandle("UserAssembly.dll"));
|
||||
const auto uBase = reinterpret_cast<uint64_t>(GetModuleHandle(isCN ? "YuanShen.exe" : "GenshinImpact.exe"));
|
||||
#define DO_APP_FUNC(ca, oa, r, n, p) n = (r (*) p)(uBase + (isCN ? ca : oa))
|
||||
#include "il2cpp-functions.h"
|
||||
#undef DO_APP_FUNC
|
||||
auto sPtr = reinterpret_cast<uint8_t*>(RecordUserData);
|
||||
for (int i = 0; i < 0x64; ++i) {
|
||||
if ((*(uint32_t*) sPtr & 0xFFFFFF) == 0x25FF48) { // 48 FF 25 ??
|
||||
ppRecordUserData = sPtr + 7 + *(int*) (sPtr + 3);
|
||||
break;
|
||||
}
|
||||
sPtr += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user