Advertisement
HeavenHU

Untitled

Jan 9th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. using System.Diagnostics;
  2. using System.Windows.Forms;
  3.  
  4. namespace Anti_Analysis.Modules
  5. {
  6. class Emulation : IAAM
  7. {
  8.  
  9. public override string Name => "Anti Emulation";
  10. public override string Description => "Prevents analysis programs from emulating the target application by delaying the application start with MD5 cracking.";
  11.  
  12. public override void DoWork(DetectionMethod m)
  13. {
  14. Stopwatch s = new Stopwatch();
  15. s.Start();
  16. bool cracked = false;
  17. // TODO: Improve random key and md5 methods
  18. // TODO: Improve calculation size based on computer specs (for more accurate timing)
  19. // Currently ~ 58 seconds
  20. try
  21. {
  22. string letters = "abcdefghijklmnopqrstuvwxyz";
  23. char[] a = letters.ToCharArray();
  24. string shit = Helpr.RandKey(4) + Helpr.RandKey(1, "abcd"); //TODO adjust time here.
  25. string md5 = Helpr.CalculateMD5Hash(shit);
  26.  
  27. for (int i = 0; i < letters.Length; i++)
  28. {
  29. for (int j = 0; j < letters.Length; j++)
  30. {
  31. for (int k = 0; k < letters.Length; k++)
  32. {
  33. for (int l = 0; l < letters.Length; l++)
  34. {
  35. for (int mm = 0; mm < letters.Length; mm++)
  36. {
  37. // for (int n = 0; n < 6; n++)
  38. {
  39. string letterOne = a[i].ToString();
  40. string letterTwo = a[j].ToString();
  41. string letterThree = a[k].ToString();
  42. string letterFour = a[l].ToString();
  43. string letterFive = a[mm].ToString();
  44. // string letterSix = a[n].ToString();
  45.  
  46. string stry = Helpr.CalculateMD5Hash(letterOne + letterTwo + letterThree + letterFour + letterFive );
  47. if (stry == md5)
  48. {
  49. cracked = true;
  50. s.Stop();
  51. MessageBox.Show(s.ElapsedMilliseconds.ToString());
  52. break;
  53. }
  54. }
  55. }
  56. }
  57. }
  58. }
  59. }
  60. }
  61. catch
  62. {
  63. if (!cracked)
  64. {
  65. Helpr.Die(m);
  66. }
  67. }
  68. }
  69.  
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement