aboutsummaryrefslogtreecommitdiff
path: root/include/PatternScanner.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-09-28 13:50:32 +0200
committerToni Uhlig <matzeton@googlemail.com>2019-09-28 13:50:32 +0200
commitaf48899954bfd7205f6b0d8d371502cc898a6667 (patch)
tree05047fa3e427d519b97b108bfb7c61adb906cf20 /include/PatternScanner.h
parent8f494ce58e35fa39a4802f5238da05be03f10edd (diff)
added an extensible dynamic symbol resolver including support for injected DLLs
Diffstat (limited to 'include/PatternScanner.h')
-rw-r--r--include/PatternScanner.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/PatternScanner.h b/include/PatternScanner.h
index 1c53349..aa011f8 100644
--- a/include/PatternScanner.h
+++ b/include/PatternScanner.h
@@ -6,9 +6,9 @@
#include <vector>
-typedef bool(*map_file_cb)(IN MODULE_DATA&, OUT PVOID * const,
+typedef bool(*map_file_cb)(SymbolResolver& symres, IN MODULE_DATA&, OUT PVOID * const,
OUT SIZE_T * const, IN PVOID const);
-typedef bool(*map_file_cleanup_cb)(IN MODULE_DATA&,
+typedef bool(*map_file_cleanup_cb)(SymbolResolver& symres, IN MODULE_DATA&,
IN PVOID, IN PVOID const);
struct map_file_data {
@@ -29,7 +29,9 @@ extern const struct map_file_data map_kmem;
class PatternScanner
{
public:
- explicit PatternScanner(struct map_file_data const * const mfd = &map_loadlib, PVOID map_file_user_data = NULL);
+ explicit PatternScanner(SymbolResolver& symres,
+ struct map_file_data const * const mfd = &map_loadlib,
+ PVOID const map_file_user_data = NULL);
~PatternScanner();
void SetScanLowAddress(UINT64 startAddress) {
m_LowAddress = startAddress;
@@ -40,11 +42,14 @@ public:
bool Scan(MODULE_DATA& module, const char * const pattern);
private:
bool checkPattern(MODULE_DATA& module, const char * const pattern, std::string& result);
- bool doScan(UINT8 *buf, SIZE_T size, std::vector<UINT64>& foundOffsets);
+ bool doScan(std::string& pattern, UINT8 *buf, SIZE_T size, std::vector<UINT64>& foundOffsets);
+
+ SymbolResolver& m_symbolResolver;
struct map_file_data const * const mfd;
+ PVOID const map_file_user_data;
+
UINT64 m_LowAddress = 0x0;
UINT64 m_HighAddress = ((UINT64)-1);
- PVOID map_file_user_data;
};