Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdafx.h>
- #include <iostream>
- #include <string>
- #include <Windows.h>
- #include <stdio.h>
- #include <winbase.h>
- #include <winuser.h>
- #include <tchar.h>
- using namespace std;
- int _tmain()
- {
- string BrandString;
- char Parts[48];
- long unsigned CheckP;
- //char Answer;
- system("cls");
- cout << "Requesting Brand String...\n";
- _asm
- {
- mov EAX, 0x80000000
- CPUID
- mov CheckP, EAX
- }
- if(CheckP > 0x80000000)
- {
- cout << "Brand String is supported...\n";
- }
- else
- {
- cout << "Brand String NOT supported...\nProgram will terminate in 3 seconds." << CheckP;
- Sleep(3000);
- return 0;
- }
- _asm
- {
- //Get First Part of the Brand String
- mov EAX, 0x80000002
- CPUID
- //Get all byte stored in EAX
- mov Parts[0], al
- mov Parts[1], ah
- shr EAX, 16
- mov Parts[2], al
- mov Parts[3], ah
- //Get all byte stored in EBX
- mov Parts[4], bl
- mov Parts[5], bh
- shr EBX, 16
- mov Parts[6], bl
- mov Parts[7], bh
- //Get all byte stored in ECX
- mov Parts[8], cl
- mov Parts[9], ch
- shr ECX, 16
- mov Parts[10], cl
- mov Parts[11], ch
- //Get all byte stored in EDX
- mov Parts[12], dl
- mov Parts[13], dh
- shr EDX, 16
- mov Parts[14], dl
- mov Parts[15], dh
- //Get Second Part of the Brand String
- mov EAX, 0x80000003
- CPUID
- //Get all byte stored in EAX
- mov Parts[16], al
- mov Parts[17], ah
- shr EAX, 16
- mov Parts[18], al
- mov Parts[19], ah
- //Get all byte stored in EBX
- mov Parts[20], bl
- mov Parts[21], bh
- shr EBX, 16
- mov Parts[22], bl
- mov Parts[23], bh
- //Get all byte stored in ECX
- mov Parts[24], cl
- mov Parts[25], ch
- shr ECX, 16
- mov Parts[26], cl
- mov Parts[27], ch
- //Get all byte stored in EDX
- mov Parts[28], dl
- mov Parts[29], dh
- shr EDX, 16
- mov Parts[30], dl
- mov Parts[31], dh
- //Get Third Part of the Brand String
- mov EAX, 0x80000004
- CPUID
- //Get all byte stored in EAX
- mov Parts[32], al
- mov Parts[33], ah
- shr EAX, 16
- mov Parts[34], al
- mov Parts[35], ah
- //Get all byte stored in EBX
- mov Parts[36], bl
- mov Parts[37], bh
- shr EBX, 16
- mov Parts[38], bl
- mov Parts[39], bh
- //Get all byte stored in ECX
- mov Parts[40], cl
- mov Parts[41], ch
- shr ECX, 16
- mov Parts[42], cl
- mov Parts[43], ch
- //Get all byte stored in EDX
- mov Parts[44], dl
- mov Parts[45], dh
- shr EDX, 16
- mov Parts[46], dl
- mov Parts[47], dh
- }
- BrandString.append(Parts, 48);
- cout << "Output: " << BrandString << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement