summaryrefslogtreecommitdiff
path: root/inject
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2015-02-07 23:22:17 +0000
committerJosé Fonseca <jfonseca@vmware.com>2015-02-07 23:27:17 +0000
commit0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57 (patch)
treefd2d64adc6bff6838650dfd6bce5c99eb733a5a9 /inject
parent926245356bfc702e4b585be36ed3401db090a67d (diff)
inject: Warn the failed to patch.
Diffstat (limited to 'inject')
-rw-r--r--inject/injectee.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/inject/injectee.cpp b/inject/injectee.cpp
index 14c3547a..34b57c30 100644
--- a/inject/injectee.cpp
+++ b/inject/injectee.cpp
@@ -498,12 +498,18 @@ patchFunction(HMODULE hModule,
return TRUE;
}
+ DWORD Offset = (DWORD)(UINT_PTR)lpOldFunctionAddress - (UINT_PTR)hModule;
if (VERBOSITY > 0) {
- DWORD Offset = (DWORD)(UINT_PTR)lpOldFunctionAddress - (UINT_PTR)hModule;
debugPrintf("inject: patching %s!0x%lx -> %s!%s\n", szModule, Offset, pszDllName, pszFunctionName);
}
- return replaceAddress(lpOldFunctionAddress, lpNewAddress);
+ BOOL bRet;
+ bRet = replaceAddress(lpOldFunctionAddress, lpNewAddress);
+ if (!bRet) {
+ debugPrintf("inject: failed to patch %s!0x%lx -> %s!%s\n", szModule, Offset, pszDllName, pszFunctionName);
+ }
+
+ return bRet;
}