-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Hi, i get this error when i try to hook any function of NMS :
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Here is the code used for hooking :
public void InitHook(IModLogger _logger, IReloadedHooks _hooks)
{
logger = _logger;
string pattern = "48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 57 41 56 41 57 48 81 EC ? ? ? ? 0F 29 70 D8 48 8D";
Function = _hooks.CreateFunction<HookDelegate>(new Signature(pattern).Scan());
_hooks.CreateHook(Function, new Signature(pattern).Scan());
logger.WriteLine($"Function: {Function}");
Hook = Function.Hook(CodeToExecute).Activate();
}Metadata
Metadata
Assignees
Labels
No labels