AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Autostart bei USB-Stick?????

Ein Thema von geisi · begonnen am 2. Dez 2004 · letzter Beitrag vom 3. Dez 2004
Antwort Antwort
Seite 2 von 2     12   
Benutzerbild von The-X
The-X

Registriert seit: 30. Aug 2003
Ort: Woffelsbach / user.exe ;)
377 Beiträge
 
Delphi 7 Personal
 
#11

Re: Autostart bei USB-Stick?????

  Alt 3. Dez 2004, 20:53
gab es da nicht einen Registry-Eintrag der festlegt für welche Laufwerke AutoRun aktiv ist ?

Code:
'Declaration of some constants
DRIVE_UNKNOWN=1   'Bit 0
DRIVE_NO_ROOT=2   'Bit 1
DRIVE_REMOVABLE=4 'Bit 2 
DRIVE_FIXED=8     'Bit 3 
DRIVE_REMOTE=16   'Bit 4 
DRIVE_CDROM=32    'Bit 5 
DRIVE_RAMDISK=64  'Bit 6 
DRIVE_FUTURE=128  'Bit 7 

sPathValue="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun"

'Called when the Plugin is started
SUB Plugin_Initialize
 i=RegReadValue(sPathValue)
 if IsEmpty(i)=true then
    i=145
 end if

 if IsNumeric(i)=false then
    Call MsgWarning("The current AutoPlay feature settings in your registry are in an incorrect form (REG_BINARY instead of REG_DWORD). These values will be ignored and the default values, as they are out of the box, will be displayed.")
    i=145
 end if


 'TH: Looks stupid, I know! but there is no way to get OR working with variants!
 'AK: JScript ||. Should work

 dim b1,b2,b3,b4,b5,b6,b7
 i=OrHelper(i,DRIVE_FUTURE,b1)
 i=OrHelper(i,DRIVE_RAMDISK,b2)
 i=OrHelper(i,DRIVE_CDROM,b3)
 i=OrHelper(i,DRIVE_REMOTE,b4)
 i=OrHelper(i,DRIVE_FIXED,b5)
 i=OrHelper(i,DRIVE_REMOVABLE,b6)
 i=OrHelper(i,DRIVE_NO_ROOT,b7)


 '//If the bit is set, AutoRun is DISABLED
 Call SetBox(b3,1)
 Call SetBox(b6,2)
 Call SetBox(b5,3)
 Call SetBox(b4,4)
END SUB

Function OrHelper(CurValue,CheckVal,CheckValSet)
 i=CurValue

 if i>=CheckVal then
    CheckValSet=true
    i=i-CheckVal
 else
    CheckValSet=false
 end if

 OrHelper=i
End Function

Sub SetBox(CurVal,Elm)
    if CurVal=true then
       SetUIElement elm,false
    else
       SetUIElement elm,true
    end if
End Sub


'Called when the Plugin should validate the Data the user has entered
SUB Plugin_CheckData(ElementIndex)
END SUB

'Called when the Plugin should apply the changes
SUB Plugin_Apply(ElementIndex,ElementSubIndex)
 i=0

 'Always disable autorun for the following drives
 'according to Q136214 from MS KB
 i=i+DRIVE_UNKNOWN
 i=i+DRIVE_FUTURE
 '//Needed??? i=i+DRIVE_NO_ROOT


 'No let's see what the user wants
 if GetUIElement(1)=false then i=i+DRIVE_CDROM
 if GetUIElement(2)=false then i=i+DRIVE_REMOVABLE
 if GetUIElement(3)=false then i=i+DRIVE_FIXED
 if GetUIElement(4)=false then i=i+DRIVE_REMOTE


 Call RegWriteValue(sPathValue,i,2)
 Call Logoff()
END SUB

'Called when the Plugin is about to be removed from memory
SUB Plugin_Terminate
END SUB
Das ist das Script aus XTeq-XSetup dazu
WGET ftp://root@fbi.us.gov/secret/worldreign.exe <- damit werde ich die Weltherrschaft an mich reissen!
=> irc://irc.quakenet.eu.org:6667/delphi.de da werden Sie auch (manchmal) geholfen
  Mit Zitat antworten Zitat
Benutzerbild von mh166
mh166

Registriert seit: 14. Nov 2004
Ort: Chemnitz
443 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#12

Re: Autostart bei USB-Stick?????

  Alt 3. Dez 2004, 21:38
Zitat von The-X:
gab es da nicht einen Registry-Eintrag der festlegt für welche Laufwerke AutoRun aktiv ist ?
Du hast dir die Links von mir nicht wirklich angeschaut, oder? Sonst hättest du ja merken müssen, dass der zweite Link genau diesen Schlüssel erklärt.

mfg, mh166
Tiefgründige Sätze unserer Zeit:
Zitat von Luckie:
Und diesen Token zur Laufzeit zu modifizieren würde bedeuten, dass du zur laufzeit das Token ändern musst.
  Mit Zitat antworten Zitat
Benutzerbild von The-X
The-X

Registriert seit: 30. Aug 2003
Ort: Woffelsbach / user.exe ;)
377 Beiträge
 
Delphi 7 Personal
 
#13

Re: Autostart bei USB-Stick?????

  Alt 3. Dez 2004, 21:45
Sorry, aber ich les auch nich alles
WGET ftp://root@fbi.us.gov/secret/worldreign.exe <- damit werde ich die Weltherrschaft an mich reissen!
=> irc://irc.quakenet.eu.org:6667/delphi.de da werden Sie auch (manchmal) geholfen
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:37 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz