so the ideea was to create the two log files .
; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1.89 beta
; Language: English
; Platform: WinXP
; Author: oneLess , 25 nov 2005 , ver 1.0
;
; Script Function:
; create log files for KB893803(GDI+) and KB890830(malicious)
;
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------
#include <GuiConstants.au3>
If WinExists ( "My Computer" ) Then WinClose ( "My Computer" )
$path2 = EnvGet ( "windir" ) & "\Debug\"
$filelog2 = "KB873374.log"
$filelog2_ = "_" & $filelog2
verific_reg ( $path2 , $filelog2 , $filelog2_ , "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GdiDetectionTool" , "GDITool" , 1 )
$filelog1 = "KB890830v110.log"
$filelog1_ = "_" & $filelog1
verific_reg ( $path2 , $filelog1 , $filelog1_ , "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RemovalTools\MRT" , "Version" , "1F5BA617-240A-42FF-BE3B-14B88D004E43" )
EXIT
; ----------------------------------------------------------------------------
Func verific_reg ( $path , $filelog , $filelog_ , $key , $value , $data)
Local $file , $var
$file = FileOpen ( $path & $filelog , 0 )
if $file = -1 then
FileClose ( $file )
$var = RegRead( $key , $value)
if (@error <> 0) or ( $var <> $data ) then
IniWrite ( $path & $filelog_ , "Settings" , $filelog , "setat cu metoda .reg" )
else
IniWrite ( $path & $filelog , "Settings" , $filelog , "setat cu metoda .reg" )
FileDelete ( $path & $filelog_ )
endif
else
FileClose ( $file )
FileDelete ( $path & $filelog_ )
endif
EndFunc
; ----------------------------------------------------------------------------
the script is run via wpi.cmd , so is run every time WPI is running
the function
verific_reg , check
if
exist the log file (then the hotfix is already installed , so do not do anything else)
else
check in registry if the hotfix is installed
if
yes create the log file
if
no, create another log file with same name but with a "_" in front of name like _kbXXXXXX.log
in my wpi first entry with INSTALL check after kbXXXXXX.log
the second entry with UNinstall check after _kbXXXXXX.log , and the second command line is like
Quote
cmd1[pn]=['regedit /s %cdrom%\\Windows\\XP\\XP_UpDates\\SP2_UpDates\\873374.reg']
cmd2[pn]=['rename %windir%\\Debug\\_KB873374.log KB873374.log']
in case of malicious hotfix i added the version number "v110" to the log name
work here . the script must be changed every new version of malicious
to keep unchanged the .exe file ,
probably it need to make 2 parameters to the command line (version of malicious+reg_key_malicious)
i choose the folder
%windir\debug to store the two log files , can be anyware
no matter what is writed inside of theese two log files , the script check if they exist only
the line in front with WinClose ( "My Computer" )
is not related with the script function . just i close my computer windows after i start WPI from this window.