How to write a virus in Visual Basic

Source: Internet
Author: User
Tags mail

Using VB to write viruses needs to consider the following points:

* Infected host

First of the infected file to determine whether the host to infect the virus, that is, to determine whether the virus principal file exists, if it does not exist, the virus will be copied to the designated location (such as: Copy the virus files to C:windowssystem), can be implemented with filecopy statements; If the virus is infected, the host ends the decision.

For example, to determine whether the existence of c:windowssystemkiller.exe, if there is a decision to exit, if not to prove that the machine is not infected with the virus, immediately copy the virus file.

Virus source file name is Game.exe

Declaration section:

"" Defines the fileexists% function

Public success%

Function fileexists% (fname$)

On local Error Resume Next

Dim ff%

ff% = FreeFile

Open fname$ for Input as ff%

If ERR Then

fileexists% = False

Else

fileexists% = True

End If

Close ff%

End Function

Code section:

"" To determine if a file exists

success% = fileexists% ("C:windowssystemkiller.exe")

If success% = False Then "" Virus does not exist copy virus to computer

FileCopy "Game.exe", "C:windowssystemkiller.exe"

... "" Modify the registry and add it to run. (Omit several code)

End If

* Boot virus

When the virus infects the host, it joins itself in the boot operation of the registry, which is carried out at the same time as the virus is copied to the host, and the registry is no longer modified after the host infection. The win registry can be manipulated by programming and invoking API functions, so that the virus starts automatically each time the computer is started. (Please refer to other information for the specific writing method)

* Task Manager

The virus itself is not listed in the Task Manager list and can be implemented programmatically. The code app.taskvisible = False can be implemented, and then by calling the win API function to implement, here is not introduced.

* Virus outbreak conditions

Day (date) can be used to determine what the date is today, and then compare with the established dates, the same as the virus subject to the destructive, otherwise not attack. You can also use time, date, or other methods to determine the condition of a virus attack. Cases:

If day (date) =16 then "" 16 is an attack date, an integer that takes a value of 1-31

... ... Kill ******* The destructive code that runs when the date matches (formatting, deleting the specified file type, sending the data Bauduse the network, omitting several code)

End If

* The destructive effects of viruses

This part of the code is written to determine the strength of the virus. Light can make the system resources quickly reduced until the crash (you need to know a little worm principle), that is, to achieve the effect of turning on the dead, you can also add the hard disk bomb code, the system background delete files. Heavy can make the computer completely paralyzed (without introduction, you can refer to other virus related information).

* Propagation of viruses

The simple principle is to merge itself with other executables, that is, two files and a file. can also be transmitted by e-mail, the method is the virus read the infected host's mailing list, will have the virus attachment e-mail to everyone in the list (this requires you know VB Network programming).

After reading this article I believe you have a preliminary understanding of the way the virus is written, if you are a VB enthusiasts, you can write a very simple virus, but if you are proficient in VB, please do not have to spread her ideas after writing, because the spread of her caused a great impact will change your fate (by the public security caught on the hang).

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.