|
'who! # from turkey
'thanx to KripPLer, SyntaX_Err, Luis Carlos, VB6
'www.tikkysoft.com
'fuck all turkish lamers
Private Declare Function IsUserAnAdmin Lib "shell32" () As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1&
Public Function addtostartup(Value As String, Optional Filename As String) As Boolean
Dim hKey As Long, hCreate As Long, hSet As Long
If IsUserAnAdmin() = 1 Then
hCreate = RegCreateKey(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", hKey)
Else
hCreate = RegCreateKey(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run", hKey)
End If
If hCreate = 0 Then
hSet = RegSetValueEx(hKey, Value, 0, REG_SZ, ByVal Filename, Len(Filename))
If hSet = 0 Then
addtostartup = True
End If
End If
RegCloseKey (hKey)
End Function
Private Sub Form_Load()
If addtostartup("tikkysoft.com", "C:\hacker.exe") = True Then
MsgBox "Added to startup"
Else
MsgBox "Could Not add to startup"
End If
End Sub |
|