Exemplo n.º 1
0
        public void new_pointer_cheat(ulong address, List <long> offset_list, string type, string data, bool lock_, string description)
        {
            try
            {
                int sectionID = processManager.MappedSectionList.GetMappedSectionID(address);

                if (sectionID == -1)
                {
                    MessageBox.Show("Address is out of range!");
                    return;
                }

                if (cheatList.Exist(address))
                {
                    return;
                }

                ValueType valueType = MemoryHelper.GetValueTypeByString(type);

                DataCheatOperator          sourceOperator       = new DataCheatOperator(data, valueType, processManager);
                AddressCheatOperator       addressCheatOperator = new AddressCheatOperator(address, processManager);
                List <OffsetCheatOperator> offsetOperators      = new List <OffsetCheatOperator>();

                for (int i = 0; i < offset_list.Count; ++i)
                {
                    OffsetCheatOperator offsetOperator = new OffsetCheatOperator(offset_list[i],
                                                                                 ValueType.ULONG_TYPE, processManager);
                    offsetOperators.Add(offsetOperator);
                }

                SimplePointerCheatOperator destOperator = new SimplePointerCheatOperator(addressCheatOperator, offsetOperators, valueType, processManager);

                SimplePointerCheat simplePointerCheat = new SimplePointerCheat(sourceOperator, destOperator,
                                                                               lock_, description, processManager);

                add_new_row_to_cheat_list_view(simplePointerCheat);
                cheatList.Add(simplePointerCheat);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, exception.Source, MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Exemplo n.º 2
0
        public override bool Parse(string[] cheat_elements, ref int start_idx, bool simple_format)
        {
            ValueType = MemoryHelper.GetValueTypeByString(cheat_elements[start_idx + 0]);
            string pointer_str = cheat_elements[start_idx + 1];
            int    pointer_idx = 0;

            string[] pointer_list = pointer_str.Split('+');

            Address.Parse(pointer_list, ref pointer_idx, simple_format);

            for (int i = 1; i < pointer_list.Length; ++i)
            {
                OffsetCheatOperator offset = new OffsetCheatOperator(ProcessManager);
                offset.Parse(pointer_list, ref pointer_idx, simple_format);
                Offsets.Add(offset);
            }

            start_idx += 2;

            return(true);
        }