jamius19

Anti Cheat Tool (For protection against memory hackers)

Dec 25th, 2015
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.26 KB | None | 0 0
  1. /* ********************** Anti Cheat tool (for memory hackers only) ********************** */
  2. /* *********************************** Jamius Siam *************************************** */
  3.  
  4. /// <summary>
  5. /// Anti Cheat Tool's API. 
  6. /// </summary>
  7. public sealed class ACT
  8. {
  9.    
  10.     public static char[] key = new char[10]{'q','w','e','r','t','y','u','i','o','p'};            //Key for encryption (can change it as you wish, but make sure not to repeat an alphabet)
  11.     static char[] orgKey = new char[]{'0','1','2','3','4','5','6','7','8','9'};                 // Key for decryption
  12.  
  13.  
  14.    
  15.     public static string Encrypt (int inputInt)                                             // Method for Encrypting given Int to random string
  16.     {
  17.         string mainWord = inputInt.ToString ();
  18.         char [] testWord = new char[mainWord.Length];
  19.         testWord = mainWord.ToCharArray ();
  20.         char[] output = new char[testWord.Length];
  21.        
  22.         for (int x = 0; x < testWord.Length; x++) {
  23.             int map = (testWord [x]) - '0';
  24.             output [x] = key [map];
  25.         }
  26.        
  27.         string abs = new string (output);
  28.         return(abs);
  29.     }
  30.  
  31.  
  32.    
  33.     public static int Decrypt (string inputString)                                                  // Method for Decrypting given random string to int
  34.     {
  35.         char [] testWord = new char[inputString.Length];
  36.         testWord = inputString.ToCharArray ();
  37.         char[] output = new char[testWord.Length];
  38.        
  39.         for (int x = 0; x < testWord.Length; x++) {
  40.             int map = 0;
  41.             for (int y = 0; y < key.Length; y++) {
  42.                 if (key [y] == testWord [x])
  43.                     map = y;
  44.             }
  45.             output [x] = orgKey [map];
  46.         }
  47.        
  48.         string abs = new string (output);
  49.         int returnValue = int.Parse (abs);
  50.         return(returnValue);
  51.     }
  52.  
  53.  
  54.  
  55.     public static string Add (string a, string b)                                           // Method for adding two encryted strings together (string input)
  56.     {
  57.         int A = Decrypt (a);
  58.         int B = Decrypt (b);
  59.  
  60.  
  61.         string sum = Encrypt (A + B);
  62.         return sum;
  63.     }
  64.  
  65.  
  66.  
  67.     public static string Add (int a, int b)                                                 // Method for adding two encryted strings together (int input)
  68.     {
  69.         string sum = Encrypt (a + b);
  70.         return sum;
  71.     }
  72.  
  73.  
  74.  
  75.     public static string Subtract (string a, string b)                                      // Method for subtracting two encryted strings together (string input)
  76.     {
  77.         int A = Decrypt (a);
  78.         int B = Decrypt (b);
  79.        
  80.         string sum = Encrypt (A - B);
  81.         return sum;
  82.     }
  83.  
  84.    
  85.     public static string Subtract (int a, int b)                                            // Method for subtracting two encryted strings together (int input)
  86.     {
  87.         string sum = Encrypt (a - b);
  88.         return sum;
  89.     }
  90.  
  91.  
  92.     public static string Multiply (string a, string b)                                      // Method for multiplying two encryted strings together (string input)
  93.     {
  94.         int A = Decrypt (a);
  95.         int B = Decrypt (b);
  96.        
  97.         string sum = Encrypt (A * B);
  98.         return sum;
  99.     }
  100.    
  101.    
  102.  
  103.     public static string Multiply (int a, int b)                                            // Method for multiplying two encryted strings together (int input)
  104.     {
  105.         string sum = Encrypt (a * b);
  106.         return sum;
  107.     }
  108.  
  109.  
  110.     public static string Divide (string a, string b)                                        // Method for multiplying two encryted strings together (string input)
  111.     {
  112.         int A = Decrypt (a);
  113.         int B = Decrypt (b);
  114.        
  115.         string sum = Encrypt (A / B);
  116.         return sum;
  117.     }
  118.    
  119.  
  120.     public static string Divide (int a, int b)                                          // Method for multiplying two encryted strings together (int input)
  121.     {
  122.         string sum = Encrypt (a / b);
  123.         return sum;
  124.     }
  125. }
Add Comment
Please, Sign In to add comment