ExtremeHacking
Today : | Time : | safemode : ON
> / Main Website / Cyber Surakha Abhiyan / Hackers Charity / Linkedin / facebook / twitter /
Name Author Perms Com Modified Label

A simple program in C to fetch system events. Unknown rwxr-xr-x 0 5/22/2013

Filename A simple program in C to fetch system events.
Permission rw-r--r--
Author Unknown
Date and Time 5/22/2013
Label
Action
Ethical Hacking Institute in Pune
./Arizona Team

Hello everyone welcome back to Arizona Programming zone, today I will show you how to catch interruption signals on a Windows system and what you can do when such signals are sent to your application. Interruption signals are for example control-c, a break or shutdown event.
Its just for windows

























Go through the logical flow and create a new one for yourself. If any problem in understanding the logical flow you can contact instructor@arizonainfotech.com

Here is the code.

#include <windows.h>
#include <stdio.h>

/*
*
*/
BOOL APE_ControlHandler(DWORD pControlType);

int main()
{
int lRetVal = 0;

// Register the event handler
SetConsoleCtrlHandler((PHANDLER_ROUTINE) APE_ControlHandler, TRUE);

while (1)
Sleep(100);

return(lRetVal);
}

/*
*
*/
BOOL APE_ControlHandler(DWORD pControlType)
{

switch(pControlType)
{
// Handle the CTRL-C signal.
case CTRL_C_EVENT:
Beep(500, 200);
printf("Ctrl-C event : Starting depoisoning process");
return(FALSE);

case CTRL_CLOSE_EVENT:
Beep(600, 200);
printf("Ctrl-Close event : Starting depoisoning process");
return(FALSE);

case CTRL_BREAK_EVENT:
Beep(700, 200);
printf("Ctrl-Break event : Starting depoisoning process");
return(FALSE);

case CTRL_LOGOFF_EVENT:
Beep(800, 200);
printf("Ctrl-Logoff event : Starting depoisoning process");
return(FALSE);

case CTRL_SHUTDOWN_EVENT:
Beep(900, 200);
printf("Ctrl-Shutdown event : Starting depoisoning process");
return(FALSE);

default:
Beep(1000, 200);
printf("Unknown event \"%d\" : Starting depoisoning process", pControlType);
return(FALSE);
}
}

www.arizonainfotech.com
CEH CHFI ECSA ENSA CCNA CCNA SECURITY MCITP RHCE CLOUD ANDROID IPHONE NETWORKING HARDWARE TRAINING INSTITUTE IN PUNE
 

Cyber Suraksha Abhiyan | Sadik Shaikh © 2015 Sadik Shaikh | CEH V9 | ETHICAL HACKING Course Training Institute in India-Pune
Extreme Hacking Template design by Sadik Shaikh | Cyber Suraksha Abhiyan