Crash it!

The most pointless things sometimes make sense. Believe me or not, but crashing a program on purpose can be fun and useful. Ok, mostly fun, but also useful!

Screenshot of Crash It!

"Crash it!" is a small Windows executable which can crash other processes on purpose using a specific reason. For the MultiMC project I wanted to implement the analysis of process exit codes on Windows. While those might seem useless at first glance, they actually can tell quite a bit about what happened.

Windows uses a 32bit integer to represent the exit code, which means it can fit HRESULTs and Win32 error codes. Applications typically only use exit codes in the range from 0 to 255 (which coincidentally is the exact range Linux uses), everything else remains mostly unused. However, in case of an uncaught SEH exception, an Access Violation or some other kind of fatal error Windows might write an exception code into the exit code.

An Access Violation for example might be exit code 0xC0000005 or its signed decimal form -1073741818. Those 2 numbers are not of much use on their own, but when decoded and ran through a translation process they can at least give a hint at what happened. In order to properly test this translation, I wrote "Crash It!" to force other processes to crash with a known reason. And yes, yes, it was fun!

Check out this project on GitHub