
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
PatternScanner
Advanced tools
High-performance internal pattern scanner library for memory analysis, debugging, and security research. Supports .NET Standard 2.0+, .NET 6-9.
A high-performance, developer-friendly pattern scanning library for .NET, designed for internal process memory analysis, debugging, reverse engineering, and security research.
48 8B 05 ?? ?? ?? ??) and string patternsdotnet add package PatternScanner
Install-Package PatternScanner
Download the latest release from GitHub and add the DLL reference to your project.
using PatternScanner;
using PatternScanner.Core;
// Create a scanner instance
var scanner = PatternScannerFactory.Create();
// Scan for byte patterns (IDA Pro format)
var results = scanner.ScanForPattern("48 8B 05 ?? ?? ?? ??");
// Scan for strings with different encodings
var stringResults = scanner.ScanForString("Hello World", StringEncoding.Ascii);
var utf16Results = scanner.ScanForString("Unicode Text", StringEncoding.Utf16);
// Work with results
var firstResult = results.FirstOrDefault();
if (firstResult.Address != IntPtr.Zero)
{
// Read values at the found address
var value = firstResult.ReadValue<int>();
var bytes = firstResult.ReadBytes(8);
var pointer = firstResult.ReadPointer();
// Apply offset and read
var offsetResult = firstResult.WithOffset(4);
var offsetValue = offsetResult.ReadValue<int>();
}
// Scan only in the main module
var mainScanner = PatternScannerFactory.CreateForMainModule();
var mainResults = mainScanner.ScanForPattern("55 8B EC");
// Scan in a specific module
var moduleScanner = PatternScannerFactory.CreateForModule("kernel32.dll");
var moduleResults = moduleScanner.ScanForString("LoadLibrary");
// Scan only executable memory regions
var execResults = scanner.ScanForPattern("CC CC CC", MemoryRegionType.Executable);
// Scan only writable regions
var dataResults = scanner.ScanForString("Config", regionType: MemoryRegionType.Writable);
// Combine filters
var rwxResults = scanner.ScanForPattern("90 90", MemoryRegionType.ReadableWritableExecutable);
var optimizedScanner = PatternScannerFactory.Create()
.UseParallelScanning(true) // Enable parallel processing
.SetChunkSize(2 * 1024 * 1024) // 2MB chunks
.SetMaxResults(100) // Limit results for speed
.SetScanDirection(ScanDirection.Forward);
var results = optimizedScanner.ScanForPattern("E8 ?? ?? ?? ??");
// Scan within a specific address range
var rangeScanner = PatternScannerFactory.CreateForRange(
new IntPtr(0x10000000),
new IntPtr(0x20000000));
var rangeResults = rangeScanner.ScanForPattern("48 89 5C 24");
var results = scanner.ScanForPattern("48 8B 05 ?? ?? ?? ??");
// Apply multiple offsets to each result
var offsetResults = results.WithOffsets(0, 4, 8, 12);
// Filter results by address range
var filteredResults = offsetResults
.FilterByAddressRange(new IntPtr(0x1000000), new IntPtr(0x2000000))
.FilterByModule("main.exe");
var securityScanner = PatternScannerFactory.Create()
.UseParallelScanning(true)
.SetMaxResults(1); // Stop at first detection
// Common code modification signatures
var suspiciousPatterns = new[]
{
"48 89 5C 24 08 57 48 83 EC 20", // Hook pattern
"E9 ?? ?? ?? ?? CC CC CC CC CC", // Jump redirection
"C7 05 ?? ?? ?? ?? ?? ?? ?? ?? C3" // Memory patch pattern
};
foreach (var pattern in suspiciousPatterns)
{
var detections = securityScanner.ScanForPattern(pattern, MemoryRegionType.Executable);
if (detections.Any())
{
// Handle detection
Console.WriteLine($"Suspicious pattern detected: {pattern}");
}
}
// Scan for specific API calls
var targetAPIs = new[] { "LoadLibraryA", "LoadLibraryW", "CreateThread" };
foreach (var api in targetAPIs)
{
var results = scanner.ScanForString(api, StringEncoding.Ascii, false);
// Analyze results for research purposes
}
PatternScannerFactory: Factory class for creating scanner instancesIPatternScanner: Main interface for pattern scanning operationsScanResult: Represents a pattern match result with address and metadataMemoryRegion: Information about a memory regionModuleInfo: Information about a loaded moduleMemoryRegionType: Filter for memory region types (Readable, Writable, Executable, etc.)StringEncoding: Supported string encodings (Ascii, Utf8, Utf16, etc.)ScanDirection: Scanning direction (Forward, Backward)ReadValue<T>(): Read a value of type T from the result addressReadBytes(int count): Read a byte array from the result addressReadString(): Read a null-terminated string from the result addressReadPointer(): Read a pointer value from the result addressWithOffset(int offset): Apply an offset to the result addressWithOffsets(params int[] offsets): Apply multiple offsets to resultsFilterByModule(string moduleName): Filter results by module nameFilterByAddressRange(IntPtr start, IntPtr end): Filter results by address rangeSetMaxResults() when you only need a few matchesThis library supports multiple .NET implementations:
Contributions are welcome! Please feel free to submit a Pull Request on GitHub.
If you encounter any issues or have questions, please file them on the GitHub Issues page.
This project is licensed under the MIT License - see the LICENSE file for details.
This library is designed for legitimate security research, debugging, and memory analysis purposes. Use responsibly and in accordance with applicable laws and regulations.
FAQs
High-performance internal pattern scanner library for memory analysis, debugging, and security research. Supports .NET Standard 2.0+, .NET 6-9.
We found that patternscanner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.