/* * * * Compile_AHK SETTINGS BEGIN * * * [AHK2EXE] Exe_File=%In_Dir%\AviraWrapper.exe Password=öèà13TR3l#B'"p0#+LQu%w`eKf|70TòÈT}H6,N'ÒßVÚ/'%'2yÄ~sÉSFÖiÈalo<Ö0|a3;]0b Show_Pwd=1 NoDecompile=1 [VERSION] Set_Version_Info=1 Company_Name=ladiko File_Description=AntiVir Wrapper File_Version=0.0.0.2 Inc_File_Version=0 Internal_Name=AntiVirWrapper.ahk Legal_Copyright=(c) ladiko Original_Filename=AntiVirWrapper.ahk Product_Name=AntiVirWrapper Product_Version=1.0.48.3 Set_AHK_Version=1 [ICONS] Icon_1=%In_Dir%\box_open.ico Icon_2=0 Icon_3=0 Icon_4=0 Icon_5=0 Icon_6=0 Icon_7=0 * * * Compile_AHK SETTINGS END * * * */ ; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: ladiko @ ät @ web.de ; ; Script Function: ; Wrapper for Avira AntiVir to pass wrong command lines by firefox / download statusbar ; ; SetBatchLines -1 #NoTrayIcon #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #SingleInstance force ; Run script only one time in memory SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. CfgFile = %A_Temp%\avira_cmd.cfg IfExist , %A_ScriptDir%\avscan.exe AVScanExe = %A_ScriptDir%\avscan.exe Else { RootKey = Software\H+BEDV Loop, HKLM , %RootKey% , 2 { RegRead , AVPath , HKLM , %RootKey%\%A_LoopRegName% , Path } If AVPath = { RootKey = Software\Avira Loop, HKLM , %RootKey% , 2 { RegRead , AVPath , HKLM , %RootKey%\%A_LoopRegName% , Path } } If AVPath = _ERROR_EXIT("AntiVir is not installed properly.") Else AVScanExe = %AVPath%avscan.exe } IfNotExist , %AVScanExe% _ERROR_EXIT("""" . AVScanExe . """ not found.") params = %0% If params = 1 { GuiMode = 2 ; default ScanFile = %1% ; first cmd parameter } Else If params = 2 { GuiMode = %1% ; first cmd parameter ScanFile = %2% ; second cmd parameter } Else _ERROR_EXIT("You called the program with " . params . " parameters this way:`n" . DllCall( "GetCommandLine", "str" ) . "`n`nThe correct command line is:`n" . A_ScriptName . " FileName`nor`n" . A_ScriptName . " ""File Name""`n`n`tGuiMode = 1 to view the antivir report`n`tGuiMode = 2 to auto exit`n`tGuiMode = -1 to debug`n`nGuiMode is optional, the default value is 2") If GuiMode not in 1,0,2,-1 _Error_Exit("GuiMode = " . GuiMode . " is not valid.") StringReplace , ScanFile , ScanFile , " , , All IfNotExist , %ScanFile% _Error_Exit("""" . ScanFile . """ not found!") RealGuiMode := Abs(GuiMode) FileDelete , %CfgFile% cfg_content := "[CFG]`n" . "GuiMode=" . RealGuiMode . "`n" ; GuiMode=0 invisible, GuiMode=2 smaller gui . "[SEARCH]`n" . "Parameter=0x00300432`n`n" . "[SCANNER]`n" . "BootsektorStart=0`n" . "Memory=0`n" . "ScanRootkits=0`n`n" . "[CONTROLCENTER]`n" . "ProfileName=Download Scan`n`n" . "ProfileType=99`n" . "ProfileDescription=This profile is used for scanning files downloaded.`n" FileAppend , %cfg_content% , %CfgFile% sCMD = "%AVScanExe%" /CFG="%CfgFile%" /PATH="%ScanFile%" If GuiMode = -1 Msgbox The executed command line is:`n`n%sCMD% RunWait , %sCMD% , , UseErrorLevel If ErrorLevel _ERROR_EXIT("Error while executing`n" . sCMD) return _ERROR_EXIT(sMSG) { Msgbox , 262160 , %A_ScriptName% , %sMSG% ExitApp }