Jump to content

Total USB Security


logmein
 Share

Poll!  

11 members have voted

  1. 1. What do you want to change?

  2. 2. How do you think about the program?

    • Exellent!
    • Very Good!
    • Good!
    • Not Bad!
      0
    • Bad!
      0
    • Awful!!!
      0


Recommended Posts

http://usbsecurity.ucoz.org

2.2.2.0

History

Total USB Security History

[version][mm-dd-yyyy]

[2.0.0.0][02-07-2010]

- CHANGED PROGRAM NAME TO : TOTAL USB SECURITY

- CHANGED WEBSITE : WWW.USBSECURITY.UCOZ.COM

- Added : two new language : Vietnamese and French

- Added : new feature : QUARANTINE and MD5 HASH GENERATOR

- Added : more options

- Fixed : Dectect and Remove bugs

- Fixed : Update bug

- Fixed : Install bug

[2.1.2.0][02-26-2010]

- Changed : Total USB Security now work as a excutable program

- Added : Windows Fix

+ Registry Errors Fix

+ Registry Changes Fix

- Fixed : backup errors

- Fixed : update bugs

- Fixed : French grammar

[2.1.5.0][03-20-2010]

- Fixed : Windows Fix

- Fixed : install bugs

[2.2.0.0][03-28-2010]

- Added : Startup Manager

- Added : Languages stored in seperated files

- Fixed : Language bugs

[2.2.2.0][05-24-2010]

- Fixed : Frech

- Fixed : Small bug

Features

- Real-time protections against USB autoruns and viruses

- Creates immunity your USB with Fake Autorun

- Fixes Windows errors was made by viruses

- View and manage startup programs

- Multi-language : English, Vietnamese and France

- Doesn't slow down your system

- Support most of Windows platforms : XP, 2000, 2003

- Automatically Update function

Screenshots

Posted Image

Posted Image

Posted Image

Notes

- French is still in beta, please report its mistakes to me!

- In order to cancel update progress, press Ctrl+Esc

- To change the program's language, please change it from Settings tab, then restart the program

- MD5 generating function has removed from the program.

- I'm a beginner in AutoIt, so my script may be in chaos. Edit it, please!

- Some variables named randomize or in Vietnamese, so it's difficult to understand.

Downloads

Download 2.2.0.0 (Direct)

Source

Download this archive and put files in : @WindowsDir & '\Total USB Security'.

http://www.mediafire.com/?zoj4oniuyg2

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Icon & Image\usbpendrive_mount.ico
#AutoIt3Wrapper_outfile=C:\Documents and Settings\FFK\Desktop\Total USB Security.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=For noncommecial uses only!
#AutoIt3Wrapper_Res_Description=Defends computer against threats from USB
#AutoIt3Wrapper_Res_Fileversion=2.2.2.0
#AutoIt3Wrapper_Res_LegalCopyright=Huynh Minh Thanh
#AutoIt3Wrapper_Res_File_Add=C:\Windows\Total USB Security\Configs.ini
#AutoIt3Wrapper_Res_File_Add=C:\Windows\Total USB Security\beep.wav
#AutoIt3Wrapper_Res_File_Add=C:\Windows\Total USB Security\History.txt
#AutoIt3Wrapper_Res_File_Add=C:\Windows\Total USB Security\Total USB Security Help.html
#AutoIt3Wrapper_Tidy_Stop_onerror=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiComboBox.au3>
#Include <GuiListView.au3>
#include <String.au3>
#Include <Process.au3>
#Include <Misc.au3>
#Include <Date.au3>
#Include <File.au3>
#Include <GuiImageList.au3>
Opt("TrayMenuMode", 1)
HotKeySet ('+{Esc}','_abort')
Dim $working = ''
Dim $working2 = ''
Dim $programtitle = 'Total USB Security'
Dim $ver = '2.2.0.0'
Dim $ReleaseDate = '03-28-2010'
Dim $prooff = 0
Dim $password = 'thanh'
Dim $listed = ''
Dim $installdir = @WindowsDir & '\Total USB Security'
Dim $inipath = $installdir & '\Configs.ini'
Dim $quadir = $installdir & '\Quarantine'
Dim $startupkey1 = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run'
Dim $startupkey2 = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run'
_getlanguagefile ()
_installfiles ()
Func _installfiles ()
    DirCreate ($installdir)
    DirCreate ($installdir & '\Languages\')
    If Not FileExists ($installdir & '\Configs.ini') Then
        FileInstall ('C:\Program Files\Total USB Security\Configs.ini', $installdir & '\Configs.ini')
    EndIf
    ;If Not FileExists ($installdir & '\Languages\English.lng') Then
        FileInstall ('C:\Program Files\Total USB Security\Languages\English.lng',$installdir & '\Languages\English.lng')
    ;EndIf
    If Not FileExists ($installdir & '\Languages\French.lng') Then
        FileInstall ('C:\Program Files\Total USB Security\Languages\French.lng',$installdir & '\Languages\French.lng')
    EndIf
    If Not FileExists ($installdir & '\Languages\Vietnamese.lng') Then
        FileInstall ('C:\Program Files\Total USB Security\Languages\Vietnamese.lng',$installdir & '\Languages\Vietnamese.lng')
    EndIf
    FileInstall ('C:\Program Files\Total USB Security\beep.wav',$installdir & '\Beep.wav')
    FileInstall ('C:\Program Files\Total USB Security\History.txt',$installdir & '\History.txt')
    FileInstall ('C:\Program Files\Total USB Security\Total USB Security Help.html',$installdir & '\Total USB Security Help.html')
EndFunc

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\FFK\Desktop\MINH THANH\Autorun Destroyer\Main.kxf
$Form = GUICreate("Total USB Security " & $ver, 545, 345, -1, -1)
GUISetFont(10, 400, 0, "Arial")
$US = GUICtrlCreateTab(8, 16, 529, 321)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem(_lang("USB Shi&eld"))
$Label1 = GUICtrlCreateLabel(_lang("Detected autoruns && files :"), 24, 58, 200, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$DList = GUICtrlCreateListView(_lang("Path|Size|Risk Level"), 24, 88, 498, 198)
$DListHdl = GUICtrlGetHandle (-1)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 280)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 110)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btRemove = GUICtrlCreateButton(_lang("&Remove"), 300, 296, 100, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btRemoveAll = GUICtrlCreateButton(_lang("R&emove all"), 400, 296, 125, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem(_lang("F&ake Autorun"))
$Label2 = GUICtrlCreateLabel(_lang("Drive list :"), 24, 56, 120, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$FList = GUICtrlCreateListView(_lang("Drive|Label|Free/Total Space|Type|Status"), 24, 88, 498, 198)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 150)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 120)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 93)
$FlistHdl = GUICtrlGetHandle (-1)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btCreateFake = GUICtrlCreateButton(_lang("Create Fake Autorun"), 270, 296, 130, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btRemoveFake = GUICtrlCreateButton(_lang("&Remove"), 400, 296, 125, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
;---------------------------QUARANTINE---------------------------------
$TabSheet2 = GUICtrlCreateTabItem(_lang("&Quarantine"))
$Label2 = GUICtrlCreateLabel(_lang("Removed files :"), 24, 56, 120, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$QList = GUICtrlCreateListView(_lang("Origin Path|Quarantine"), 24, 88, 498, 198)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 225)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 300)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 270)
$QlistHdl = GUICtrlGetHandle (-1)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btRefresh = GUICtrlCreateButton(_lang("&Refresh"), 290-110, 296, 110, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btRestore = GUICtrlCreateButton(_lang("&Restore"), 290, 296, 110, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btEmpty = GUICtrlCreateButton(_lang("&Empty"), 400, 296, 125, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
;------------------------------------------------------------------------------------------------------------------------------------

$TabSheet2 = GUICtrlCreateTabItem(_lang("&Win Fix"))
$Label2 = GUICtrlCreateLabel(_lang("Items :"), 24, 56, 95, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$RList = GUICtrlCreateListView(_lang("Items|State"), 24, 88, 498, 198)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 300)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 170)
$RlistHdl = GUICtrlGetHandle (-1)

GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btRepair = GUICtrlCreateButton(_lang("&Repair system"), 400, 296, 125, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
;;------------------------------------------------------------------------------------------------------------------------------------

$TabSheet3 = GUICtrlCreateTabItem(_lang("&Start up"))
$Label2 = GUICtrlCreateLabel(_lang("Start up Items :"), 24, 56, 150, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$SList = GUICtrlCreateListView(_lang("Program|Key|File"), 24, 88, 498, 198)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 150)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 500)
$SlistHdl = GUICtrlGetHandle (-1)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$btSRemove = GUICtrlCreateButton(_lang("&Remove"), 400, 296, 125, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")

;;------------------------------------------------------------------------------------------------------------------------------------

$TabSheet3 = GUICtrlCreateTabItem(_lang("&Settings"))
$Group1 = GUICtrlCreateGroup(_lang("General settings"), 24, 48, 495, 273)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$LoadStartup = GUICtrlCreateCheckbox(_lang("&Load in Startup"), 40, 80, 160, 17)
$ShowDialog = GUICtrlCreateCheckbox(_lang("&Start minimized"), 40, 112, 160, 17)
$EnableSounds = GUICtrlCreateCheckbox(_lang("&Enable Sounds"), 40, 144, 160, 17)
$MinimizeonClose = GUICtrlCreateCheckbox (_lang('Minimi&ze on close'),40,176,160,17)
$EnableAutoUpdate = GUICtrlCreateCheckbox (_lang('En&able Auto Update'),40,208,200,17)
$Language = GUICtrlCreateLabel (_lang('Language :'),300,80,100,17)
$langlist = GUICtrlCreateCombo ('',300,112,120,17)
GUICtrlSetData (-1,StringReplace(_getlanguagefile (),'.lng',''))
;GUICtrlSetData(-1, 'English|Français|Vietnamese', "English")
$hLangList = GUICtrlGetHandle (-1)
;$bApply = GUICtrlCreateButton (_lang('Apply Language'),300,144,120,25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TabSheet4 = GUICtrlCreateTabItem(_lang("In&formation"))
$Label10 = GUICtrlCreateLabel(_lang("Product Version :"), 24, 64, 105, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$PVersion = GUICtrlCreateInput($ver, 240-20, 64, 121, 24, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlSetFont(-1, 10, 800, 0, "Arial")
$Label11 = GUICtrlCreateLabel(_lang("Release Date :"), 24, 104, 125, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$PRDate = GUICtrlCreateInput($releasedate, 240-20, 104, 121, 24, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Infos = GUICtrlCreateEdit("", 24, 144, 497, 169, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetData(-1, StringFormat(_lang("Author : Huynh Minh Thanh (LogMeIn)\r\nEmail : minhthanh.autoit@gmail.com\r\nWebsite : www.USBSecurity.ucoz.org\r\n\r\nCopyright(c) 2008-2009 by Huynh Minh Thanh\r\n\r\nThis product used :\r\n\r\nAutoIT 3 v 3.3.0.0\r\nKoda Form Designer\r\nScite4AutoIT3\r\n\r\n")));Special Thanks to :\r\n\r\n1\r\n2\r\n3\r\n\r\nand who helped me to completed this project!"))
GUICtrlSetFont(-1, 10, 400, 0, "Arial")
$Label3 = GUICtrlCreateLabel("Website", 400, 64, 50, 21)
GUICtrlSetFont(-1, 11, 400, 4, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor (-1, 0)
$Label4 = GUICtrlCreateLabel(_lang("Help"), 400, 104-15, 70, 21)
GUICtrlSetFont(-1, 11, 400, 4, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor (-1, 0)

$his = GUICtrlCreateLabel(_lang("History"), 400, 144-30, 70, 21)
GUICtrlSetFont(-1, 11, 400, 4, "Arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor (-1, 0)

GUICtrlCreateTabItem("")
TraySetClick("9")
$ShowCP = TrayCreateItem(_lang("&Show Control Panel"))
TrayCreateItem("")
$mUpdateNow = TrayCreateItem(_lang("&Update Now !"))
TrayCreateItem("")
$mExit = TrayCreateItem(_lang("&Exit"))
if _loadini ('Language') <> ''  Then
    _GUICtrlComboBox_SelectString ($LangList,_loadini('Language'))
EndIf
_update ()
If _loadini ('StartMinimized') = 4 Then
    GUISetState (@SW_SHOW)
Else
    GUISetState (@SW_HIDE)
EndIf

#EndRegion ### END Koda GUI section ###

TraySetToolTip ('Total USB Security ' & $ver)
_getquarantineitem ()
_getstartupitem ()
_load ()


While 1

    $nMsg = GUIGetMsg ()
    $tMsg = TrayGetMsg ()
    _check ()
    ;_getquarantineitem ()
    _checkquarantineitem ()
    Select
    case $nMsg = $his
        ;$hGUI = SplashTextOn ('History - Press Enter to quit!',FileRead ($installdir & '\History.txt'),500,750,-1,-1,18,'Arial',10,400)
        ShellExecute ($installdir & '\History.txt')
    Case $tMsg = $mUpdateNow
        _update ()
    Case $nmsg = $label3
        ShellExecute ('http://usbsecurity.ucoz.org/')
    Case $nMsg = $label4
        ShellExecute ($installdir & '\Total USB Security Help.html')
    Case $nMsg = $GUI_EVENT_CLOSE
        If GUICtrlRead ($MinimizeonClose) = 1 Then
            GUISetState (@SW_HIDE)
        Else
            _exit ()
        EndIf
    Case $nMsg = $btRefresh
        _getquarantineitem ()
    Case $tMsg = $mExit
        _Exit ()
    Case $nMsg = $btRemove
        _remove ()

    Case $nMsg = $btRemoveAll
        _removeall ()
    Case $nMsg = $btRestore
        _restore ()
    Case $nMsg = $btRepair
        _repair ()
    Case $nmsg = $btSRemove
        $get = _GUICtrlListView_GetSelectedIndices ($SlistHdl,True)
        If $get[0] = 1 Then
            $regbase = _GUICtrlListView_GetItem ($SlistHdl,$get[1],1)
            $regname = _GUICtrlListView_GetItem ($SlistHdl,$get[1],0)
            ConsoleWrite ('REGbase : ' & $regbase[3] & @CRLF)
            If $regbase[3] = 'HKCU' Then
                $key = $startupkey1
            Else
                $key = $startupkey2
            EndIf
            ConsoleWrite ($key & '\' & $regname[3] & @CRLF)
            $delreg = RegDelete ($key,$regname[3])
            If Not @error Then
                _GUICtrlListView_DeleteItem ($SlistHdl,$get[1])
            Else
                MsgBox (32,'Error',_lang('Can''t remove registry key!'),'',$form)
            EndIf
        EndIf

    Case $nMsg = $btCreateFake

        $select = _GUICtrlListView_GetSelectedIndices ($FListHdl,True) ; get Selected item index

        If $select[0] <> 0 Then;check if item is selected
            $pos = _GUICtrlListView_GetItem ($FListHdl,$select[1]);get item index
            FileDelete ($pos[3] & '\autorun.inf')
            ConsoleWrite ($pos[3])
            If FileExists ($pos[3]) Then;check drive exists
                _RunDOS ('@echo off')
                _RunDOS ('mkdir ' & $pos[3] & '\autorun.inf\candel...\')
                _RunDOS ('attrib +s +r +h autorun.inf')

                If FileExists ($pos[3] & '\autorun.inf') Then
                    _GUICtrlListView_AddSubItem ($FlistHdl,$select[1],_lang('CREATED'),4)
                    ;ConsoleWrite ('created')

                Else
                    _GUICtrlListView_AddSubItem ($FlistHdl,$select[1],_lang('UNCREATED'),4)
                    ;ConsoleWrite ('uncreated')

                EndIf


            EndIf

        EndIf

    Case $nMSg = $btRemoveFake
        $select = _GUICtrlListView_GetSelectedIndices ($FListHdl,True) ; get Selected item index

        If $select[0] <> 0 Then;check item
            $pos = _GUICtrlListView_GetItem ($FListHdl,$select[1]);get item index
            If FileExists ($pos[3]) Then

                _RunDOS ('attrib -s -r -h ' & $pos[3] & '\autorun.inf')
                _RunDOS ('rmdir ' & $pos[3] & '\autorun.inf /S /Q')
                If FileExists ($pos[3] & '\autorun.inf') Then

                    _GUICtrlListView_AddSubItem ($FlistHdl,$select[1],_lang('CREATED'),4)
                    ConsoleWrite ('undeleted : ' & $pos[3] & '\autorun.inf\')

                Else
                    _GUICtrlListView_AddSubItem ($FlistHdl,$select[1],_lang('UNCREATED'),4)
                    ConsoleWrite ('deleted')

                EndIf

            EndIf
        EndIf

    Case $tMsg = $ShowCP
        GUISetState (@SW_SHOW)
    Case $nMsg = $btEmpty
        _empty ()
    ;Case $nmsg = $MiniTray
    ;   GUISetState (@SW_HIDE)

    EndSelect
WEnd
                ;run[ = C:\]
                ;run[=C:\]
                ;run[ =C:\]
Func _getlanguagefile ()

    Local $list
    $hdl = FileFindFirstFile ($installdir & '\Languages\*.lng')
    If $hdl = -1 Then
        FileInstall ('C:\Program Files\Total USB Security\Languages\English.lng',$installdir & '\Languages\English.lng')
    EndIf

    If _loadini ('Language') = 'error' Then
        _writeini ('Language','English')
    EndIf

    While 1
        $file = FileFindNextFile ($hdl)
        If @error Then ExitLoop
        $list &= $file & '|'
    WEnd
    FileClose ($hdl)
    ConsoleWrite ($list & @crlf)
    Return $list


EndFunc

Func _lang ($name)

    $readlang = IniRead ($installdir & '\Languages\' & _loadini ('Language') & '.lng',_loadini ('Language'),$name,'error')
    ConsoleWrite ($installdir & '\Languages\' & _loadini ('Language') & '.lng')

    Return $readlang
EndFunc

Func _repair ()
    _GUICtrlListView_DeleteAllItems ($RlistHdl)
    ;GUISetState (@SW_HIDE,$SForm)
    GUISetState (@SW_DISABLE,$Form)
    SplashTextOn ($programtitle,@CRLF & _lang('Working...'),300,100,-1,-1,3,'Arial',12,800)
    _cleanregistry ()
    ;_cleanmisc ()
    ;_cleansystem ()
    SplashOff ()
    GUISetState (@SW_ENABLE,$Form)
EndFunc
Func _cleanmisc ()
        Local $size1 , $size2 , $size3, $size4,$size5,$size6,$size7, $totalsize
        ;C:\Documents and Settings\FFK\Recent
        ;----------------------------------------------Recycle Bin---------------------------------------------------------------
        $empty1 = FileRecycleEmpty ()
        If $empty1 = 1 Then
            $item = _GUICtrlListView_AddItem ($RlistHdl,_lang('Recycle Bin'))
            _GUICtrlListView_AddSubItem ($RListHdl,$item,_lang('Clean'),1)
        Else
            $item = _GUICtrlListView_AddItem ($RlistHdl,_lang('Recycle Bin'))
            _GUICtrlListView_AddSubItem ($RListHdl,$item,_lang('Can not clean'),2)
        EndIf
        ;----------------------------------------------Clipboard---------------------------------------------------------------
        $empty2 = ClipPut ('')
        If $empty2 = 1 Then
            $item = _GUICtrlListView_AddItem ($RlistHdl,_lang('Clipboard'))
            _GUICtrlListView_AddSubItem ($RListHdl,$item,_lang('Clean'),1)
        Else
            $item = _GUICtrlListView_AddItem ($RlistHdl,_lang('Clipboard'))
            _GUICtrlListView_AddSubItem ($RListHdl,$item,_lang('Can not clean'),1)
        EndIf

        ;----------------------------------------------Temporary Files---------------------------------------------------------------
        Local $FileList = ''

        $fList = _FileListToArray (@TempDir,'*')
        ConsoleWrite (@CRLF & '-------------------------Temporary Files----------------------' & @CRLF)
        If $flist <> 0 Then

            For $i = 1 To $fList[0]
                ConsoleWrite (@TempDir & '\' & $fList[$i] & @TAB & FileGetSize (@TempDir & '\' & $fList[$i]) & @CRLF)
                $size1 += FileGetSize (@TempDir & '\' & $fList[$i])
                FileDelete (@TempDir & '\' & $fList[$i])
            Next
        EndIf
        ;----------------------------------------------Flash Player---------------------------------------------------------------
        $dir = @AppDataDir & '\Macromedia\Flash Player'
        $fList = _FileListToArray ($dir,'*')
        ConsoleWrite ('-------------------------Plash Player----------------------' & @CRLF)
        If $flist <> 0 Then

            For $i = 1 To $fList[0]
                ConsoleWrite ($dir & '\' & $fList[$i] & @TAB & FileGetSize ($dir & '\' & $fList[$i]) & @CRLF)
                $size1 += FileGetSize ($dir & '\' & $fList[$i])
                FileDelete ($dir & '\' & $fList[$i])
            Next
        EndIf
        ;----------------------------------------------Temporary Local Setting---------------------------------------------------------------
        $dir = @UserProfileDir & '\Local Settings\Temp'
        $fList = _FileListToArray ($dir,'*')
        ConsoleWrite ('-------------------------Local Settings Temporary Files----------------------' & @CRLF)
        ;ConsoleWrite (@CRLF & '' & @CRLF)
        If $flist <> 0 Then

            For $i = 1 To $fList[0]
                ConsoleWrite ($dir & '\' & $fList[$i] & @TAB & FileGetSize ($dir & '\' & $fList[$i]) & @CRLF)
                $size1 += FileGetSize ($dir & '\' & $fList[$i])
                FileDelete ($dir & '\' & $fList[$i])
            Next
        EndIf
        ;----------------------------------------------Temporary Files---------------------------------------------------------------
        ConsoleWrite ('-------------------------Temporary Windows----------------------' & @CRLF)
        $flist2 = _FileListToArray (@WindowsDir & '\Temp\','*')
        If $flist2 <> 0 Then

            For $i = 1 to $flist2[0]
                ConsoleWrite (@WindowsDir & '\Temp\' & $flist2[$i] & @TAB & FileGetSize (@WindowsDir & '\Temp\' & $flist2[$i]) & @CRLF)
                $size1 += FileGetSize (@WindowsDir & '\Temp\' & $flist2[$i])
                FileDelete (@WindowsDir & '\Temp\' & $flist2[$i])
            Next
        EndIf
        ;----------------------------------------------Cal MB Removed---------------------------------------------------------------
        $totalsize = $size1
        ConsoleWrite ('------------------TOTAL SIZE : ' & $totalsize & ' --------------' & @CRLF)


        $item = _GUICtrlListView_AddItem ($RlistHdl,_lang('Temporary Files'))
        _GUICtrlListView_AddSubItem ($RListHdl,$item,int($totalsize/1024) & ' kB ' & _lang('MB Removed'),1)

EndFunc

Func _cleansystem ()
    Local $item[10][3]
            $item[0][0] = 'Run Trace'
            $item[0][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU'
            $item[0][2] = ''

            $item[1][0] = 'Registry Last Open'
            $item[1][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit'
            $item[1][2] = 'LastKey'

            $item[2][0] = 'Move to/Copy to Trace'
            $item[2][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CopyMoveTo'
            $item[2][2] = 'LastFolder'

            $item[3][0] = 'Open/Save Trace'
            $item[3][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32'
            $item[3][2] = 'LastVisitedMRU'

            $item[4][0] = 'Old Icons'
            $item[4][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify'
            $item[4][2] = 'PastIconsStream'

            $item[5][0] = 'Typed URLs'
            $item[5][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs'
            $item[5][2] = ''

            $item[6][0] = 'Wallpaper Paths'
            $item[6][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpaper\MRU'
            $item[6][2] = ''

    For $i = 0 to 6
        If $item[$i][2] <> '' Then

            RegDelete ($item[$i][1],$item[$i][2])
        Else
            RegDelete ($item[$i][1])
        EndIf

        ;RegDelete ('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit','LastKey')
        If Not @error Then
            $index = _GUICtrlListView_AddItem ($RListHdl,_lang($item[$i][0]))
            _GUICtrlListView_AddSubItem ($RListHdl,$index,_lang('Clean'),1)
        Else
            $index = _GUICtrlListView_AddItem ($RListHdl,_lang($item[$i][0]))
            _GUICtrlListView_AddSubItem ($RListHdl,$index,_lang('Can not clean'),1)
        EndIf
    Next
EndFunc

Func _cleanregistry ()
    Local $item[16][5]
            $item[0][0] = 'Shutdown Button'
            $item[0][1] = 'HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
            $item[0][2] = 'ShutdownWithoutLogon'
            $item[0][3] = '1'
            $item[0][4] = 'REG_SZ'

            $item[1][0] = 'Hardware Tab'
            $item[1][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[1][2] = 'NoHardwareTab'
            $item[1][3] = '0'
            $item[1][4] = 'REG_DWORD'

            $item[2][0] = 'Folder Options'
            $item[2][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[2][2] = 'NoFolderOptions'
            $item[2][3] = '0'
            $item[2][4] = 'REG_DWORD'

            $item[3][0] = 'File Menu'
            $item[3][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[3][2] = 'NoFileMenu'
            $item[3][3] = '0'
            $item[3][4] = 'REG_DWORD'

            $item[4][0] = 'Context Menu'
            $item[4][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[4][2] = 'NoViewContextMenu'
            $item[4][3] = '0'
            $item[4][4] = 'REG_DWORD'

            $item[5][0] = 'Control Panel'
            $item[5][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideMyComputerIcons'
            $item[5][2] = '{21EC2O2O-3AEA-1O69-A2DD-08002b30309d}'
            $item[5][3] = '0'
            $item[5][4] = 'REG_DWORD'

            $item[6][0] = 'Properties Menu'
            $item[6][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[6][2] = 'NoPropertiesMyComputer'
            $item[6][3] = '0'
            $item[6][4] = 'REG_DWORD'

            $item[7][0] = 'Desktop Recycle Bin'
            $item[7][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\NonEnum'
            $item[7][2] = '{645FF040-5081-101B-9F08-00AA002F954E}'
            $item[7][3] = '0'
            $item[7][4] = 'REG_DWORD'

            $item[8][0] = 'Desktop Internet Explorer'
            $item[8][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[8][2] = 'NoInternetIcon'
            $item[8][3] = '0'
            $item[8][4] = 'REG_DWORD'

            $item[9][0] = 'Removable Disk Access'
            $item[9][1] = 'HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
            $item[9][2] = 'AllocateDASD'
            $item[9][3] = '2'
            $item[9][4] = 'REG_DWORD'

            $item[10][0] = 'Task Manager'
            $item[10][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System'
            $item[10][2] = 'DisableTaskMgr'
            $item[10][3] = '0'
            $item[10][4] = 'REG_DWORD'

            $item[11][0] = 'Registry Editor'
            $item[11][1] = 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System'
            $item[11][2] = 'DisableRegistryTools'
            $item[11][3] = '0'
            $item[11][4] = 'REG_DWORD'

            $item[12][0] = 'CD-ROM Access'
            $item[12][1] = 'HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
            $item[12][2] = 'AllocateCDRoms'
            $item[12][3] = '1'
            $item[12][4] = 'REG_DWORD'

            $item[13][0] = 'Windows Button'
            $item[13][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[13][2] = 'NoWinKeys'
            $item[13][3] = '0'
            $item[13][4] = 'REG_DWORD'

            $item[14][0] = 'All Programs Menu'
            $item[14][1] = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
            $item[14][2] = 'NoStartMenuMorePrograms'
            $item[14][3] = '0'
            $item[14][4] = 'REG_DWORD'

            $item[15][0] = 'Run Button'
            $item[15][1] = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
            $item[15][2] = 'Start_ShowRun'
            $item[15][3] = '1'
            $item[15][4] = 'REG_DWORD'
    ;ProgressOn ('System Optimizer','Repairing Registry...','',-1,-1,18)
    For $i = 0 To 15
        $split = StringSplit ($item[$i][2],'|')
        RegWrite ($item[$i][1],$item[$i][2],$item[$i][4],$item[$i][3])
        If Not @error Then
            $index = _GUICtrlListView_AddItem ($RListHdl,_lang($item[$i][0]))
            _GUICtrlListView_AddSubItem ($RListHdl,$index,_lang('Restored'),1)
        Else
            $index = _GUICtrlListView_AddItem ($RListHdl,_lang($item[$i][0]))
            _GUICtrlListView_AddSubItem ($RListHdl,$index,_lang('Can not restore'),1)
        EndIf
    Next
EndFunc
Func _restore ()
    $select = _GUICtrlListView_GetSelectedIndices ($QListHdl,True);get selected item index
    If $select[0] <> 0 Then;check if item is selected
        $getitemorigin = _GUICtrlListView_GetItem ($QListHdl,$select[1])
        $getitem = _GUICtrlListView_GetItem ($QListHdl,$select[1],1)
        ConsoleWrite ($quadir & '\' & $getitem[3] & @CRLF & $getitemorigin[3] & @CRLF)
        If FileExists ( _GUICtrlListView_GetItem ($QListHdl,$select[1],1)) Then
            $msg = MsgBox (32+4,$programtitle,_lang('File already exists! Overwrite?'),'',$form)
            If $msg = 6 Then
                FileMove ($quadir & '\' & $getitem[3],$getitemorigin[3],1)
                If FileExists ($getitemorigin[3]) Then
                    $listed = StringReplace ($listed,$getitem[3],'')
                    _GUICtrlListView_DeleteItem ($QListHdl,$select[1])
                Else
                    MsgBox (16,$programtitle,_lang('Can not restore file!'),'',$form)
                    Return
                EndIf

            Else
                Return
            EndIf
        Else
            FileMove ($quadir & '\' & $getitem[3],$getitemorigin[3],1)

            If FileExists ($getitemorigin[3]) Then
                $listed = StringReplace ($listed,$getitem[3],'')
                _GUICtrlListView_DeleteItem ($QListHdl,$select[1])
            Else
                MsgBox (16,$programtitle,_lang('Can not restore file!'),'',$form)
                Return
            EndIf
            Return
        EndIf
    EndIf
    Return
EndFunc

Func _empty ()
    Local $i = 0
    $msg = MsgBox (32+4,$programtitle,_lang('Are you sure to empty backup files?'),'',$form)
    If $msg = 6 Then
        $count = _GUICtrlListView_GetItemCount($QListHdl)
        ConsoleWrite ('Count :' & $count & @CRLF)
        For $i = 0 to $count +1
            $getquapath = _GUICtrlListView_GetItem ($QListHdl,$i,1)
            $finalpath = $quadir & '\' & $getquapath[3]
            If FileExists ($finalpath) Then
                FileSetAttrib ($finalpath,'+N-RASH')
                FileDelete ($finalpath)
                If Not FileExists ($finalpath) Then
                    _GUICtrlListView_DeleteItem ($QListHdl,$i)
                EndIf
            EndIf
        Next
    Else
        Return
    EndIf

EndFunc

Func _getquarantineitem ()
    ConsoleWrite('-----------------FOUND FILES-----------------' & @CRLF)
    Local $i
    $hdl = FileFindFirstFile ($quadir & '\*.backup')
    If $hdl = -1 Then
        Return
    EndIf
    ConsoleWrite ('Listed :' & $listed & @CRLF)
    While 1
        $file = FileFindNextFile ($hdl)
        ConsoleWrite ($file & @CRLF )
        If @error = 1 Then
            ConsoleWrite ('--------------------END------------------' & @CRLF)
            FileClose($hdl)
            ExitLoop
        EndIf
        ;$md5 = _md5($quadir & '\' & $file)
        If Not StringInStr ($listed,$file) Then;neu tap tin chua co trong danh sach

            $bet = _stringbetween ($file, '_','.backup')
            If $bet <> 0 Then
                $replaced = StringReplace($bet[0],'_',':\')
            Else
                ExitLoop
            EndIf
            $create = _GUICtrlListView_AddItem ($QListHdl,$replaced)
            _GUICtrlListView_AddSubItem ($QListHdl,$create,$file,1)
            $listed &= $file

        Else
            ContinueLoop
        EndIf

    WEnd
    FileClose($hdl)
    Return
EndFunc
Func _checkquarantineitem ()
    $count = _GUICtrlListView_GetItemCount ($QListHdl)
    For $i = 0 to $Count
        $get = _GUICtrlListView_GetItem ($QListHdl,$i,1)
        If Not FileExists ($quadir & '\' & $get[3]) then
            _GUICtrlListView_DeleteItem ($QListHdl,$i)
        EndIf
    Next
    Return
EndFunc

Func _remove ()
    ConsoleWrite (@CRLF & 'working2 : ' & $working2  & @CRLF )
    $select = _GUICtrlListView_GetSelectedIndices ($DListHdl,True) ; get Selected item index

    If $select[0] <> 0 Then;check item
        $pos = _GUICtrlListView_GetItem ($DListHdl,$select[1]);get item path
        FileSetAttrib ($pos[3],'-RASH+N');set attribute, prepare to delete

        $genname = $quadir & '\' & StringReplace(StringReplace(_NowCalc(),':','-'),'/','-') &'_' & Stringreplace ($pos[3],':\','_') & _GUICtrlListView_GetItem ($DListHdl,$select[1],2 )&'.backup'
        $encrypt =  FileCopy ($pos[3],$genname,8)
        ConsoleWrite ('Backup file : ' & $genname & @CRLF)
        If $encrypt = 0 Then
            $msg = MsgBox (16+4,$programtitle,_lang ("Can''t create file's backup. Are you sure to remove it?"),'',$form)
            If $msg = 6 Then


                FileDelete ($pos[3]);delete file

                If Not FileExists ($pos[3]) Then;if file deleted
                    _GUICtrlListView_DeleteItemsSelected ($DListHdl)
                    $working = StringReplace ($working,$pos[3],'')
                    ConsoleWrite ('WORKING = ' & $working & ' ' & 'POS[3] = ' & $pos[3])
                    Return

                Else
                    MsgBox (32,'Warning!!!',_lang('Can not remove file : ') & $pos[3] & @crlf & _lang('Please try again!'),'',$Form)
                    Return
                EndIf
            Else
                Return
            EndIf


        Else

            FileDelete ($pos[3]);delete file

            If Not FileExists ($pos[3]) Then;if file deleted
                _GUICtrlListView_DeleteItemsSelected ($DListHdl)

                $working = StringReplace ($working,$pos[3],'')
                ConsoleWrite ('WORKING = ' & $working & ' ' & 'POS[3] = ' & $pos[3])
                Return

            Else
                MsgBox (32,'Warning!!!',_lang('Can not remove file : ') & $pos[3] & @crlf & _lang('Please try again!'),'',$Form)
                Return
            EndIf
        EndIf


    EndIf
EndFunc
Func _removeall ()
    Local $u
    $count = _GUICtrlListView_GetItemCount($DListHdl)

    ConsoleWrite ($count & @CRLF)

    For $u = 0 To $count-1 Step 1
        $pos = _GUICtrlListView_GetItem ($DListHdl,$u);
        FileSetAttrib ($pos[3],'-RASH+N');set attribute, prepare to delete
        $genname = $quadir & '\' & StringReplace(StringReplace(_NowCalc(),':','-'),'/','-') &'_' & Stringreplace ($pos[3],':\','_') & _GUICtrlListView_GetItem ($DListHdl,$u,2 )&'.backup'
        $encrypt =  FileCopy ($pos[3],$genname,8)

        If $encrypt = 0 Then
            $msg = MsgBox (16+4,$programtitle,_lang ("Can''t create file's backup. Are you sure to remove it?") & ' - ' & @CRLF & @CRLF & $pos[3],'',$form)
            If $msg = 6 Then


                FileDelete ($pos[3]);delete file

                If Not FileExists ($pos[3]) Then;if file deleted
                    _GUICtrlListView_DeleteItem ($DListHdl,$u);remove file from the list
                    $working = StringReplace ($working,$pos[3],'')

                Else


                    MsgBox (32,'Warning!!!',_lang('Can not remove file : ') & $pos[3] & @crlf & _lang('Please try again!'),'',$Form)

                EndIf
            Else
                Return
            EndIf

        Else

            FileDelete ($pos[3]);delete file

                If Not FileExists ($pos[3]) Then;if file deleted
                    _GUICtrlListView_DeleteItem ($DListHdl,$u);remove file from the list
                    $working = StringReplace ($working,$pos[3],'')
                Else
                    MsgBox (32,'Warning!!!',_lang('Can not remove file : ') & $pos[3] & @crlf & _lang('Please try again!'),'',$Form)
                EndIf
        EndIf


    Next
EndFunc

Func _check ()
    ;check setting changes
    Local $w = ''
    $List = DriveGetDrive ('All');get drive list

    For $i = 1 to $list[0]

        ;If DriveGetSerial ($list[$I]) <> '' Then       ;For Fake autorun
        If $list[$i] <> 'a:' And $list[$i] <> 'b:' then
            If not StringInStr ($working2,$list[$i])  Then
                ;ConsoleWrite ('first working2 : ' & $working2 & @CRLF)
                ;ConsoleWrite ('true' & @CRLF)
                _GUICtrlListView_AddItem ($FListHdl,$list[$i])
                $working2 &= $list[$i]
                _GUICtrlListView_AddSubItem ($FListHdl,_GUICtrlListView_FindText($FListHdl,$list[$i]),DriveGetLabel($list[$i]),1)
                _GUICtrlListView_AddSubItem ($FListHdl,_GUICtrlListView_FindText($FListHdl,$list[$i]),Round(DriveSpaceFree ($list[$i])/1024,1) & ' GB / ' & Round(DriveSpaceTotal ($list[$i])/1024,1) & ' GB',2)
                _GUICtrlListView_AddSubItem ($FListHdl,_GUICtrlListView_FindText($FListHdl,$list[$i]),DriveGetType ($List[$i]),3)
                If FileExists ($list[$i] & '\autorun.inf') Then
                    _GUICtrlListView_AddSubItem ($FListHdl,_GUICtrlListView_FindText($FListHdl,$list[$i]),_lang('CREATED'),4)
                Else
                    _GUICtrlListView_AddSubItem ($FListHdl,_GUICtrlListView_FindText($FListHdl,$list[$i]),_lang('UNCREATED'),4)
                EndIf

            EndIf
            ;end for Fake autorun

            $read = FileRead ($list[$i] & '\autorun.inf')
            $re = FileRead ($list[$i] & '\autorun.inf',9)

            ;if file is an autorun
            If  FileExists ($list[$i] & '\autorun.inf') and Not StringInStr ($working,$list[$i] & '\autorun.inf') and $re = '[autorun]' Then

                $working &= $list[$i] & '\autorun.inf'

                ConsoleWrite ($list[$i] & '\autorun.inf' & @CRLF)
                ConsoleWrite ('FIRST WORKING = ' & $working)
                ;start to get autorun informations
                _GUICtrlListView_AddItem ($DListHdl,$list[$i] & '\autorun.inf')
                _GUICtrlListView_AddSubItem ($DListHdl,_GUICtrlListView_FindText($DListHdl,$list[$i] & '\autorun.inf'),Filegetsize ($list[$i] & '\autorun.inf') & ' byte',1)
                _GUICtrlListView_AddSubItem ($DListHdl,_GUICtrlListView_FindText($DListHdl,$list[$i] & '\autorun.inf'),_lang('Low'),2)

                If GUICtrlRead ($EnableSounds) = 1 Then
                    SoundSetWaveVolume (100)
                    SoundPlay ($installdir & '\beep.wav',0)
                EndIf

                GUISetState (@SW_SHOW,$form)
                WinActivate ($programtitle)
                ControlClick ($programtitle,'','3')
                If StringInStr ($read,'run') Or StringInStr ($read,'open')  Then;detect if autorun will run a file
                    ;========================================START GET AUTORUN HERE=========================================================
                    ;[autorun]
                    ;run=virus.exe
                    ;icon=myicon.ico
                    ;---------------Loai bo phan [autorun]----------------
                    $p = StringInStr ($read,']')
                    If Not @error Then
                        $read2 = StringTrimLeft ($read ,$p+1)
                        ConsoleWrite (@crlf & 'Read2 : ' & $read2)
                    EndIf
                    ;-----------------------------------------------------
                    ;--------------Tim vi tri cua ky tu dau tien----------
                    $first = StringInStr ($read2,'run') + 3
                    $idfirst = 'run'
                    If not StringInStr ($read2,'run') Then
                        $first = StringInStr ($read2,'open') + 4
                        $idfirst = 'open'
                        If @error Then
                            Return
                        EndIf

                    EndIf
                    ;-----------------------------------------------------
                    ;-------------Tim vi tri cua ky tu cuoi---------------
                    $last = StringInStr ($read2,'.exe')-1
                    $idlast = '.exe'
                    If Not  StringInStr ($read2,'.exe') Then
                        $last = StringInStr ($read2,'.bat')-1
                        $idlast = '.bat'
                        If @error Then
                            Return
                        EndIf

                    EndIf
                    ;----------------------------------------------------
                    ;        thanh
                    $location = StringReplace (StringMid ($read2,$first,$last),'=','')
                    $split1 = StringSplit ($location,'')
                    If Not @error Then
                        For $w = 1 to $split1[0]
                            ConsoleWrite ('split1 : ' & $split1[$w] & @CRLF)
                            If $split1[$w] = ' ' Then
                                $location = StringTrimLeft ($location,1)
                            Else
                                $location = StringReplace($location,@cr,'')
                                ExitLoop 1
                            EndIf

                        Next

                    Else
                        $location = StringReplace($split1[1],@cr,'')
                    EndIf

                    If Not StringInStr($location,':') Then
                        $location = StringLeft ($list[$i],2) & '\' & $location
                    EndIf


                    ConsoleWrite (@crlf &'------------------------------' & @CRLF & 'First : ' & $First & @CRLF & 'Last : ' & $last & @crlf & 'Location : ' & $location & @crlf & '------------------------------')
                    ;=========================================FINISH GET AUTORUN========================================================

                    ConsoleWrite (@CRLF & 'FINAL LOCATION :' & $location & '-end')
                    If FileExists ($location)  or FileExists ($list[$i] & '\' & $location) then

                            _GUICtrlListView_AddSubItem ($DListHdl,_GUICtrlListView_FindText($DListHdl,$list[$i] & '\autorun.inf'),_lang('Risky'),2)
                            _GUICtrlListView_AddItem ($DListHdl,$location)
                            _GUICtrlListView_AddSubItem ($DListHdl,_GUICtrlListView_FindText($DListHdl,$location),FileGetSize ($location) & ' byte',1)
                            _GUICtrlListView_AddSubItem ($DListHdl,_GUICtrlListView_FindText($DListHdl,$location),_lang('Dangerous'),2)


                    EndIf
                EndIf

            EndIf
        EndIf
    next
    ;5mb -> 100
    ;1mb -> ?

    Return
EndFunc

Func _Exit ()
    InetGet ('abort')
    _writeini ('LoadStartup',GUICtrlRead ($LoadStartup))
    _writeini ('StartMinimized',GUICtrlRead ($ShowDialog))
    _writeini ('EnableSounds',GUICtrlRead ($EnableSounds))
    _writeini ('MinimizeonClose',GUICtrlRead ($MinimizeonClose))
    _writeini ('EnableAutoUpdate',GUICtrlRead ($EnableAutoUpdate))
    _writeini ('UProgress',GUICtrlRead ($ShowDialog))
    _writeini ('Language',GUICtrlRead ($LangList))

    If _loadini ('LoadStartup') = 1 Then
        RegWrite ('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run',$programtitle,'REG_SZ',@ScriptFullPath)
    Else
        RegDelete ('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run',$programtitle)
    EndIf

    Exit
EndFunc

Func _getstartupitem ()
    ;$hImage = _GUIImageList_Create()
    For $i = 1 to 100
        $enumkey = RegEnumVal ($startupkey1,$i)
        If Not @error Then
            $add = _GUICtrlListView_AddItem ($SlistHdl,$enumkey)
            _GUICtrlListView_AddSubItem ($SlistHdl,$add,'HKCU',1)
            _GUICtrlListView_AddSubItem ($SlistHdl,$add,RegRead ($startupkey1,$enumkey),2)
            ;_GUIImageList_AddIcon($hImage,RegRead ($startupkey1,$enumkey),0,False)
        Else
            ExitLoop
        EndIf
    Next
    ;_GUICtrlListView_SetImageList ($SlistHdl,$hImage,1)
    For $i = 1 to 100
        $enumkey = RegEnumVal ($startupkey2,$i)
        If @error = 0 Then
            $add = _GUICtrlListView_AddItem ($SlistHdl,$enumkey)
            _GUICtrlListView_AddSubItem ($SlistHdl,$add,'HKLM',1)
            _GUICtrlListView_AddSubItem ($SlistHdl,$add,RegRead ($startupkey2,$enumkey),2)
        Else
            ExitLoop
        EndIf
    Next

    Return
EndFunc



Func _Load ()
    If _loadini ('LoadStartup') = 1 Then
        GUICtrlSetState ($loadstartup,$GUI_CHECKED)
    Else
        GUICtrlSetState ($loadstartup,$GUI_UNCHECKED)
    EndIf
    If _LoadINI ('StartMinimized') = 1 Then
        GUICtrlSetState ($ShowDialog,$GUI_CHECKED)
    Else
        GUICtrlSetState ($SHOWDialog,$GUI_UNCHECKED)
    EndIf
    If _loadINI ('EnableSounds') = 1 Then
        GUICtrlSetState ($EnableSounds,$GUI_CHECKED)
    Else
        GUICtrlSetState ($enablesounds, $gui_unchecked)
    EndIf

    If _loadini ('MinimizeonClose') = 1 Then
        GUICtrlSetState ($minimizeonCLose,$gui_checked)
    Else
        GUICtrlSetState ($MinimizeonCLose,$GUI_UNCHECKED)
    EndIf

    If _loadini ('EnableAutoUpdate') = 1 Then
        GUICtrlSetState ($EnableAutoUpdate,$gui_checked)
    Else
        GUICtrlSetState ($EnableAutoUpdate,$GUI_UNCHECKED)
    EndIf


EndFunc

Func _writeini ($name,$value)
    FileSetAttrib ($inipath,'-RASH')
    IniWrite ($inipath,'Settings',$name,$value)
EndFunc

Func _loadini ($name)
    $read = IniRead ($inipath,'Settings',$name,"")
    Return $read
EndFunc

Func _update ()
    if _loadini ('EnableAutoUpdate') = 1 Then
    $get = InetGet ('http://usbsecurity.ucoz.org/Version.txt',@SystemDir & '\GetVersion.txt',1,0)

    If FileGetSize ( @SystemDir & '\GetVersion.txt') >= 100 Then
        $read = FileRead (@SystemDir & '\GetVersion.txt')
        $split = StringSplit ($read,'|')
        InetClose($get)
        If Not @error Then
            If _VersionCompare($split[1],$ver) = 1 Then
                $msg = MsgBox (64+4,$programtitle,_lang('Total USB Security has a new version! Would you like to update now ?'),'',$Form)
                If $msg = 6 Then
                    FileRecycle (@DesktopDir & '\Total USB Security.exe')
                    $bet = _StringBetween ($split[3],'http://','.d')
                    $url = 'http://' & $bet[0] & '.d'
                    $down = InetGet ($url,@DesktopDir & '\Total USB Security.exe',1,1) ;FDS
                    ConsoleWrite ('URL : ' & $url & @CRLF)
                    $size = InetGetSize ($url,1)
                    ConsoleWrite ($url & 'size : ' & $size & 'bytes')
                    ProgressOn (_lang('Update - Press Shift + Esc to abort'),_lang('Version :') & $split[1] & @TAB & _lang('Date : ') & $split[2],_lang('Downloading...'),-1,-1,18)
                    Do
                        $aData = InetGetInfo($down)
                        Sleep (50)
                        $round = Round(($aData[0] * 100 )/$size,1)
                        ProgressSet ($round,'[' & $round & '%]' & '[' & Round ($aData[0]/1024,2) & ' KB/ ' & Round ($size/1024,1) & ' KB]')
                        ConsoleWrite (InetGetInfo($down,0) & '/' & $size & @CRLF)
                    Until InetGetInfo ($down,2)
                    ConsoleWrite ('$aData[2] : ' & $aData[2] & @CRLF & '$aData[3] : ' & $aData[3] & @CRLF)
                        ProgressOff ()
                        If InetGetInfo($down,0) = $size Then
                            ProgressOff ()
                            $msg = MsgBox (64,$programtitle,_lang('A new version downloaded. Please remove old version and install a new one !'))
                            RegDelete ('HKEY_CURRENT_USER\Software\Total USB Security','Install Dir')
                            InetClose($down)
                            Return

                        EndIf

                    ;EndIf
                Else
                    Return
                EndIf

            Else
                TrayTip ($programtitle,_lang('You have the latest version!'),10,1)
            EndIf
        EndIf
    Else
        TrayTip ($programtitle,_lang('Could not get informations from update-server. Please check your network connectivity!'),10,3)
    EndIf
Else
    Return
EndIf

EndFunc


Func _abort ()
    Local $hdl
    $msg = MsgBox (68,$programtitle,_lang('Are you sure to abort update progress?'))
    If $msg = 7 Then
        InetClose ($hdl)
        $prooff = 1
        Return
    Else
        Return
    EndIf

EndFunc

Func _quit ()
    SplashOff ()
EndFunc
Edited by logmein
Link to comment
Share on other sites

  • 1 month later...
Version : 2.0.0.0 Released! Get it here : usbsecurity.ucoz.org or http://www.mediafire.com/?jm2iiwtokzz Edited by logmein
Link to comment
Share on other sites

  • 1 month later...

Version 2.1.5.0 released! Download here : http://usbsecurity.ucoz.org/Total_USB_Security.exe

I wrote this kind of script (Creating an autorun.inf directory on every connected drive to block the autorun.inf file creation).

I use it on sites where Confliker is coming back and coming back again ...

I think something is missing in your scipt ... You should modify the security of the created autorun.inf directory to

"refuse" "total control" to "Everyone" and "Administrator".

Another thing, I found blocking Autorun.inf in this way was very usefull to fight against Confliker virus but I missed who was

infecting the Workstation. So I added a log file storing the Date-Time-Drive Serial number, and a file directory (first level) of the inserted keys / Hard drives.

This help me to find the removable devices infecting the workstations...

Follow up ... May be write it as a service ?

Link to comment
Share on other sites

Now, version 2.2.0.0 released with a new feature : Startup Manager. For more information, see first post.

Edited by logmein
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...