1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-30 18:24:36 +01:00

Hardcoded symbols for 22000.282

This commit is contained in:
Valentin Radu 2021-10-25 05:43:21 +03:00
parent e997c67da3
commit 72b66ebf6b
2 changed files with 178 additions and 149 deletions

View File

@ -518,6 +518,46 @@ BOOL LoadSymbols(symbols_addr* symbols_PTRS, HMODULE hModule)
DWORD dwDisposition;
DWORD dwSize = sizeof(DWORD);
RTL_OSVERSIONINFOW rovi;
DWORD32 ubr = VnGetOSVersionAndUBR(&rovi);
TCHAR szReportedVersion[MAX_PATH + 1];
ZeroMemory(
szReportedVersion,
(MAX_PATH + 1) * sizeof(TCHAR)
);
TCHAR szStoredVersion[MAX_PATH + 1];
ZeroMemory(
szStoredVersion,
(MAX_PATH + 1) * sizeof(TCHAR)
);
wsprintf(
szReportedVersion,
L"%d.%d.%d.%d",
rovi.dwMajorVersion,
rovi.dwMinorVersion,
rovi.dwBuildNumber,
ubr
);
if (IsBuild22000_282(rovi, ubr))
{
symbols_PTRS->twinui_pcshell_PTRS[0] = 0x217CE6;
symbols_PTRS->twinui_pcshell_PTRS[1] = 0x5CC570;
symbols_PTRS->twinui_pcshell_PTRS[2] = 0x5F5E88;
symbols_PTRS->twinui_pcshell_PTRS[3] = 0x5F6690;
symbols_PTRS->twinui_pcshell_PTRS[4] = 0x5DAC08;
symbols_PTRS->twinui_pcshell_PTRS[5] = 0x5DA8C4;
symbols_PTRS->twinui_pcshell_PTRS[6] = 0x5CD9C0;
symbols_PTRS->twinui_pcshell_PTRS[7] = 0x52980;
symbols_PTRS->startdocked_PTRS[0] = 0x188EBC;
symbols_PTRS->startdocked_PTRS[1] = 0x188EBC;
symbols_PTRS->startdocked_PTRS[2] = 0x187120;
symbols_PTRS->startdocked_PTRS[3] = 0x3C10;
symbols_PTRS->startdocked_PTRS[4] = 0x160AEC;
}
else
{
RegCreateKeyExW(
HKEY_CURRENT_USER,
TEXT(REGPATH) L"\\" TEXT(TWINUI_PCSHELL_SB_NAME),
@ -655,6 +695,7 @@ BOOL LoadSymbols(symbols_addr* symbols_PTRS, HMODULE hModule)
&dwSize
);
if (hKey) RegCloseKey(hKey);
}
BOOL bNeedToDownload = FALSE;
for (UINT i = 0; i < sizeof(symbols_addr) / sizeof(DWORD); ++i)
@ -666,26 +707,6 @@ BOOL LoadSymbols(symbols_addr* symbols_PTRS, HMODULE hModule)
bNeedToDownload = TRUE;
}
}
RTL_OSVERSIONINFOW rovi;
DWORD32 ubr = VnGetOSVersionAndUBR(&rovi);
TCHAR szReportedVersion[MAX_PATH + 1];
ZeroMemory(
szReportedVersion,
(MAX_PATH + 1) * sizeof(TCHAR)
);
TCHAR szStoredVersion[MAX_PATH + 1];
ZeroMemory(
szStoredVersion,
(MAX_PATH + 1) * sizeof(TCHAR)
);
wsprintf(
szReportedVersion,
L"%d.%d.%d.%d",
rovi.dwMajorVersion,
rovi.dwMinorVersion,
rovi.dwBuildNumber,
ubr
);
RegCreateKeyExW(
HKEY_CURRENT_USER,
TEXT(REGPATH),
@ -707,7 +728,7 @@ BOOL LoadSymbols(symbols_addr* symbols_PTRS, HMODULE hModule)
&dwSize
);
RegCloseKey(hKey);
if (!bNeedToDownload)
if (!bNeedToDownload && !IsBuild22000_282(rovi, ubr))
{
bNeedToDownload = wcscmp(szReportedVersion, szStoredVersion);
}

View File

@ -41,4 +41,12 @@ typedef struct _DownloadSymbolsParams
DWORD DownloadSymbols(DownloadSymbolsParams* params);
BOOL LoadSymbols(symbols_addr* symbols_PTRS, HMODULE hModule);
inline BOOL IsBuild22000_282(RTL_OSVERSIONINFOW rovi, DWORD32 ubr)
{
return (rovi.dwMajorVersion == 10 &&
rovi.dwMinorVersion == 0 &&
rovi.dwBuildNumber == 22000 &&
ubr == 282);
}
#endif