From e3b2425ac0e38ef35d6493edc4a0a211959eb91d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 27 May 2018 18:53:18 +0300 Subject: fix for correct version info offset calculation --- plugins/PluginUpdater/src/checksum.cpp | 9 +++++++-- plugins/PluginUpdater/src/stdafx.h | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/PluginUpdater/src') diff --git a/plugins/PluginUpdater/src/checksum.cpp b/plugins/PluginUpdater/src/checksum.cpp index 2a1fd1b5a9..73d8a30734 100644 --- a/plugins/PluginUpdater/src/checksum.cpp +++ b/plugins/PluginUpdater/src/checksum.cpp @@ -19,6 +19,8 @@ int debug = 0; DWORD dwVersion = 0; +#pragma comment(lib, "version.lib") + struct MFileMapping { PBYTE ptr; @@ -205,8 +207,11 @@ LBL_NotPE: // patch version if (dwVersion) { shift = dwVersion - pISH->VirtualAddress + pISH->PointerToRawData; - VS_FIXEDFILEINFO *pVersion = (VS_FIXEDFILEINFO*)(map.ptr + shift); - pVersion->dwProductVersionLS = pVersion->dwProductVersionMS = 0; + + UINT blockSize; + VS_FIXEDFILEINFO *vsffi; + VerQueryValue(map.ptr + shift, L"\\", (PVOID*)&vsffi, &blockSize); + vsffi->dwProductVersionLS = vsffi->dwProductVersionMS = 0; } } diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index e90119bcd6..00be8fc56f 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -229,7 +229,6 @@ wchar_t* GetDefaultUrl(); bool DownloadFile(FILEURL *pFileURL, HNETLIBCONN &nlc); void ShowPopup(LPCTSTR Title, LPCTSTR Text, int Number); -void __stdcall RestartMe(void*); void __stdcall OpenPluginOptions(void*); void CheckUpdateOnStartup(); void InitTimer(void *type); -- cgit v1.2.3