Beispiel #1
0
        // Token: 0x06000BE8 RID: 3048 RVA: 0x00023BE8 File Offset: 0x00021DE8
        public static string GetHwid(HwidStrength hwidStrength, bool ignoreNullValues = false)
        {
            string text = null;
            uint?  num  = null;

            foreach (Processor processor in HardwareGatherer.GetProcessors())
            {
                if (processor.Id != null)
                {
                    text = processor.Id;
                }
            }
            foreach (HardDrive hardDrive in HardwareGatherer.GetHardDrives())
            {
                if (hardDrive.Signature != null)
                {
                    num = hardDrive.Signature;
                }
            }
            string serialNumber     = BiosGatherer.GetSerialNumber();
            string activeMacAddress = NetGatherer.GetActiveMacAddress();

            switch (hwidStrength)
            {
            case HwidStrength.Light:
                if (ignoreNullValues || text != null)
                {
                    return(DataRecoveryHelper.GetMd5Hash(text + Environment.UserName).Replace("-", string.Empty));
                }
                return(null);

            case HwidStrength.Medium:
                if (ignoreNullValues || (text != null && num != null))
                {
                    return(DataRecoveryHelper.GetMd5Hash(text + num + Environment.UserName).Replace("-", string.Empty));
                }
                return(null);

            case HwidStrength.Strong:
                if (ignoreNullValues || (text != null && num != null && serialNumber != null && activeMacAddress != null))
                {
                    return(DataRecoveryHelper.GetMd5Hash(string.Concat(new object[]
                    {
                        text,
                        num,
                        serialNumber,
                        activeMacAddress,
                        Environment.UserName
                    })).Replace("-", string.Empty));
                }
                return(null);

            default:
                return(null);
            }
        }
Beispiel #2
0
        // 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);
        }
Beispiel #3
0
        public static string GetHwid(HwidStrength hwidStrength, bool ignoreNullValues = false)
        {
            string text  = null;
            uint?  num   = null;
            string text2 = null;
            string text3 = null;

            foreach (Processor processor in GetProcessors())
            {
                if (processor.Id != null)
                {
                    text = processor.Id;
                }
            }
            foreach (HardDrive hardDrife in GetHardDrives())
            {
                if (hardDrife.Signature.HasValue)
                {
                    num = hardDrife.Signature;
                }
            }
            text2 = BiosGatherer.GetSerialNumber();
            text3 = NetGatherer.GetActiveMacAddress();
            switch (hwidStrength)
            {
            case HwidStrength.Light:
                if (ignoreNullValues || text != null)
                {
                    return(DataRecoveryHelper.GetMd5Hash(text + Environment.UserName).Replace("-", string.Empty));
                }
                return(null);

            case HwidStrength.Medium:
                if (ignoreNullValues || (text != null && num.HasValue))
                {
                    return(DataRecoveryHelper.GetMd5Hash(text + num + Environment.UserName).Replace("-", string.Empty));
                }
                return(null);

            case HwidStrength.Strong:
                if (ignoreNullValues || (text != null && num.HasValue && text2 != null && text3 != null))
                {
                    return(DataRecoveryHelper.GetMd5Hash(text + num + text2 + text3 + Environment.UserName).Replace("-", string.Empty));
                }
                return(null);

            default:
                return(null);
            }
        }
Beispiel #4
0
        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);
        }