// Token: 0x06000059 RID: 89 RVA: 0x00002FC8 File Offset: 0x000011C8 public static string GetHwid(HwidStrength hwidStrength, bool ignoreNullValues = false) { string text = null; uint? num = null; foreach (Processor processor in HardwareGatherer.GetProcessors()) { bool flag = processor.Id == null; if (!flag) { text = processor.Id; } } foreach (HardDrive hardDrive in HardwareGatherer.GetHardDrives()) { bool flag2 = hardDrive.Signature == null; if (!flag2) { num = hardDrive.Signature; } } string serialNumber = BiosGatherer.GetSerialNumber(); string activeMacAddress = NetGatherer.GetActiveMacAddress(); string result; switch (hwidStrength) { case HwidStrength.Light: result = ((!ignoreNullValues && text == null) ? null : Crypto.GetMd5Hash(text)); break; case HwidStrength.Medium: result = ((!ignoreNullValues && (text == null || num == null)) ? null : Crypto.GetMd5Hash(text + num)); break; case HwidStrength.Strong: result = ((!ignoreNullValues && (text == null || num == null || serialNumber == null || activeMacAddress == null)) ? null : Crypto.GetMd5Hash(string.Concat(new object[] { text, num, serialNumber, activeMacAddress }))); break; default: result = null; break; } return(result); }
public static string GetHwid(HwidStrength hwidStrength, bool ignoreNullValues = false) { string cpuId = default(string); uint? hddSignature = default(uint?); string biosSerial = default(string); string macAddress = default(string); foreach (Processor processor in GetProcessors()) { if (processor.Id == null) { continue; } cpuId = processor.Id; } foreach (HardDrive hdd in GetHardDrives()) { if (hdd.Signature == null) { continue; } hddSignature = hdd.Signature; } biosSerial = BiosGatherer.GetSerialNumber(); macAddress = NetGatherer.GetActiveMacAddress(); switch (hwidStrength) { case HwidStrength.Light: return((!ignoreNullValues) && (cpuId == null) ? null : Crypto.GetMd5Hash(cpuId)); case HwidStrength.Medium: return((!ignoreNullValues) && (cpuId == null || hddSignature == null) ? null : Crypto.GetMd5Hash(cpuId + hddSignature)); case HwidStrength.Strong: return((!ignoreNullValues) && (cpuId == null || hddSignature == null || biosSerial == null || macAddress == null) ? null : Crypto.GetMd5Hash(cpuId + hddSignature + biosSerial + macAddress)); } return(null); }