RE: Simple virus to infect other files 04-10-2012, 08:16 PM
#2
(04-10-2012, 06:46 PM)Psycho_Coder Wrote: Thus it destroys other files by infecting them.
This statement contradicts itself. If it replaces the file with itself - destroys it, it's not infecting. The whole idea of infecting some file is to secretly hide your own code within the other executable and execute it every time the seemingly unmodified file is executed, without interrupting the actual original program. That way, the virus can spread, because users will continue running the infected programs, which executes the program, but also the virus in the background, so it can infect more files.
Your code simply replaces files, which makes it immediately clear that something is wrong, when it's first executed (or even looked at, because the original program will usually loose its icon and other metadata), please fix the misleading description, this is not infecting other files in any meaning of the word.
Also consider using better coding practices to make the code more readable, such as indenting the code, adding comments and voluntarily torturing yourself in the worst way you can imagine for every time you use goto statement in any structured programming language like C++ for example.
I love creativity and creating, I love science and rational thought, I am an open atheist and avid self-learner.




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)