Types of Memory Scans
libmem provides three types of memory scanning functions:- Data Scan (
LM_DataScan) - Scans for exact byte sequences - Pattern Scan (
LM_PatternScan) - Scans with wildcards using a mask - Signature Scan (
LM_SigScan) - Scans using IDA-style signatures with??wildcards
Ex variant for scanning remote processes.
Data Scanning
UseLM_DataScan to find exact byte sequences in memory.
Scanning Remote Process Memory
UseLM_DataScanEx to scan a remote process:
Pattern Scanning with Masks
UseLM_PatternScan when you need wildcards in your search pattern.
Create a pattern and mask
The mask uses This pattern matches:
x for exact matches and ? for wildcards:0x55(exact)0x48(exact)0x89(exact)0xE5(exact)- Any byte (wildcard)
- Any byte (wildcard)
Pattern Scanning Example
Searching for a function prologue with wildcards:Remote Process Pattern Scanning
Signature Scanning
UseLM_SigScan for IDA-style signatures (most convenient method).
Signature Scanning Examples
Searching for a specific function:Scanning Specific Memory Segments
You can scan specific memory segments by enumerating them first:Complete Example
Here’s a complete example combining different scanning techniques:Memory scanning can be CPU-intensive. For best performance:
- Scan the smallest memory region possible
- Use specific modules instead of scanning entire process memory
- Cache scan results when possible
- Use signature scanning (LM_SigScan) for the most readable patterns