// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
// Our import address table contains pointers to the functions we import // at this point. Let's retrieve the first such function and use it to // find the module this import was resolved to by the loader. constwchar_t* function_in_module = reinterpret_cast<constwchar_t*>(import_address_table->u1.Function);
// Retrieve the module by a function in the module. const DWORD kFlags = GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT;
HMODULE module = NULL; if (!::GetModuleHandleEx(kFlags, function_in_module, &module)) { // This can happen if someone IAT patches us to a thunk. returntrue;
}
// See whether this module exports the function we're looking for.
FARPROC exported_func = ::GetProcAddress(module, context->name); if (exported_func != NULL) { // We found it, return the function and terminate the enumeration.
context->function = exported_func; returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.