Blazing fast memory scanning (AOB) meets Clean Architecture.
A modular, SIMD-accelerated memory scanner written in modern C# for high-performance applications.
AobscanFast is not just another memory scanner. It is a highly optimized, thread-safe library designed for developers who need extreme performance without sacrificing code quality.
- π Hardware Intrinsics: Optimized for
Vector512,Vector256, andVector128. It dynamically chooses the fastest matching engine based on your CPU. - ποΈ Clean Architecture: Fully decoupled layers (Abstractions, Services, Infrastructure). No more static spaghetti code.
- π§΅ True Parallelism: Concurrent scanning using
Parallel.ForEachwith optimized memory chunking. - π Safe Handles: Built with
SafeHandleandCsWin32source generators to ensure zero handle leaks and memory safety. - π οΈ DI Ready: Designed to work seamlessly with Dependency Injection containers.
git clone https://github.com/larkliy/AobscanFast.gitThe new modular API separates process management from scanning logic.
using AobscanFast.Infrastructure.Windows;
using AobscanFast.Services;
// 1. Initialize infrastructure
var handler = new WinProcessHandler();
uint? pid = handler.FindIdByName("notepad");
// 2. Open process safely
using var handle = handler.OpenProcess(pid.Value);
// 3. Scan memory
var reader = new WinMemoryReader(handle);
var scanner = new AobScanner(reader);
var results = scanner.Scan("48 8B ?? ?? ?? AA");Limit the scan range to a specific DLL to drastically increase performance.
var module = handler.GetModuleInfo(pid.Value, "GameAssembly.dll");
if (module != null)
{
var options = new AobScanOptions
{
MinScanAddress = module.Value.BaseAddress,
MaxScanAddress = module.Value.BaseAddress + (nint)module.Value.Size
};
var results = scanner.Scan("F3 0F 10 ?? ?? ??", options);
}The project follows SOLID principles to remain maintainable and extensible:
- Abstractions: Interfaces like
IMemoryReaderandIProcessHandler. - Services: Core logic, including
AobScannerand SIMDPatternMatchers. - Infrastructure: Platform-specific implementations (currently Windows via
CsWin32). - Models: Value types like
MemoryRangeandAobPattern.
- Smart Chunking: Adjacent memory regions are merged and then sliced into optimal chunks (256KB) to maximize cache hits and parallel efficiency.
- Zero-Allocation Paths: Heavy use of
Span<T>,ReadOnlySpan<T>, andArrayPool<byte>to minimize GC pressure. - Strategy Pattern: Automatically switches between
SolidMatcher(directIndexOf) andMaskMatcher(SIMD masked comparison) based on your pattern.
Contributions are welcome! Whether it's porting to Linux (via /proc/pid/maps) or optimizing SIMD routines further.
- Fork the repo
- Create your branch:
git checkout -b feature/cool-optimization - Commit your changes
- Push to the branch and open a Pull Request
If you like this project, please give it a Star! π It helps me stay motivated and improve the library.