SPecs of comp
Page 1 of 1
SPecs of comp
Well i put together a spec reader, it creates a file in the C:/perflogs/hwid.txt and writes [1.ram, available ram, HWID, comp name, file sys name]
Here is code
Here is code
- Code:
#include <stdio.h>
#include <Windows.h>
#include <tchar.h>
struct vars
{
TCHAR volname[100];
TCHAR filename[20];
DWORD sernum;
DWORD maxfilename;
DWORD sysf;
};
int main(void)
{
struct vars v;
char cName [MAX_COMPUTERNAME_LENGTH + 1];
DWORD cNameDW = sizeof ( cName );
FILE *hwidf;
errno_t openhd;
openhd = fopen_s(&hwidf, "C://perflogs//hwid.txt", "w+");
MEMORYSTATUSEX status;
GlobalMemoryStatusEx(&status);
HW_PROFILE_INFOA hwid;
GetCurrentHwProfileA(&hwid);
HW_PROFILE_INFOA hwidt;
GetCurrentHwProfileA(&hwidt);
if(::GetVolumeInformation("C://", v.volname, sizeof( v.volname ), &v.sernum, &v.maxfilename, &v.sysf, v.filename, sizeof ( v.filename ) == TRUE))
{
printf("Serial Number: %s\n", v.sernum);
printf("File System Name: %s\n", v.filename);
}
_tprintf(_T("Ram installed is: %s \n", status.ullTotalPhys));
_tprintf(_T("Ram Available: %s \n", status.ullAvailPhys));
_tprintf(_T("ID: %s\n"), hwidt.szHwProfileGuid);
_tprintf(_T("Profile: %s\n"), hwidt.szHwProfileName);
fprintf(hwidf, "HWID: %s\n\n", hwidt.szHwProfileGuid );
fprintf(hwidf, "Name: %s", hwidt.szHwProfileName );
fprintf(hwidf, "Ram Installed: %s", status.ullTotalPhys );
fprintf(hwidf, "Ram Available: %s", status.ullAvailPhys );
fprintf(hwidf, "Serial Number: %s", v.sernum );
fprintf(hwidf, "File System Name: %s", v.filename );
/*if(!strcmp(hwid.szHwProfileGuid, "{846ee340-7039-11de-9d20-806e6f6e6963434343}"))
{
puts("HWID Accepted.\n");
}
else
{
puts("HWID Declined, closing.\n");
Sleep(1000);
exit(0);
}*/
fclose(hwidf);
getchar();
return (0);
}
Aker- Site Regular
- PSL Awards : N/A
Posts : 32
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|