Advertisement
81_DrizZle

Untitled

Sep 16th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Collections;
  6. namespace Vorlage
  7. {
  8.     class Program
  9.     {
  10.  
  11.         static void Main(string[] args)
  12.         {
  13.             //------------------------------------------
  14.             ArrayList commands = new ArrayList();
  15.             commands.Add("title=0x10055BD0");
  16.             commands.Add("support=0x10055CAC");
  17.             Console.WriteLine("Waiting for Command to execute...\n");
  18.             Check(commands);
  19.         }
  20.  
  21.         /*
  22.             * Expected:
  23.             * set <command> <value>
  24.         */
  25.         static void Check(ArrayList commands)
  26.         {
  27.             while (true)
  28.             {
  29.                 Trainer_Class Proc = new Trainer_Class();
  30.                 Proc.Process_Handle("iw5mp");
  31.  
  32.                 string query = Console.ReadLine();
  33.  
  34.                 string offset = null;
  35.  
  36.                 string value = query.Remove(0, 4);               //removes "set " from query
  37.                 value = value.Substring(value.IndexOf(' ') + 1); //removes <command> from query
  38.  
  39.                 string bridge = query.Remove(0, 4);              //removes "set " from query
  40.                 bridge = bridge.Remove(bridge.IndexOf(' '));     //removes <value> from query
  41.  
  42.                 bool exist = false;
  43.  
  44.                 foreach (string str in commands)
  45.                 {
  46.                      if (str.Remove(str.IndexOf('=')) == bridge)
  47.                     {
  48.                         offset = str.Substring(str.IndexOf('=') + 1);
  49.                         exist = true;
  50.                         break;
  51.                     }
  52.                  }
  53.  
  54.                 if (exist == true)
  55.                 {
  56.                  
  57.                     Console.WriteLine("Command found and Successfully executed.");
  58.                 }
  59.                 else
  60.                 {
  61.                     Console.WriteLine("Command not found.");
  62.                 }
  63.             }
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement