public unsafe static void Initialize() { if (Kernel32.GetModuleHandle("game.dll") == IntPtr.Zero) { throw new Exception("Attempted to initialize Interface before 'game.dll' has been loaded."); } if (!GameAddresses.IsReady) { throw new Exception("Attempted to initialize Interface before GameAddresses was ready."); } CGameUI__Constructor = Memory.InstallHook(GameAddresses.CGameUI__Constructor, new CGameUI__ConstructorPrototype(CGameUI__ConstructorHook), true, false); }
public static void Initialize() { if (Kernel32.GetModuleHandle("game.dll") == IntPtr.Zero) { throw new Exception("Attempted to initialize " + typeof(InternalInterface).Name + " before 'game.dll' has been loaded."); } if (!GameAddresses.IsReady) { throw new Exception("Attempted to initialize " + typeof(InternalInterface).Name + " before " + typeof(GameAddresses).Name + " was ready."); } var address = IntPtr.Zero; address = GameAddresses.CGameUI__Constructor; Trace.Write("CGameUI__Constructor: 0x" + address.ToString("X8") + " . "); InternalInterface.CGameUI__Constructor = Memory.InstallHook(address, new CGameUI__ConstructorPrototype(InternalInterface.CGameUI__ConstructorHook), true, false); Trace.WriteLine("installed!"); }