Generate a HWID!

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

Generate a HWID!
  1. Unread #1 - May 6, 2009 at 10:30 PM
  2. pvash2
    Joined:
    May 5, 2009
    Posts:
    23
    Referrals:
    0
    Sythe Gold:
    0

    pvash2 Newcomer

    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");
    }
     
  3. Unread #2 - May 7, 2009 at 3:54 AM
  4. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Generate a HWID!

  5. Unread #3 - May 7, 2009 at 7:05 AM
  6. pvash2
    Joined:
    May 5, 2009
    Posts:
    23
    Referrals:
    0
    Sythe Gold:
    0

    pvash2 Newcomer

    Generate a HWID!

    I forgot who/where i got it from so i didnt put any credits in it
     
  7. Unread #4 - May 7, 2009 at 7:08 AM
  8. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    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 >

Users viewing this thread
1 guest


 
 
Adblock breaks this site