Adblock breaks this site

Generate a HWID!

Discussion in 'Programming General' started by pvash2, May 6, 2009.

  1. pvash2

    pvash2 Newcomer

    Joined:
    May 5, 2009
    Posts:
    23
    Referrals:
    0
    Sythe Gold:
    0
    Generate a HWID!

    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

    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");
    }
     
  2. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    Generate a HWID!

  3. pvash2

    pvash2 Newcomer

    Joined:
    May 5, 2009
    Posts:
    23
    Referrals:
    0
    Sythe Gold:
    0
    Generate a HWID!

    I forgot who/where i got it from so i didnt put any credits in it
     
  4. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    Generate a HWID!

    Convenient.

    Please, at least state so. And please do not spam the forum with sources that are not your own, even if you do give credit.
     
< Screenshot! | Java Had Error while dling >


 
 
Adblock breaks this site