summaryrefslogtreecommitdiff
path: root/tools/checksum/checksum.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/checksum/checksum.cpp')
-rw-r--r--tools/checksum/checksum.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/checksum/checksum.cpp b/tools/checksum/checksum.cpp
index 0e19ab1693..aee6b6102f 100644
--- a/tools/checksum/checksum.cpp
+++ b/tools/checksum/checksum.cpp
@@ -18,7 +18,7 @@
#pragma comment(lib, "version.lib")
int debug = 0;
-DWORD dwVersion = 0;
+DWORD dwVersion;
static void PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, PBYTE pBase, DWORD dwType);
@@ -219,6 +219,8 @@ int PEChecksum(wchar_t *filename, BYTE digest[16])
// patch resources
if (resSize > 0 && resAddr >= pISH->VirtualAddress && resAddr + resSize <= pISH->VirtualAddress + pISH->SizeOfRawData) {
+ dwVersion = 0;
+
DWORD shift = resAddr - pISH->VirtualAddress + pISH->PointerToRawData;
IMAGE_RESOURCE_DIRECTORY *pIRD = (IMAGE_RESOURCE_DIRECTORY*)(ptr + shift);
PatchResourcesDirectory(pIRD, ptr + shift, 0);