Some of you might find this useful in terms of security...
As you can see you will need the crc32 header, if you cant find it, let me know and i'll attach it
Grab hash codes which will be used to generate ID
Print the ID to screen
As you can see you will need the crc32 header, if you cant find it, let me know and i'll attach it
Grab hash codes which will be used to generate ID
Code:
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x4000
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include "CCRC32.H"
#define INFO_BUFFER_SIZE 32767
DWORD dwComputerHash;
DWORD dwNameHash;
DWORD dwHwHash;
DWORD dwTotalHash;
void GenerateGUID()
{
CCRC32 crc32;
HW_PROFILE_INFO hwProfInfo;
crc32.Initialize();
GetCurrentHwProfile(&hwProfInfo);
TCHAR userNameBuf[INFO_BUFFER_SIZE];
TCHAR desktopBuf[INFO_BUFFER_SIZE];
TCHAR hwGUID[INFO_BUFFER_SIZE];
DWORD bufCharCount = INFO_BUFFER_SIZE;
bufCharCount = INFO_BUFFER_SIZE;
GetComputerName( desktopBuf, &bufCharCount );
bufCharCount = INFO_BUFFER_SIZE;
GetUserName( userNameBuf, &bufCharCount );
memcpy(hwGUID,hwProfInfo.szHwProfileGuid, sizeof( hwProfInfo.szHwProfileGuid ));
dwComputerHash = crc32.FullCRC((unsigned char *)userNameBuf, INFO_BUFFER_SIZE);
dwNameHash = crc32.FullCRC((unsigned char *)desktopBuf, INFO_BUFFER_SIZE);
dwHwHash = crc32.FullCRC((PBYTE)hwGUID, HW_PROFILE_GUIDLEN);
dwTotalHash = dwComputerHash + dwNameHash + dwHwHash + dwTotalHash;
}
Print the ID to screen
Code:
void main( )
{
std::cout << "\n";
std::cout << "========================================" << std::endl;
std::cout << "--- ID Generator v1.12 ---" << std::endl;
std::cout << "========================================" << std::endl;
std::cout << "\n";
std::cout << "****************************************" << std::endl;
GenerateGUID();
printf("*ID: %X-%X-%X-%X*\n",dwComputerHash, dwNameHash, dwHwHash, dwTotalHash);
std::cout << "****************************************" << std::endl;
std::cout << "\n";
system("PAUSE");
}




