Exemple #1
0
 private static void OnReady()
 {
     if (GameAddresses.Ready != null)
     {
         GameAddresses.Ready();
     }
 }
Exemple #2
0
        public static void Initialize()
        {
            if (Kernel32.GetModuleHandle("game.dll") == IntPtr.Zero)
            {
                throw new Exception("Attempted to initialize " + typeof(GameAddresses).Name + " before 'game.dll' has been loaded.");
            }

            var @base = Kernel32.GetModuleHandle("game.dll");

            Trace.WriteLine("Base: 0x" + @base.ToString("X8"));
            GameAddresses.CUnit__GetAbility           = @base + GameAddresses.CUnit__GetAbilityOffset;
            GameAddresses.GetAbilDataCacheNodeFromId  = @base + GameAddresses.GetAbilDataCacheNodeFromIdOffset;
            GameAddresses.CGameUI__Constructor        = @base + GameAddresses.CGameUI__ConstructorOffset;
            GameAddresses.CGameUI__DisplayChatMessage = @base + GameAddresses.CGameUI__DisplayChatMessageOffset;
            GameAddresses.Unknown__UpdateMouse        = @base + GameAddresses.Unknown__UpdateMouseOffset;
            GameAddresses.Unknown__SetState           = @base + GameAddresses.Unknown__SetStateOffset;
            GameAddresses.GetUnitFromHandle           = @base + GameAddresses.GetUnitFromHandleOffset;
            GameAddresses.GetTriggerFromHandle        = @base + GameAddresses.GetTriggerFromHandleOffset;
            GameAddresses.GetDestructableFromHandle   = @base + GameAddresses.GetDestructableFromHandleOffset;
            GameAddresses.GetItemFromHandle           = @base + GameAddresses.GetItemFromHandleOffset;
            GameAddresses.StringToJassStringIndex     = @base + GameAddresses.StringToJassStringIndexOffset;
            GameAddresses.CTriggerWar3__Execute       = @base + GameAddresses.CTriggerWar3__ExecuteOffset;
            GameAddresses.JassStringManager__Resize   = @base + GameAddresses.JassStringManager__ResizeOffset;
            GameAddresses.InitNatives                 = @base + GameAddresses.InitNativesOffset;
            GameAddresses.BindNative                  = @base + GameAddresses.BindNativeOffset;
            GameAddresses.Jass__Constructor           = @base + GameAddresses.Jass__ConstructorOffset;
            GameAddresses.VirtualMachine__RunCode     = @base + GameAddresses.VirtualMachine__RunCodeOffset;
            GameAddresses.VirtualMachine__RunFunction = @base + GameAddresses.VirtualMachine__RunFunctionOffset;
            GameAddresses.GetThreadLocalStorage       = @base + GameAddresses.GetThreadLocalStorageOffset;
            GameAddresses.JassStringHandleToString    = @base + GameAddresses.JassStringHandleToStringOffset;
            GameAddresses.sub_6F4786B0                = @base + GameAddresses.sub_6F4786B0Offset;
            GameAddresses.WndProc = @base + GameAddresses.WndProcOffset;
            GameAddresses.CSimpleMessageFrame__WriteLine = @base + GameAddresses.CSimpleMessageFrame__WriteLineOffset;
            GameAddresses.ValueFPS = @base + GameAddresses.ValueFPSOffset;

            GameAddresses.IsReady = true;
            GameAddresses.OnReady();
        }