-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cpp
67 lines (53 loc) · 3.95 KB
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "Hash.h"
Hash hashClass;
int main()
{
//First part gets the HDD informations
std::cout << "Please send this information to NAGA" << std::endl;
std::cout << "Make sure to have this program opened on your main machine where you play Rust. Otherwise wrong HWID will be gathered which will cause many issues." << std::endl;
std::cout << "\n";
TCHAR volumeName[MAX_PATH + 1] = { 0 };
TCHAR fileSystemName[MAX_PATH + 1] = { 0 };
DWORD serialNumber = 0;
DWORD maxComponentLen = 0;
DWORD fileSystemFlags = 0;
if (GetVolumeInformation(
_T("C:\\"),
volumeName,
ARRAYSIZE(volumeName),
&serialNumber,
&maxComponentLen,
&fileSystemFlags,
fileSystemName,
ARRAYSIZE(fileSystemName)))
{
//std::cout << "Volume Name: " << volumeName << std::endl;
//std::cout << "HDD Serial: " << serialNumber << std::endl;
//std::cout << "File System Type: " << fileSystemName << std::endl;
//std::cout << "Max Component Length: " << maxComponentLen << std::endl;
}
//Second part gets the computer name
TCHAR computerName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = sizeof(computerName) / sizeof(computerName[0]);
if (GetComputerName(
computerName,
&size))
{
std::cout << "Computer Name: " << computerName << std::endl;
}
//CPU hash
int cpuinfo[4] = { 0, 0, 0, 0 }; //EAX, EBX, ECX, EDX
__cpuid(cpuinfo, 1);
unsigned int hash = 0;
unsigned int* ptr = (unsigned int*)(&cpuinfo[0]);
for (char32_t i = 0; i < 8; i++)
hash += ptr[i];
//std::cout << "CPU Hash: " << hash << std::endl;
std::string info = "c" + std::to_string(hash) + "s" + std::to_string(serialNumber) + "m" + std::to_string(maxComponentLen);
std::cout << "\nOriginal: " << info << std::endl;
std::cout << "Encrypted: " << hashClass.EncryptMessage(info) << std::endl;
std::cout << "Decrypted: " << hashClass.DecryptMessage(hashClass.EncryptMessage(info)) << std::endl << std::endl;
//Get the IP address
system("pause");
return(0);
}