diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-27 18:53:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-27 18:53:18 +0300 |
commit | e3b2425ac0e38ef35d6493edc4a0a211959eb91d (patch) | |
tree | 7a80e334998b863a90459d45bc597e8d0ad7ae3b /tools/checksum | |
parent | f4d63038321dc6b1abe0f7fdb0e824ba66d3917f (diff) |
fix for correct version info offset calculation
Diffstat (limited to 'tools/checksum')
-rw-r--r-- | tools/checksum/checksum.cpp | 9 | ||||
-rw-r--r-- | tools/checksum/checksum.exe | bin | 17920 -> 18432 bytes |
2 files changed, 7 insertions, 2 deletions
diff --git a/tools/checksum/checksum.cpp b/tools/checksum/checksum.cpp index affaea11a4..0e19ab1693 100644 --- a/tools/checksum/checksum.cpp +++ b/tools/checksum/checksum.cpp @@ -15,6 +15,8 @@ #define RESULT_INVALID 50
#define RESULT_NONE 100
+#pragma comment(lib, "version.lib")
+
int debug = 0;
DWORD dwVersion = 0;
@@ -224,8 +226,11 @@ int PEChecksum(wchar_t *filename, BYTE digest[16]) // patch version
if (dwVersion) {
shift = dwVersion - pISH->VirtualAddress + pISH->PointerToRawData;
- VS_FIXEDFILEINFO *pVersion = (VS_FIXEDFILEINFO*)(ptr + shift);
- pVersion->dwProductVersionLS = pVersion->dwProductVersionMS = 0;
+
+ UINT blockSize;
+ VS_FIXEDFILEINFO *vsffi;
+ VerQueryValue(ptr + shift, L"\\", (PVOID*)&vsffi, &blockSize);
+ vsffi->dwProductVersionLS = vsffi->dwProductVersionMS = 0;
}
}
diff --git a/tools/checksum/checksum.exe b/tools/checksum/checksum.exe Binary files differindex a26ab4a0c3..f4e21190c6 100644 --- a/tools/checksum/checksum.exe +++ b/tools/checksum/checksum.exe |