Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Avast Helper - for users of the Free Avast AntiVirus Scanner


  • Please log in to reply
9 replies to this topic
TeknoMusicMan
  • Members
  • 186 posts
  • Last active: Jan 17 2007 10:17 PM
  • Joined: 14 Apr 2005
I wrote this script for people who use the Free Version of Avast AntiVirus.

;*****************************************************************
;
;  Program   : Avast Helper
;  Coder     : Adam Kaminski (TeknoMusicMan)
;  Tested on : avast! version 4.6 Home Edition, Build: Apr2005 (4.6.652)
;
;              Please Send a Private Message to TeknoMusicMan on
;              the www.AutoHotkey.com Forums if you have found it
;              to work on other Builds
;
;  I wrote Avast Helper because I wanted the ability to have a Scheduled Task
;  to run Avast without paying for the Professional version of their software.
;
;  I also wrote the script for fun.
;  Yes it would have been easier to crack the Professional Version :P
;
;  USING THE SCRIPT
;  If you are on a Dial-up connection you should set it so that
;  the computer will automatically dial your ISP when a program
;  tries to access the internet.
;
;  If you donot wish to do this or you just don't want it to update
;  Set Update = 0
;
;  If you installed your Avast into non-standard folders adjust the
;  iniPath and exePath variables to the correct locations
;
;  WHAT THE SCRIPT DOES
;  The Script will open up the avast scanner with the skins disabled
;  it will then check for updates if update = 0.  After it is
;  finished updating it will then check local hard disks,
;  Test Archives on the Thorough Setting, and then click Star scan.
;
;  During the scan process if a virus is detected it will "Delete All"
;
;  It will also deny repeated Email Alerts from going out if you
;  have any set
;
;  The script will then exit when the scan has finished
;
;*****************************************************************


;*****************************************************************
;                      CONFIG
Update = 1
; DO NOT include the trailing \ on the path's
iniPath = %A_ProgramFiles%\Alwil Software\Avast4\DATA
exePath = %A_ProgramFiles%\Alwil Software\Avast4
;
;*****************************************************************

#Persistent
#SingleInstance ignore
Menu, TRAY, Tip, Avast Helper
Menu, TRAY, NoStandard
Menu, TRAY, NoDefault
Menu, TRAY, Add, Exit, Exit
; Turned on the DectectHidden Options incase the computer were to be locked during the process
; I'm not even positive that when the computer is locked the windows are "Hidden"
; I set it as a precaution more then anything.
DetectHiddenText, On
DetectHiddenWindows, On

; This variable is used in the WindowWatch Sub
Started = 0


IfExist, %iniPath%\avast4.ini ; Checks To See if the IniFile is Present
{
	; Reads the StartWithSkin Key Value into the Original Variable
	; so the script can set it back when it is finished running.
	iniRead, Original, %iniPath%\avast4.ini, UserInterface, StartWithSkin
	
	sleep 100
	
	; Writes a value of 0 into the StartWithSkin key so that the scripts Control Commands Work.
	iniWrite, 0, %iniPath%\avast4.ini, UserInterface, StartWithSkin
}
Else
{
	; Displays a Message Box stating that the IniFile coulnd not be found
	MsgBox, , Avast Helper, Ini File Not Found
}

sleep 100

IfExist, %exePath%\ashAvast.exe ; Checks to see if the ashAvast Executable is Present
{
	; Opens the Avast Antivirus Program
	Run, %exePath%\ashAvast.exe
}
Else
{
	; Displays a Message Box if the Avast Antivirus Program wasn't found it.
	MsgBox, , Avast Helper, File Not Found.`nClosing Program.
	; Exits the script
	ExitApp
}

; Starts the timers that continously watch for specific windows.
SetTimer, Virus, 100
SetTimer, Message, 100

; The Avast Antivirus Program starts out scanning the memory
; So the script waits until the memory scan is complete and
; the Simple User Interface window is present
WinWait, avast! Simple User Interface, 
SetTimer, WindowWatch, 1000

If Update = 1
{
	; Sends a command to the Simple User Interface to update its iAVS definition files.
	PostMessage, 0x111, 667, 0, , avast! Simple User Interface

	; Waits for the iAVS update window to be finished
	; then clicks on the Close button of the summary window
	WinWait, avast! Antivirus Setup, Summary, , , Downloading Packages
	ControlClick, &Close, avast! Antivirus Setup
}

; I sent each of the following commands twice because
; every now and again it would skip one even with
; the sleeps in there.

; Checks the Local Hard Disks's checkbox
Control, Check, , &Local Hard Disks, avast! Simple User Interface
Control, Check, , &Local Hard Disks, avast! Simple User Interface
sleep 100
; Checks the Test Archives checkbox
Control, Check, , Test archi&ves, avast! Simple User Interface
Control, Check, , Test archi&ves, avast! Simple User Interface
sleep 100
; Sets the highest level of scanning inside archives
ControlClick, Thorou&gh, avast! Simple User Interface
ControlClick, Thorou&gh, avast! Simple User Interface
sleep 100
; Starts the Scanner
ControlClick, Start sc&an, avast! Simple User Interface
ControlClick, Start sc&an, avast! Simple User Interface

; This variable is used in the WindowWatch Sub
Started = 1

Return

Virus:
{
	; Checks to see if a Virus was found popup exists
	IfWinExist, avast! Warning, A Virus Was Found!
	{
		sleep 100
		; Clicks the Delete Button on the popup
		ControlClick, &Delete..., avast! Warning
		; Waits for the Delete files confirmation window
		WinWait, Delete file(s)...
		sleep 100
		; Clicks on the Delete All button
		ControlClick, &Delete all, Delete file(s)...
	}
	return
}
Message:
{
	; If you have any SMTP Alerts setup and the scanner has found
	; many virus's you may get a warning message stating that
	; repeated identical message's are being sent out
	IfWinExist, avast! Virus warning, Suspicious Message!
	{
		sleep 100
		; Clicks the "Don't send!" button
		; I did this because the scanner has already sent
		; out a few warnings and there is no reason to
		; keep sending the same warnings even more.
		ControlClick, Don't send!, avast! Virus warning
	}
	return
}
WindowWatch:
{
	; Checks to see if the Simple user interface window is gone
	IfWinNotExist, avast! Simple User Interface
	{
		; If the Simple User Interface window is gone, the
		; script will exit
		GoSub, Exit
	}
	; Checks to see if the Results window is present
	IfWinExist, Results of last scan
	{
		; Exits the Script if the Results window is present
		GoSub, Exit
	}
	IfWinNotExist, Results of last scan
	{
		; Checks to see if the "Stop Scan" and "Go to Background" buttons greyed out.
		ControlGet, stopScan, Enabled, , St&op scan, avast! Simple User Interface
		ControlGet, gotoBackground, Enabled, , Go to &Background, avast! Simple User Interface
		
		; The Started variable is used so that this if statement isn't true before
		; the scan has been started by the script
		; If the started variable is 1 and both buttons are greyed out that means
		; the script started the scan so it is now finished.
		if (Started = 1 AND stopScan = 0 AND gotoBackground = 0)
		{
			; The Timers are turned off so they arn't eating up system resources.
			SetTimer, Virus, off
			SetTimer, Message, off
			SetTimer, WindowWatch, off
			
			MsgBox, , Avast Helper, The scan finished, no virus's were found.
			GoSub, Exit
		}
	}
	return
}

Exit:
{
	; Set's the Ini File's original value to the StartWithSkin key incase the user uses avast's ugly skins :P
	iniWrite, %Original%, %A_ProgramFiles%\Alwil Software\Avast4\DATA\avast4.ini, UserInterface, StartWithSkin
	sleep 100	
	ExitApp
	return
}

What I do is i compile the script and then create a scheduled task from the control panel and have this run at whatever time i want. I did this instead of making the script something that is running all the time and checks the time for when to run. This saves on system resources.

Some of the lines in the code are long so beware of the Forum's word wrapping issue. If you use IE I don't think that problem occurs

Please Tell me what you think.
Posted Image
"Make it idiot-proof, and someone will make a better idiot."

Famkee
  • Members
  • 17 posts
  • Last active: Nov 08 2005 04:01 PM
  • Joined: 29 Mar 2005
Hey, the free version of avast! is the very same virus scanner that got defeated by a virus that raged through my system a while back. then i bought norton system works and I couldnt get it to work for like a week. but then I downloaded their little "fixer" thing and it fixed it. But good script. a good idea. I didnt have time to read through it, but i think it would be a good idea for autohotkey to hide the avast! window, and just show mabee a little box in the corner.

TeknoMusicMan
  • Members
  • 186 posts
  • Last active: Jan 17 2007 10:17 PM
  • Joined: 14 Apr 2005
I have all sorts of things planned for this script, I just wanted to put up the first version to see how people liked it.

As far as Avast being defeated, its possible for any virus scanner to be defeated by a virus, it just takes the right virus to come along to do it.

I'd like to hear what everyone uses for a virus scanner, if theres a better free one out there then Avast I'd like to know.
Posted Image
"Make it idiot-proof, and someone will make a better idiot."

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

I'd like to hear what everyone uses for a virus scanner, if theres a better free one out there then Avast I'd like to know.

I'm not sure about better, since I haven't tried Avast!, but I've been using AVG Free Edition for quite a while now and haven't had any complaints :).

Looks like a handy, well documented script :)

TeknoMusicMan
  • Members
  • 186 posts
  • Last active: Jan 17 2007 10:17 PM
  • Joined: 14 Apr 2005
Yeah, my damn VB.net Professor drilled documentation into my head till i was dizzy. :p

If anyone says anything about Flowcharts I'm liable to start shooting :p
Posted Image
"Make it idiot-proof, and someone will make a better idiot."

NiJo
  • Members
  • 73 posts
  • Last active: Jul 17 2007 11:51 AM
  • Joined: 12 Nov 2005
I have passed throught Panda, Norton, AVG and Avast. as well as bit defender and other low-budget programas, and absolutly, the avast is the best....

Norton is a resources-sucking program, can't say no...
Panda irritates me don't know why, and it slows a lot too.
AVG let a lot of virus to get into my PC, and has nothing against spyware. LOTS.
Avast, till now, got out any attempt of virus from my PC, and what i didn't know: he keeps telling me, when i conect to a unsecure source on the net, that he is blocking intrusions from DCOM exploit and others well known ways of spyware coming in...

And the avast allways running process don't consume that much resorces, i guess. My opinion till now. ;)
What other anti-virus should I try? free, preferencially ;)

http://www.free-av.com/
  • Guests
  • Last active:
  • Joined: --
http://www.free-av.com/

BengalTigger
  • Guests
  • Last active:
  • Joined: --
I've tried many A/V products, but always come back to Avast, because it doesn't hog resources, does an excellent job of keeping itself up to date, and...it works.
I've been using their included screensaver to keep my system scanned, but that runs too often and I fear I am wearing out my drive. I would be interested in this type script.

andrefgj
  • Guests
  • Last active:
  • Joined: --
Hi TeknoMusicMan!

What language have you used to write this script? I'd like to know how I can compile that. :-)

Tks,
André Ferreira

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

What language have you used to write this script?


Download AutoHotkey

:?: