public IntPtr GetPointer(Process program) { if (program == null) { Pointer = IntPtr.Zero; lastID = -1; return Pointer; } else if (program.Id != lastID) { Pointer = IntPtr.Zero; lastID = program.Id; } else if (Pointer != IntPtr.Zero) { IntPtr pointer = Pointer; currentFinder.VerifyPointer(program, ref pointer); Pointer = pointer; } if (Pointer == IntPtr.Zero && DateTime.Now > lastTry) { lastTry = DateTime.Now.AddSeconds(1); for (int i = 0; i < Finders.Length; i++) { IFindPointer finder = Finders[i]; try { Pointer = finder.FindPointer(program, AsmName); if (Pointer != IntPtr.Zero || finder.FoundBaseAddress()) { currentFinder = finder; UpdatedPointer?.Invoke(this); break; } } catch { } } } return Pointer; }
public IntPtr GetPointer(Process program) { if (program == null) { Pointer = IntPtr.Zero; lastID = -1; return(Pointer); } else if (program.Id != lastID) { Pointer = IntPtr.Zero; lastID = program.Id; } if (Pointer == IntPtr.Zero && DateTime.Now > lastTry) { lastTry = DateTime.Now.AddSeconds(1); for (int i = 0; i < Finders.Length; i++) { IFindPointer finder = Finders[i]; try { Pointer = finder.FindPointer(program, AsmName); if (Pointer != IntPtr.Zero || finder.FoundBaseAddress()) { Version = finder.Version; break; } } catch { } } } return(Pointer); }