Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Collections;
- using System.Runtime.InteropServices;
- namespace Vorlage
- {
- class Program
- {
- static void Main(string[] args)
- {
- //------------------------------------------
- ArrayList commands = new ArrayList();
- commands.Add("title=0x10055BD0");
- commands.Add("support=0x10055CAC");
- Console.WriteLine("Waiting for Command to execute...\n");
- Check(commands);
- }
- /*
- * Expected:
- * set <command> <value>
- */
- static void Check(ArrayList commands)
- {
- while (true)
- {
- Trainer_Class Proc = new Trainer_Class();
- Proc.Process_Handle("iw5mp");
- byte[] _byte = new byte[0xFF];
- string query = Console.ReadLine();
- string offset = null;
- string value = query.Remove(0, 4); //removes "set " from query
- value = value.Substring(value.IndexOf(' ') + 1); //removes <command> from query
- string bridge = query.Remove(0, 4); //removes "set " from query
- bridge = bridge.Remove(bridge.IndexOf(' ')); //removes <value> from query
- bool exist = false;
- foreach (string str in commands)
- {
- if (str.Remove(str.IndexOf('=')) == bridge)
- {
- offset = str.Substring(str.IndexOf('=') + 1);
- exist = true;
- break;
- }
- }
- if (exist == true)
- {
- int i = Convert.ToInt32(offset, 16);
- Proc.WriteBytes(i, _byte);
- Proc.WriteString(i, value);
- Console.WriteLine();
- Console.WriteLine("Command found and Successfully executed.");
- }
- else
- {
- Console.WriteLine("Command not found.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement