Class PatternScanner
- Namespace
- SharpPluginLoader.Core.Memory
- Assembly
- SharpPluginLoader.Core.dll
Provides methods for scanning memory for patterns.
public static class PatternScanner
- Inheritance
-
PatternScanner
- Inherited Members
Methods
FindFirst(Pattern)
Finds the first occurrence of the specified pattern in the process.
public static nint FindFirst(Pattern pattern)
Parameters
pattern
PatternThe pattern to search for.
Returns
- nint
The address of the first occurrence of the pattern, or 0 if not found.
Remarks
This method will cache the result for future calls. To disable caching, use FindFirst(Pattern, bool).
FindFirst(Pattern, bool)
Finds the first occurrence of the specified pattern in the process.
public static nint FindFirst(Pattern pattern, bool cache)
Parameters
pattern
PatternThe pattern to search for.
cache
boolWhether to cache the result for future calls. (Works across restarts)
Returns
- nint
The address of the first occurrence of the pattern, or 0 if not found.
Scan(Pattern)
Scans the entire process for the specified pattern.
public static List<nint> Scan(Pattern pattern)
Parameters
pattern
PatternThe pattern to scan for.
Returns
Remarks
It is strongly recommended to cache the results of this method. For automatic caching, use FindFirst(Pattern) instead.