Open NotBlue-Dev opened 1 year ago
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.
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(); }
Have you checked whether the signature scan returns a valid address? Maybe a game update has changed the relevant code.
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 :