123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef BASE_WIN_IAT_PATCH_FUNCTION_H_
- #define BASE_WIN_IAT_PATCH_FUNCTION_H_
- #include <windows.h>
- #include "base/base_export.h"
- #include "base/macros.h"
- namespace base {
- namespace win {
- class BASE_EXPORT IATPatchFunction {
- public:
- IATPatchFunction();
- ~IATPatchFunction();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DWORD Patch(const wchar_t* module,
- const char* imported_from_module,
- const char* function_name,
- void* new_function);
-
- DWORD PatchFromModule(HMODULE module,
- const char* imported_from_module,
- const char* function_name,
- void* new_function);
-
-
-
-
- DWORD Unpatch();
- bool is_patched() const { return (nullptr != intercept_function_); }
- void* original_function() const;
- private:
- HMODULE module_handle_ = nullptr;
- void* intercept_function_ = nullptr;
- void* original_function_ = nullptr;
- IMAGE_THUNK_DATA* iat_thunk_ = nullptr;
- DISALLOW_COPY_AND_ASSIGN(IATPatchFunction);
- };
- }
- }
- #endif
|