Пример #1
0
 public BinaryArithmeticCheatOperator(CheatOperator left, CheatOperator right, ArithmeticType ArithmeticType,
                                      ProcessManager processManager)
     : base(left.ValueType, processManager)
 {
     Left  = left;
     Right = right;
     this.ArithmeticType = ArithmeticType;
     CheatOperatorType   = CheatOperatorType.ARITHMETIC_TYPE;
 }
Пример #2
0
 public SimplePointerCheat(CheatOperator source, CheatOperator dest, bool lock_, string description, ProcessManager processManager)
     : base(processManager)
 {
     CheatType   = CheatType.SIMPLE_POINTER_TYPE;
     AllowLock   = true;
     Source      = source;
     Destination = dest;
     Lock        = lock_;
     Description = description;
 }
Пример #3
0
 public CUCodeCheat(CheatOperator source, CheatOperator dest, bool lock_, string description, ProcessManager processManager)
     : base(processManager)
 {
     CheatType   = CheatType.DATA_TYPE;
     AllowLock   = true;
     Source      = source;
     Destination = dest;
     Lock        = lock_;
     Description = description;
 }
Пример #4
0
        public override bool Parse(string[] lines)
        {
            int    idx  = 0;
            string line = lines[idx++];
            string str  = line.Substring(0, 3);

            this.Lock        = str.Replace("_V", "").Equals(1) ? true : false;
            str              = line.Substring(4);
            this.Description = str.Trim();
            for (; idx < lines.Length; idx++)
            {
                line = lines[idx];
                if (!line.StartsWith("$"))
                {
                    continue;
                }
                line = line.Substring(1);
                CheatOperator opt       = null;
                string        optType   = line.Substring(0, 1);
                ValueType     valueType = ValueType.NONE_TYPE;
                string        valType   = line.Substring(1, 2);
                switch (valType)
                {
                case "0":
                    valueType = ValueType.BYTE_TYPE; break;

                case "1":
                    valueType = ValueType.USHORT_TYPE; break;

                case "2":
                    valueType = ValueType.UINT_TYPE; break;
                }
                switch (optType)
                {
                case "0":
                    opt = new CUWriteOperator(valueType, ProcessManager);
                    break;

                case "1":
                    break;

                case "2":
                    break;

                case "3":
                    break;

                case "4":
                    break;
                }
                opt.Parse(lines, ref idx, true);
                this.operators.Add(opt);
            }
            return(true);
        }
Пример #5
0
        private void timeRefreshLock_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i < cheatList.Count; ++i)
            {
                if (!cheatList[i].Lock)
                {
                    continue;
                }

                DataCheatOperator dataCheatOperator = (DataCheatOperator)cheatList[i].GetSource();
                CheatOperator     destOperator      = cheatList[i].GetDestination();
                destOperator.SetRuntime(dataCheatOperator);
            }
        }
Пример #6
0
        void add_new_row_to_cheat_list_view(Cheat cheat)
        {
            int index = this.lvCheatList.Rows.Add();

            DataGridViewRow cheat_list_view_item = lvCheatList.Rows[index];
            CheatOperator   destination          = cheat.GetDestination();
            CheatOperator   source = cheat.GetSource();

            cheat_list_view_item.Cells[CHEAT_LIST_ADDRESS].Value = destination.Display();
            cheat_list_view_item.Cells[CHEAT_LIST_TYPE].Value    = MemoryHelper.GetStringOfValueType(source.ValueType);
            cheat_list_view_item.Cells[CHEAT_LIST_VALUE].Value   = source.Display();
            cheat_list_view_item.Cells[CHEAT_LIST_SECTION].Value = processManager.MappedSectionList.GetSectionName(destination.GetSectionID());
            cheat_list_view_item.Cells[CHEAT_LIST_LOCK].Value    = cheat.Lock;
            cheat_list_view_item.Cells[CHEAT_LIST_DESC].Value    = cheat.Description;
        }
Пример #7
0
        private void cheat_list_view_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow edited_row = cheat_list_view.Rows[e.RowIndex];
            object edited_col = edited_row.Cells[e.ColumnIndex].Value;

            switch (e.ColumnIndex)
            {
                case CHEAT_LIST_VALUE:
                    DataCheatOperator dataCheatOperator = (DataCheatOperator)cheatList[e.RowIndex].GetSource();
                    CheatOperator destOperator = cheatList[e.RowIndex].GetDestination();
                    dataCheatOperator.Set((string)edited_col);
                    destOperator.SetRuntime(dataCheatOperator);
                    break;
                case CHEAT_LIST_DESC:
                    cheatList[e.RowIndex].Description = (string)edited_col;
                    break;
            }
        }
Пример #8
0
        private void btnRefreshCheat_Click(object sender, EventArgs e)
        {
            try
            {
                for (int i = 0; i < cheatList.Count; ++i)
                {
                    DataGridViewRow row = lvCheatList.Rows[i];

                    DataCheatOperator dataCheatOperator = (DataCheatOperator)cheatList[i].GetSource();
                    CheatOperator     destOperator      = cheatList[i].GetDestination();
                    dataCheatOperator.Set(destOperator.GetRuntime());
                    row.Cells[CHEAT_LIST_VALUE].Value = dataCheatOperator.Display();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Пример #9
0
        private void lvCheatList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            if (e.ColumnIndex < 0)
            {
                return;
            }

            DataGridViewRow edited_row = lvCheatList.Rows[e.RowIndex];
            object          edited_col = null;

            switch (e.ColumnIndex)
            {
            case CHEAT_LIST_ENABLED:
                lvCheatList.EndEdit();
                DataCheatOperator dataCheatOperator = (DataCheatOperator)cheatList[e.RowIndex].GetSource();
                CheatOperator     destOperator      = cheatList[e.RowIndex].GetDestination();
                edited_col = edited_row.Cells[CHEAT_LIST_VALUE].Value;
                dataCheatOperator.Set((string)edited_col);
                destOperator.SetRuntime(dataCheatOperator);
                break;

            case CHEAT_LIST_DEL:
                lvCheatList.Rows.RemoveAt(e.RowIndex);
                break;

            case CHEAT_LIST_LOCK:
                lvCheatList.EndEdit();
                edited_col = edited_row.Cells[e.ColumnIndex].Value;
                cheatList[e.RowIndex].Lock = (bool)edited_col;
                break;
            }
        }
Пример #10
0
 public virtual void SetRuntime(CheatOperator SourceCheatOperator, int idx = 0)
 {
 }
Пример #11
0
 public override void SetRuntime(CheatOperator SourceCheatOperator, int idx = 0)
 {
     throw new Exception("SetRuntime BinaryArithmeticCheatOperator");
 }
Пример #12
0
 public override void Set(CheatOperator SourceCheatOperator, int idx = 0)
 {
     throw new Exception("Pointer Set!!");
 }
Пример #13
0
 public override void SetRuntime(CheatOperator SourceCheatOperator, int idx = 0)
 {
     MemoryHelper.WriteMemory(Address, SourceCheatOperator.GetRuntime());
 }
Пример #14
0
 public override void Set(CheatOperator SourceCheatOperator, int idx = 0)
 {
     Address = BitConverter.ToUInt64(SourceCheatOperator.Get(), 0);
 }
Пример #15
0
 public override void SetRuntime(CheatOperator SourceCheatOperator, int idx = 0)
 {
     Offset = BitConverter.ToInt64(SourceCheatOperator.Get(), 0);
 }
Пример #16
0
 public override void SetRuntime(CheatOperator SourceCheatOperator, int idx = 0)
 {
     data = new byte[MemoryHelper.Length];
     Buffer.BlockCopy(SourceCheatOperator.GetRuntime(), 0, data, 0, MemoryHelper.Length);
 }