aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-09-28 19:43:58 +0200
committerToni Uhlig <matzeton@googlemail.com>2019-09-28 19:43:58 +0200
commitab39d4ee5812fbffd8180e07a6ba8094614dc304 (patch)
treeb71aa76ece42ebc65482ca230ba7ce8b718e44bb /include
parentaf48899954bfd7205f6b0d8d371502cc898a6667 (diff)
pattern scanning works as expected
Diffstat (limited to 'include')
-rw-r--r--include/DLLHelper.h3
-rw-r--r--include/PatternScanner.h4
2 files changed, 5 insertions, 2 deletions
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;