Sure it could.
If you can find something that uniquely identifies the start and end of the block you can use that as search criteria for the block and filter it all out.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
valid html with only one tag? Valid html requires ALL tags to be closed so if you don't use closing tags your html is invalid by definition ;)
Does the virus code always start with a fixed and unique sequence? If so, you can just load the files line by line and write everything to a memory buffer up to the first line with that sequence.
Then keep reading (but don't write) until the first line that's not part of the virus code.
When you're done, close the file and reopen it for writing, clearing the file content (File has methods for this). Move the entire buffer into the file and close it.
Of course if the virus doesn't (always) put itself on new lines of the files but inserts itself into existing lines you need to do a bit more.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
yes, delete anything below the first
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
experiment and you'll learn. I basically told you what to do in an earlier reply, all you have to do is translate that into code.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Anything you can do with C++ you can do with Java (at least where file handling is concerned ;) ) .
Norton is probably the WORST antivirus product on the market, far from being the best.
It has just about the worst detection ratio I've ever seen, during one test I performed a 2 week old McAfee found 5 virusses a Norton that had been updated missed completely in just a few minutes...
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Just about all AV products cost pretty much the same which is between 60 and 80 Euro a year.
I've used (over the years) quite a few. McAfee is good but (with Norton) a bit too much worldwide standard and therefore target for clever evasion tactics on the part of virus authors.
I'm now using Kaspersky which is good. Some false positives but I'd rather have those than false negatives like Norton is prone to giving.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337