Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force crash an application

Tags:

c++

crash

I'm currently testing an application that my company wrote. One of the scenarios was to see what happens to the system state if that application was to crash. Is there an application out there that could force crash my application? I'd rather not write a crash into the code itself (ie. null pointer dereference). Using the task manager to kill the process doesn't yield the same results.

like image 840
MarkP Avatar asked Nov 26 '10 11:11

MarkP


1 Answers

On Windows you can attach WinDbg to a process, corrupt some register or memory and detach. For instance you can set instruction pointer to 0 for some active application thread.

windbg -pn notepad.exe

Right after attach, current thread is set to debug thread, so you need to change to app thread to make it crash with RIP register update

0:008> ~0s 
0:000> rip=0
0:000> qd
like image 104
Andrii Avatar answered Oct 28 '22 20:10

Andrii