Template Class Scanner#
Defined in File LightningScanner.hpp
Class Documentation#
-
template<ScanMode PreferredMode = ScanMode::Avx2>
class Scanner# Single result IDA-style pattern scanner.
A pattern scanner that searches for an IDA-style pattern and returns the pointer to the first occurrence in the binary.
- Template Parameters
PreferredMode – the preferred scan mode. This is used as a suggestion for the scanner which mode to try first, if the mode is not supported, it will try every other one until it finds a supported one.
Public Functions
-
inline Scanner(Pattern pattern)#
Create a new Scanner instance with an IDA-style pattern
Example:
LightningScanner::Scanner("48 89 5c 24 ?? 48 89 6c");
-
inline ScanResult Find(void *startAddr, size_t size) const#
Find the first occurrence of the pattern in the binary
Example:
using namespace LightningScanner; const auto scanner = Scanner("48 89 5c 24 ?? 48 89 6c"); ScanResult result = scanner.Find(binary, binarySize);
- Parameters
startAddr – address to start the search from
size – binary size of the search area
- Returns
A ScanResult instance