Beispiel #1
0
 public static void Initialize()
 {
     if (Kernel32.GetModuleHandle("game.dll") == IntPtr.Zero)
     {
         throw new Exception("Attempted to initialize " + typeof(Game).Name + " before 'game.dll' has been loaded.");
     }
     if (!GameAddresses.IsReady)
     {
         throw new Exception("Attempted to initialize " + typeof(Game).Name + " before " + typeof(GameAddresses).Name + " was ready.");
     }
     Unknown__SetState = Memory.InstallHook(GameAddresses.Unknown__SetState, new Unknown__SetStatePrototype(Unknown__SetStateHook), true, false);
 }
Beispiel #2
0
        public static void Initialize()
        {
            if (Kernel32.GetModuleHandle("game.dll") == IntPtr.Zero)
            {
                throw new Exception("Attempted to initialize " + typeof(InternalGame).Name + " before 'game.dll' has been loaded.");
            }

            if (!GameAddresses.IsReady)
            {
                throw new Exception("Attempted to initialize " + typeof(InternalGame).Name + " before " + typeof(GameAddresses).Name + " was ready.");
            }

            var address = IntPtr.Zero;

            address = GameAddresses.Unknown__SetState;
            Trace.Write("Unknown__SetState: 0x" + address.ToString("X8") + " . ");
            InternalGame.Unknown__SetState = Memory.InstallHook(address, new Unknown__SetStatePrototype(InternalGame.Unknown__SetStateHook), true, false);
            Trace.WriteLine("hook installed!");
        }