#include <iostream>
#include <windows.h>
#include <winbase.h>
#include <string>
#include <vector>
// Memoryhackers.org tutorial
// BIOS bilgilerini alır
std::string GetBIOSInfo()
{
std::string biosInfo;
// Win32_BIOS sınıfından bilgileri almak için WMI sorgusu yapılır
std::string query = "wmic bios get Manufacturer, SMBIOSBIOSVersion, IdentificationCode /format:list";
FILE* pipe = _popen(query.c_str(), "r");
if (!pipe)
{
return "";
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
{
biosInfo += buffer;
}
_pclose(pipe);
return biosInfo;
}
// CPU bilgilerini alır
std::string GetCPUInfo()
{
std::string cpuInfo;
// Win32_Processor sınıfından bilgileri almak için WMI sorgusu yapılır
std::string query = "wmic cpu get ProcessorId, UniqueId, Name /format:list";
FILE* pipe = _popen(query.c_str(), "r");
if (!pipe)
{
return "";
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
{
cpuInfo += buffer;
}
_pclose(pipe);
return cpuInfo;
}
// HDD bilgilerini alır
std::string GetHDDInfo()
{
std::string hddInfo;
// Win32_DiskDrive sınıfından bilgileri almak için WMI sorgusu yapılır
std::string query = "wmic diskdrive get Model, TotalHeads /format:list";
FILE* pipe = _popen(query.c_str(), "r");
if (!pipe)
{
return "";
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
{
hddInfo += buffer;
}
_pclose(pipe);
return hddInfo;
}
// GPU bilgilerini alır
std::string GetGPUInfo()
{
std::string gpuInfo;
// Win32_VideoController sınıfından bilgileri almak için WMI sorgusu yapılır
std::string query = "wmic path Win32_VideoController get DriverVersion, Name /format:list";
FILE* pipe = _popen(query.c_str(), "r");
if (!pipe)
{
return "";
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
{
gpuInfo += buffer;
}
_pclose(pipe);
return gpuInfo;
}
// MAC adresini alır
std::string GetMACAddress()
{
std::string macAddress;
// Win32_NetworkAdapterConfiguration sınıfından bilgileri almak için WMI sorgusu yapılır
std::string query = "wmic nicconfig get MACAddress /format:list";
FILE* pipe = _popen(query.c_str(), "r");
if (!pipe)
{
return "";
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
{
macAddress += buffer;
}
_pclose(pipe);
return macAddress;
}
// İşletim sistemi bilgilerini alır
std::string GetOSInfo()
{
std::string osInfo;
// Win32_OperatingSystem sınıfından bilgileri almak için WMI sorgusu yapılır
std::string query = "wmic os get SerialNumber, Name /format:list";
FILE* pipe = _popen(query.c_str(), "r");
if (!pipe)
{
return "";
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
{
osInfo += buffer;
}
_pclose(pipe);
return osInfo;
}
// SCSI kontrolcü bilgilerini alır
std::string GetSCSIInfo()
{
std::string scsiInfo;
// Win32_SCSIController sınıfından bilgileri almak için WMI sorgusu yapılır
std::string query = "wmic path Win32_SCSIController get DeviceID, Name /format:list";
FILE* pipe = _popen(query.c_str(), "r");
if (!pipe)
{
return "";
}
char buffer[128];
while (fgets(buffer, sizeof(buffer), pipe) != NULL)
{
scsiInfo += buffer;
}
_pclose(pipe);
return scsiInfo;
}
int main()
{
// HWID'yi oluşturmak için gerekli bilgileri alır
std::string biosInfo = GetBIOSInfo();
std::string cpuInfo = GetCPUInfo();
std::string hddInfo = GetHDDInfo();
std::string gpuInfo = GetGPUInfo();
std::string macAddress = GetMACAddress();
std::string osInfo = GetOSInfo();
std::string scsiInfo = GetSCSIInfo();
// HWID'yi oluştururken kullanılacak bileşenlerin verilerini birleştirir
std::string hwid = biosInfo + cpuInfo + hddInfo + gpuInfo + macAddress + osInfo + scsiInfo;
// HWID'yi ekrana yazdırır
// Memoryhackers.org tutorial
std::cout << "HWID: " << hwid << std::endl;
return 0;
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?