summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/checksum.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-27 18:53:18 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-27 18:53:18 +0300
commite3b2425ac0e38ef35d6493edc4a0a211959eb91d (patch)
tree7a80e334998b863a90459d45bc597e8d0ad7ae3b /plugins/PluginUpdater/src/checksum.cpp
parentf4d63038321dc6b1abe0f7fdb0e824ba66d3917f (diff)
fix for correct version info offset calculation
Diffstat (limited to 'plugins/PluginUpdater/src/checksum.cpp')
-rw-r--r--plugins/PluginUpdater/src/checksum.cpp9
1 files changed, 7 insertions, 2 deletions
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;
}
}