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 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); }