示例#1
0
        // Token: 0x06000084 RID: 132 RVA: 0x000040E0 File Offset: 0x000022E0
        private static HWID.HW_PROFILE_INFO ProfileInfo()
        {
            IntPtr intPtr = IntPtr.Zero;

            HWID.HW_PROFILE_INFO result;
            try
            {
                HWID.HW_PROFILE_INFO hw_PROFILE_INFO = new HWID.HW_PROFILE_INFO();
                intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(hw_PROFILE_INFO));
                Marshal.StructureToPtr(hw_PROFILE_INFO, intPtr, false);
                bool flag = !HWID.GetCurrentHwProfile(intPtr);
                if (flag)
                {
                    throw new Exception("Error cant get current hw profile!");
                }
                Marshal.PtrToStructure(intPtr, hw_PROFILE_INFO);
                result = hw_PROFILE_INFO;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            finally
            {
                bool flag2 = intPtr != IntPtr.Zero;
                if (flag2)
                {
                    Marshal.FreeHGlobal(intPtr);
                }
            }
            return(result);
        }
示例#2
0
        // Token: 0x06000087 RID: 135 RVA: 0x00004248 File Offset: 0x00002448
        public static string Generate()
        {
            HWID.HW_PROFILE_INFO hw_PROFILE_INFO = HWID.ProfileInfo();
            string str          = hw_PROFILE_INFO.szHwProfileGuid.ToString();
            string volumeSerial = HWID.GetVolumeSerial(Environment.SystemDirectory.Substring(0, 1));

            return(HWID.MD5(str + volumeSerial));
        }