void new_data_cheat(ulong address, 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 dataCheatOperator = new DataCheatOperator(data, valueType, processManager); AddressCheatOperator addressCheatOperator = new AddressCheatOperator(address, processManager); DataCheat dataCheat = new DataCheat(dataCheatOperator, addressCheatOperator, lock_, description, processManager); add_new_row_to_cheat_list_view(dataCheat); cheatList.Add(dataCheat); } catch (Exception exception) { MessageBox.Show(exception.Message, exception.Source, MessageBoxButtons.OK, MessageBoxIcon.Hand); } }
public override bool Parse(string[] cheat_elements) { if (cheat_elements.Length < CHEAT_CODE_DATA_TYPE_ELEMENT_COUNT) { return(false); } int start_idx = 1; AddressCheatOperator addressCheatOperator = (AddressCheatOperator)Destination; if (!(addressCheatOperator.ParseOldFormat(cheat_elements, ref start_idx))) { return(false); } if (!Source.Parse(cheat_elements, ref start_idx, true)) { return(false); } ulong flag = ulong.Parse(cheat_elements[CHEAT_CODE_DATA_TYPE_FLAG], NumberStyles.HexNumber); Lock = flag == 1 ? true : false; Description = cheat_elements[CHEAT_CODE_DATA_TYPE_DESCRIPTION]; Destination.ValueType = Source.ValueType; return(true); }
public SimplePointerCheatOperator(AddressCheatOperator Address, List <OffsetCheatOperator> Offsets, ValueType valueType, ProcessManager processManager) : base(valueType, processManager) { this.Address = Address; this.Offsets = Offsets; CheatOperatorType = CheatOperatorType.SIMPLE_POINTER_TYPE; }
public DataCheat(ProcessManager ProcessManager) : base(ProcessManager) { Source = new DataCheatOperator(ProcessManager); Destination = new AddressCheatOperator(ProcessManager); CheatType = CheatType.DATA_TYPE; AllowLock = true; }
public SimplePointerCheatOperator(ProcessManager processManager) : base(ValueType.NONE_TYPE, processManager) { Address = new AddressCheatOperator(ProcessManager); Offsets = new List <OffsetCheatOperator>(); CheatOperatorType = CheatOperatorType.SIMPLE_POINTER_TYPE; }
public override bool Parse(string[] cheat_elements) { int start_idx = 1; string addressType = cheat_elements[start_idx]; ++start_idx; switch (addressType) { case "data": { AddressCheatOperator addressCheatOperator = new AddressCheatOperator(ProcessManager); Destination = addressCheatOperator; } break; case "address": { AddressCheatOperator addressCheatOperator = new AddressCheatOperator(ProcessManager); Destination = addressCheatOperator; } break; case "pointer": { SimplePointerCheatOperator pointerCheatOperator = new SimplePointerCheatOperator(ProcessManager); Destination = pointerCheatOperator; } break; default: break; } switch (addressType) { case "data": ((AddressCheatOperator)Destination).ParseOldFormat(cheat_elements, ref start_idx); break; default: Destination.Parse(cheat_elements, ref start_idx, true); break; } this.AddressType = addressType; start_idx += 2; Source = new BatchCodeCheatOperator(Destination, this.ProcessManager); Source.Parse(cheat_elements, ref start_idx, false); ulong flag = ulong.Parse(cheat_elements[start_idx], NumberStyles.HexNumber); Lock = flag == 1 ? true : false; Description = cheat_elements[start_idx + 1]; return(true); }
public DataCheat(DataCheatOperator source, AddressCheatOperator dest, bool lock_, string description, ProcessManager processManager) : base(processManager) { CheatType = CheatType.DATA_TYPE; AllowLock = true; Source = source; Destination = dest; Lock = lock_; Description = description; }
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); } }
public override bool Parse(string[] cheat_elements) { int start_idx = 1; if (cheat_elements[start_idx] == "address") { Destination = new AddressCheatOperator(ProcessManager); } else if (cheat_elements[start_idx] == "pointer") { Destination = new SimplePointerCheatOperator(ProcessManager); } ++start_idx; Destination.Parse(cheat_elements, ref start_idx, true); if (cheat_elements[start_idx] == "data") { Source = new DataCheatOperator(ProcessManager); } else if (cheat_elements[start_idx] == "pointer") { Source = new SimplePointerCheatOperator(ProcessManager); } ++start_idx; Source.Parse(cheat_elements, ref start_idx, true); ulong flag = ulong.Parse(cheat_elements[start_idx], NumberStyles.HexNumber); Lock = flag == 1 ? true : false; Description = cheat_elements[start_idx + 1]; return(true); }