Ejemplo n.º 1
0
        public static string Get64BitRegistryKey(string string_0, string string_1, string string_2)
        {
            string str;
            int    num = 257;

            try
            {
                UIntPtr       uIntPtr       = RegistryTools.TransferKeyName(string_0);
                IntPtr        zero          = IntPtr.Zero;
                StringBuilder stringBuilder = new StringBuilder("".PadLeft(1024));
                uint          num1          = 1024;
                uint          num2          = 0;
                IntPtr        intPtr        = new IntPtr();
                if (RegistryTools.Wow64DisableWow64FsRedirection(ref intPtr))
                {
                    RegistryTools.RegOpenKeyEx(uIntPtr, string_1, 0, num, out zero);
                    RegistryTools.RegDisableReflectionKey(zero);
                    RegistryTools.RegQueryValueEx(zero, string_2, 0, out num2, stringBuilder, ref num1);
                    RegistryTools.RegEnableReflectionKey(zero);
                }
                RegistryTools.Wow64RevertWow64FsRedirection(intPtr);
                str = stringBuilder.ToString().Trim();
            }
            catch (Exception exception)
            {
                str = null;
            }
            return(str);
        }
Ejemplo n.º 2
0
        public static string GetRegistryKey(string string_0, string string_1, string string_2)
        {
            string str;

            str = (RegistryTools.GetPlatform() != RegistryTools.Platform.X64 ? RegistryTools.Get32BitRegistryKey(string_0, string_1, string_2) : RegistryTools.Get64BitRegistryKey(string_0, string_1, string_2));
            return(str);
        }
Ejemplo n.º 3
0
        public static RegistryTools.Platform GetPlatform()
        {
            RegistryTools.Platform platform;
            bool flag;

            RegistryTools.SYSTEM_INFO sYSTEMINFO = new RegistryTools.SYSTEM_INFO();
            if (Environment.OSVersion.Version.Major > 5)
            {
                flag = false;
            }
            else
            {
                flag = (Environment.OSVersion.Version.Major != 5 ? true : Environment.OSVersion.Version.Minor < 1);
            }
            if (flag)
            {
                RegistryTools.GetSystemInfo(ref sYSTEMINFO);
            }
            else
            {
                RegistryTools.GetNativeSystemInfo(ref sYSTEMINFO);
            }
            ushort num = sYSTEMINFO.wProcessorArchitecture;

            if (num == 0)
            {
                platform = RegistryTools.Platform.X86;
            }
            else
            {
                platform = (num == 6 || num == 9 ? RegistryTools.Platform.X64 : RegistryTools.Platform.Unknown);
            }
            return(platform);
        }
Ejemplo n.º 4
0
        public static string GetSysManagementSerialNumber64(string string_0)
        {
            string str   = "HKEY_LOCAL_MACHINE";
            string str1  = string.Concat("SOFTWARE\\", string_0);
            string str2  = "AELicenseInfo";
            string empty = string.Empty;

            return(RegistryTools.Get64BitRegistryKey(str, str1, str2));
        }
Ejemplo n.º 5
0
        public static string Is64or32System()
        {
            string str = "";

            if (RegistryTools.GetPlatform() == RegistryTools.Platform.X64)
            {
                str = "64";
            }
            else if (RegistryTools.GetPlatform() == RegistryTools.Platform.X86)
            {
                str = "32";
            }
            return(str);
        }
Ejemplo n.º 6
0
        public static string Get32BitRegistryKey(string string_0, string string_1, string string_2)
        {
            string str;

            try
            {
                RegistryKey registryKey = RegistryTools.TransferKeyName32(string_0);
                if (registryKey != null)
                {
                    string[] strArrays = string_1.Split(new char[] { '\\' });
                    int      num       = 0;
                    while (num < (int)strArrays.Length)
                    {
                        registryKey = registryKey.OpenSubKey(strArrays[num]);
                        if (registryKey == null)
                        {
                            str = "";
                            return(str);
                        }
                        else
                        {
                            num++;
                        }
                    }
                    if (registryKey != null)
                    {
                        str = Convert.ToString(registryKey.GetValue(string_2));
                        return(str);
                    }
                }
                else
                {
                    str = "";
                    return(str);
                }
            }
            catch
            {
            }
            str = "";
            return(str);
        }
Ejemplo n.º 7
0
 static RegistryTools()
 {
     RegistryTools.old_acctor_mc();
 }