public static byte[] GenerateMachineID()
{
// this is steamkit's own implementation, it doesn't match what steamclient does
// but this should make it so individual systems can be identified
PlatformID platform = Environment.OSVersion.Platform;
if (platform == PlatformID.Win32NT)
{
string hwString = "foobar";
try
{
RegistryKey localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64);
localKey = localKey.OpenSubKey(@"SOFTWARE\Microsoft\Cryptography");
if (localKey != null)
{
hwString = localKey.GetValue("MachineGuid").ToString();
}
}
catch { }
try
{
return(CryptoHelper.SHAHash(Encoding.ASCII.GetBytes(hwString.ToString())));
}
catch { return(null); }
}
else
{
// todo: implement me!
return(null);
}
}