summaryrefslogtreecommitdiffstats
path: root/sandbox/src/interception.cc
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-18 01:47:05 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-18 01:47:05 +0000
commitebc4e18bbeb1fc4a4777ca2ac416ba9295df105c (patch)
tree798d70afeceeabcfcbe1b8fea7d8cbefcf4db795 /sandbox/src/interception.cc
parentaa0f26699ba66418e3d8fd06ba086142d7012377 (diff)
downloadchromium_src-ebc4e18bbeb1fc4a4777ca2ac416ba9295df105c.zip
chromium_src-ebc4e18bbeb1fc4a4777ca2ac416ba9295df105c.tar.gz
chromium_src-ebc4e18bbeb1fc4a4777ca2ac416ba9295df105c.tar.bz2
Application Verifier hooks GetProcAddress and returns
pointer to functions in its own dll instead. When we try to patch these functions, we fail because the appverif dll is not loaded yet. We need to get the real pointers to the NT functions. Review URL: http://codereview.chromium.org/11412 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5591 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/interception.cc')
-rw-r--r--sandbox/src/interception.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sandbox/src/interception.cc b/sandbox/src/interception.cc
index 8ee56f4..621a27d 100644
--- a/sandbox/src/interception.cc
+++ b/sandbox/src/interception.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "sandbox/src/interception_internal.h"
+#include "sandbox/src/pe_image.h"
#include "sandbox/src/sandbox.h"
#include "sandbox/src/sandbox_utils.h"
#include "sandbox/src/service_resolver.h"
@@ -400,9 +401,11 @@ bool InterceptionManager::PatchClientFunctions(DllInterceptionData* thunks,
if (!ntdll_base)
return false;
+ PEImage ntdll_image(ntdll_base);
+
// Bypass purify's interception.
wchar_t* loader_get = reinterpret_cast<wchar_t*>(
- ::GetProcAddress(ntdll_base, "LdrGetDllHandle"));
+ ntdll_image.GetProcAddress("LdrGetDllHandle"));
if (loader_get) {
if (!GetModuleHandleHelper(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,