Advertisement
81_DrizZle

Untitled

Sep 16th, 2015
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.24 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Collections;
  6. using System.Runtime.InteropServices;
  7. namespace Vorlage
  8. {
  9.     class Program
  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.             * Expected:
  22.             * set <command> <value>
  23.         */
  24.         static void Check(ArrayList commands)
  25.         {
  26.             while (true)
  27.             {
  28.                 Trainer_Class Proc = new Trainer_Class();
  29.                 Proc.Process_Handle("iw5mp");
  30.                 byte[] _byte = new byte[0xFF];
  31.                 string query = Console.ReadLine();
  32.                 string offset = null;
  33.  
  34.                 string value = query.Remove(0, 4);               //removes "set " from query
  35.                 value = value.Substring(value.IndexOf(' ') + 1); //removes <command> from query
  36.                 string bridge = query.Remove(0, 4);              //removes "set " from query
  37.                 bridge = bridge.Remove(bridge.IndexOf(' '));     //removes <value> from query
  38.                 bool exist = false;
  39.                 foreach (string str in commands)
  40.                 {
  41.                     if (str.Remove(str.IndexOf('=')) == bridge)
  42.                     {
  43.                         offset = str.Substring(str.IndexOf('=') + 1);
  44.                         exist = true;
  45.                         break;
  46.                     }
  47.                 }
  48.                 if (exist == true)
  49.                 {
  50.                     int i = Convert.ToInt32(offset, 16);
  51.                     Proc.WriteBytes(i, _byte);
  52.                     Proc.WriteString(i, value);
  53.                     Console.WriteLine();
  54.                     Console.WriteLine("Command found and Successfully executed.");
  55.                    
  56.                 }
  57.                 else
  58.                 {
  59.                     Console.WriteLine("Command not found.");
  60.                 }
  61.             }
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement