[For information on consuming Shared Libraries, see Dependency Injection in Reloaded II.]
Reloaded.Memory.SigScan.ReloadedII.Interfaces
(NuGet) exposes the following APIs:
IStartupScanner
: Queues signature scans for batch parallel scanning.IScannerFactory
: CreatesScanner
instances.
It is highly recommended that you use IStartupScanner
in your mods.
Running signature scans in parallel provides very significant gains to startup time.
Scans submitted to this class are performed in the order they are submitted.
There is no need to worry about conflicts/race conditions.
Example:
void Start()
{
// ... code omitted
_modLoader.GetController<IStartupScanner>().TryGetTarget(out var startupScanner);
startupScanner.AddMainModuleScan("C3", OnMainModuleScan);
}
private void OnMainModuleScan(PatternScanResult result)
{
_logger.WriteLine($"Found `ret` at: {result.Offset}");
}
If you need additional APIs in IStartupScanner
, such as scanning custom/different ranges, please let me know. For now the API only handles the common use case.
Vectorised implementations of Reloaded.Memory.Sigscan
are based off of a modified version of LazySIMD
by uberhalit.
Binary by ismail abdurrasyid from Noun Project.