Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. #include <stdafx.h>
  2. #include <iostream>
  3. #include <string>
  4. #include <Windows.h>
  5. #include <stdio.h>
  6. #include <winbase.h>
  7. #include <winuser.h>
  8. #include <tchar.h>
  9.  
  10. using namespace std;
  11.  
  12. int _tmain()
  13. {
  14. string BrandString;
  15. char Parts[48];
  16. long unsigned CheckP;
  17. //char Answer;
  18. system("cls");
  19. cout << "Requesting Brand String...\n";
  20.  
  21. _asm
  22. {
  23. mov EAX, 0x80000000
  24. CPUID
  25. mov CheckP, EAX
  26. }
  27.  
  28. if(CheckP > 0x80000000)
  29. {
  30. cout << "Brand String is supported...\n";
  31. }
  32. else
  33. {
  34. cout << "Brand String NOT supported...\nProgram will terminate in 3 seconds." << CheckP;
  35. Sleep(3000);
  36. return 0;
  37. }
  38.  
  39. _asm
  40. {
  41. //Get First Part of the Brand String
  42. mov EAX, 0x80000002
  43. CPUID
  44. //Get all byte stored in EAX
  45. mov Parts[0], al
  46. mov Parts[1], ah
  47. shr EAX, 16
  48. mov Parts[2], al
  49. mov Parts[3], ah
  50. //Get all byte stored in EBX
  51. mov Parts[4], bl
  52. mov Parts[5], bh
  53. shr EBX, 16
  54. mov Parts[6], bl
  55. mov Parts[7], bh
  56. //Get all byte stored in ECX
  57. mov Parts[8], cl
  58. mov Parts[9], ch
  59. shr ECX, 16
  60. mov Parts[10], cl
  61. mov Parts[11], ch
  62. //Get all byte stored in EDX
  63. mov Parts[12], dl
  64. mov Parts[13], dh
  65. shr EDX, 16
  66. mov Parts[14], dl
  67. mov Parts[15], dh
  68.  
  69. //Get Second Part of the Brand String
  70. mov EAX, 0x80000003
  71. CPUID
  72. //Get all byte stored in EAX
  73. mov Parts[16], al
  74. mov Parts[17], ah
  75. shr EAX, 16
  76. mov Parts[18], al
  77. mov Parts[19], ah
  78. //Get all byte stored in EBX
  79. mov Parts[20], bl
  80. mov Parts[21], bh
  81. shr EBX, 16
  82. mov Parts[22], bl
  83. mov Parts[23], bh
  84. //Get all byte stored in ECX
  85. mov Parts[24], cl
  86. mov Parts[25], ch
  87. shr ECX, 16
  88. mov Parts[26], cl
  89. mov Parts[27], ch
  90. //Get all byte stored in EDX
  91. mov Parts[28], dl
  92. mov Parts[29], dh
  93. shr EDX, 16
  94. mov Parts[30], dl
  95. mov Parts[31], dh
  96.  
  97. //Get Third Part of the Brand String
  98. mov EAX, 0x80000004
  99. CPUID
  100. //Get all byte stored in EAX
  101. mov Parts[32], al
  102. mov Parts[33], ah
  103. shr EAX, 16
  104. mov Parts[34], al
  105. mov Parts[35], ah
  106. //Get all byte stored in EBX
  107. mov Parts[36], bl
  108. mov Parts[37], bh
  109. shr EBX, 16
  110. mov Parts[38], bl
  111. mov Parts[39], bh
  112. //Get all byte stored in ECX
  113. mov Parts[40], cl
  114. mov Parts[41], ch
  115. shr ECX, 16
  116. mov Parts[42], cl
  117. mov Parts[43], ch
  118. //Get all byte stored in EDX
  119. mov Parts[44], dl
  120. mov Parts[45], dh
  121. shr EDX, 16
  122. mov Parts[46], dl
  123. mov Parts[47], dh
  124. }
  125. BrandString.append(Parts, 48);
  126. cout << "Output: " << BrandString << "\n";
  127. return 0;
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement