How to write a virus with Visual Basic

  
                


I believe that everyone in the computer world hates computer viruses. She has brought us a lot of troubles and losses. But do you know the methods and processes for writing viruses? Here I only use VB as an example to unveil her veil. To write a virus with VB, you need to consider the following points: * Infect the host first, after the infected file is run, first determine whether the host is infected with the virus, that is, determine whether the virus body file exists. If it does not exist, 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 is named game.exe declaration part: ""Defined 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: ""Judges whether the file exists success% = FileExists%("C:windowssystemKiller.exe") If success% = False Then "" If the virus does not exist, copy the virus to the computer FileCopy "game.exe", "C:windowssystemKiller.exe" ... "" modify the registry and add it to the RUN. (Omit some codes) End If * Start the virus at startup At the same time as the virus infects the host, it will be added to the registry during startup. This is done at the same time as copying the virus to the host. The host will not modify the registry 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 preparation methods) * Task Manager Disable the virus itself in the task manager list, which 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. * Virus attack conditions Day (Date) can be used to judge today is the number, and then compared with the determined date, the same shows the destructive nature of the virus subject, otherwise it does not attack. 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 ******* Run when the date matches Destructive code (formatting, deleting the specified file type, sending packets, etc., omitting some code) end if * The destructive nature of the virus is written to determine 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 principle of virus propagation is simple. It 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 spread her after writing. The idea, because spreading her great influence will change your destiny (it will be hung up by the police).

Copyright © Windows knowledge All Rights Reserved