From ab39d4ee5812fbffd8180e07a6ba8094614dc304 Mon Sep 17 00:00:00 2001 From: Toni Uhlig <matzeton@googlemail.com> Date: Sat, 28 Sep 2019 19:43:58 +0200 Subject: pattern scanning works as expected --- include/DLLHelper.h | 3 +++ include/PatternScanner.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/DLLHelper.h b/include/DLLHelper.h index 21bb9aa..749e541 100644 --- a/include/DLLHelper.h +++ b/include/DLLHelper.h @@ -4,6 +4,9 @@ #include <Windows.h> +#define MakePtr(cast, ptr, addValue) (cast)((DWORD_PTR)(ptr) + (DWORD_PTR)(addValue)) +#define MakeDelta(cast, x, y) (cast) ((DWORD_PTR)(x) - (DWORD_PTR)(y)) + struct ResolvedDllEntry { const char * const baseDllName; const char * const functionName; diff --git a/include/PatternScanner.h b/include/PatternScanner.h index aa011f8..d374d29 100644 --- a/include/PatternScanner.h +++ b/include/PatternScanner.h @@ -39,10 +39,10 @@ public: void SetScanAddress(UINT64 startAddress) { m_LowAddress = startAddress; } - bool Scan(MODULE_DATA& module, const char * const pattern); + bool Scan(MODULE_DATA& module, const char * const pattern, std::vector<SIZE_T>& foundAddresses); private: bool checkPattern(MODULE_DATA& module, const char * const pattern, std::string& result); - bool doScan(std::string& pattern, UINT8 *buf, SIZE_T size, std::vector<UINT64>& foundOffsets); + bool doScan(std::string& pattern, UINT8 *buf, SIZE_T size, std::vector<SIZE_T>& foundAddresses); SymbolResolver& m_symbolResolver; -- cgit v1.2.3