예제 #1
0
        public SaveGameDetour GetSaveGameHook(Process game, IntPtr statusPtr)
        {
            if (SaveGameDetourT == null)
            {
                throw new Exception("No SaveGameDetour type defined");
            }

            var originalPtr = Detour.FindExportedFunc(SaveGameDetourT, game);

            if (originalPtr != IntPtr.Zero)
            {
                return((SaveGameDetour)Activator.CreateInstance(SaveGameDetourT, statusPtr));
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        public LoadMapDetour GetLoadMapHook(Process game, IntPtr setMapPtr, IntPtr statusPtr)
        {
            if (LoadMapDetourT == null)
            {
                throw new Exception("No LoadMapDetour type defined");
            }

            var originalPtr = Detour.FindExportedFunc(LoadMapDetourT, game);

            if (originalPtr != IntPtr.Zero)
            {
                return((LoadMapDetour)Activator.CreateInstance(LoadMapDetourT, setMapPtr, statusPtr));
            }
            else
            {
                return(null);
            }
        }