Hello.
I have a little question. Is it possible to write a little program that makes a specific program or process to crash, so when looking in task manager, it says "not responding" on the program or process? I hope you understand. Or could this be made with a simple script? Would be very grateful for an answer on this.
Thanks.
Program for crashing or making process/program to freeze?
Started by net-man, Jan 08 2009 07:23 PM
9 replies to this topic
#1
Posted 08 January 2009 - 07:23 PM
|
|
|
#2
Posted 08 January 2009 - 08:10 PM
Well, you could just crash everything by making a huge array of null pointers and doing crazy stuff with them. Pretty simple and short.
#3
Posted 08 January 2009 - 08:30 PM
im pretty sure doing crazy stuff to null pointers will just either throw a heap of exceptions or crash your own program. if you done crazy stuff to random bits of memory then stuff will crash.
Posted via CodeCall Mobile
Posted via CodeCall Mobile
#4
Posted 09 January 2009 - 04:01 AM
Why would you want to crash a program? Are you trying to make a virus?
If the program has already crashed use the end task button in the task manager.
If the program has already crashed use the end task button in the task manager.
Edited by roboticforest, 09 January 2009 - 05:27 AM.
Dave
#6
Posted 13 January 2009 - 12:13 AM
Steve.L said:
Well, you could just crash everything by making a huge array of null pointers and doing crazy stuff with them. Pretty simple and short.
Ok, can you give an example?:o I know nothing on programming.
Quote
Why would you want to crash a program? Are you trying to make a virus?
If the program has already crashed use the end task button in the task manager.
If the program has already crashed use the end task button in the task manager.
I want to crash a strategy game, in experimental purposes.
Quote
On unix, just send a SIGSTOP to whatever process it is.
I use windows.
Thanks.
#7
Posted 17 January 2009 - 01:25 PM
No one?
#8
Posted 17 January 2009 - 01:34 PM
What you are asking is OS specific and may or may not have a "standard" way to do in that OS. You really need to offer some more details.
#9
Posted 17 January 2009 - 05:50 PM
Hello. Thanks for replying. I am running Windows xp, and the program in question that i want to try to crash is actually the game age of empires II conquers expansion. Hope this helps. Thanks again.
#10
Posted 14 March 2010 - 07:44 PM
@vivek: What does this have to do with the question?
I think this is how to do it. I don't know if there's a better way.
I think this is how to do it. I don't know if there's a better way.
#include <windows.h>
#include <tchar.h>
#define NUM_PIDS 1024
#define MAX_PATH 1024
#define __TEXT("C:\\PROGRAM FILES\\AGE OF EMPIRES.EXE")
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCommandLine, INT nShowMode)
{
HANDLE hProcess;
DWORD pdwProcessIDs[NUM_PIDS], dwBytesReturned, dwEntries, dwIndex;
TCHAR sztExeBuf[MAX_PATH];
if( !EnumProcesses(pdwProcessIDs, sizeof(DWORD)*NUM_PIDS, &dwBytesReturned) )
{
MessageBox(NULL,__TEXT("Could not enumerate processes"), __TEXT("ERROR"), MB_OK);
return -1;
}
dwEntries = dwBytesReturned / sizeof(DWORD);
for( dwIndex = 0; dwIndex < dwEntries; ++dwIndex)
{
/* open process */
hProcess = OpenProcess(
/* requested access rights*/
PROCESS_TERMINATE|PROCESS_QUERY_LIMITED_INFORMATION,
/* subprocesses can inherit handle */
FALSE,
/* process ID */
dwEntries
);
/* choke on fail */
if( hProcess == NULL )
{
MessageBox(NULL,__TEXT("Could not open process"), __TEXT("ERROR"), MB_OK);
return -1;
}
/* get process file name */
dwBytesReturned = MAX_PATH;
if( !QueryFullProcessImageName( hProcess, 0, sztExeBuf, &dwBytesReturned) )
{
MessageBox(NULL,__TEXT("Could not get process name"), __TEXT("ERROR"), MB_OK);
return -1;
}
/* compare process file name to our target file name*/
if(_tcscmp(sztExeBuf, TARGET_PROCESS) == 0)
{
/* a hit! kill it */
TerminateProcess(hProcess, 0);
CloseHandle(hProcess);
return 0;
}
}
return 0;
}
Edited by dargueta, 14 March 2010 - 07:44 PM.
Corrections
sudo rm -rf /


Sign In
Create Account

Back to top









