CybEl

HWID

Mar 31st, 2018 (edited)
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <windows.h>
  2.  
  3. UCHAR
  4. szFileSys[255],
  5. szVolNameBuff[255];
  6.  
  7. DWORD
  8. dwMFL,
  9. dwSysFlags,
  10. dwSerial;
  11.  
  12. #define My_HWID (1289182852)
  13.  
  14. VOID CheckValidHardwareID()
  15. {
  16. GetVolumeInformation("C:\\",(LPTSTR)szVolNameBuff,255,&dwSerial, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
  17. if (dwSerial == My_HWID)
  18. {
  19. MessageBox(0,"VALID HARDWARE ID","INFORMATION",MB_OK | MB_ICONINFORMATION);
  20. // Serial valid
  21. }
  22. else
  23. {
  24. MessageBox(0,"VALID HARDWARE ID","INFORMATION",MB_OK | MB_ICONERROR);
  25. ExitProcess(1); // Force Exit
  26. // Invalid Serial
  27. }
  28. }
  29. BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
  30. {
  31. if (dwReason == DLL_PROCESS_ATTACH)
  32. {
  33. CheckValidHardwareID();
  34. }
  35. return TRUE;
  36. }
Add Comment
Please, Sign In to add comment