Exemplo n.º 1
0
        public override void AddVariable(WatchVariableControl control)
        {
            WatchVariableWrapper watchVarWrapper = control.WatchVarWrapper;
            WatchVariable        watchVar        = watchVarWrapper.WatchVar;

            if (watchVar.BaseAddressType == BaseAddressTypeEnum.Triangle)
            {
                if (Config.TriangleManager.TrianglePointerAddress.HasValue)
                {
                    Config.VarHackManager.AddVariable(
                        control.VarName + " " + VarHackConfig.EscapeChar,
                        Config.TriangleManager.TrianglePointerAddress.Value,
                        watchVar.MemoryType,
                        watchVarWrapper.GetUseHex(),
                        watchVar.Offset);
                }
            }
            else
            {
                List <uint> addressList = watchVar.GetAddressList(control.FixedAddressList);
                for (int i = 0; i < addressList.Count; i++)
                {
                    string indexSuffix = addressList.Count > 1 ? (i + 1).ToString() : "";
                    Config.VarHackManager.AddVariable(
                        control.VarName + indexSuffix + " " + VarHackConfig.EscapeChar,
                        addressList[i],
                        watchVar.MemoryType,
                        watchVarWrapper.GetUseHex(),
                        null);
                }
            }
        }
Exemplo n.º 2
0
        void IVariableAdder.AddVariable(WatchVariableControl control)
        {
            WatchVariableWrapper watchVarWrapper = control.WatchVarWrapper;
            WatchVariable        watchVar        = watchVarWrapper.WatchVar;

            if (watchVar.BaseAddressType == BaseAddressTypeEnum.Triangle)
            {
                var trianglePointerAddress = AccessScope <StroopMainForm> .content.trianglesTab.TrianglePointerAddress;
                if (trianglePointerAddress.HasValue)
                {
                    AddVariable(
                        control.VarName + " " + VarHackConfig.EscapeChar,
                        trianglePointerAddress.Value,
                        watchVar.MemoryType,
                        watchVarWrapper.GetUseHex(),
                        watchVar.Offset);
                }
            }
            else
            {
                List <uint> addressList = watchVar.GetAddressList(control.FixedAddressListGetter());
                for (int i = 0; i < addressList.Count; i++)
                {
                    string indexSuffix = addressList.Count > 1 ? (i + 1).ToString() : "";
                    AddVariable(
                        control.VarName + indexSuffix + " " + VarHackConfig.EscapeChar,
                        addressList[i],
                        watchVar.MemoryType,
                        watchVarWrapper.GetUseHex(),
                        null);
                }
            }
        }