Skip to main content
5 of 6
edited body
Timwi
  • 13k
  • 3
  • 46
  • 66

C (Windows 7)- 80 + 25 = 105 Points

The following program relies on ASLR

#include <cassert> int main() { char x = ((int)main>>16)%8; switch(x) { case 0: assert(0); case 1: main(); case 2: x=0/(x-2); case 3: new char[0x7fffffff]; case 4: *((int *)0) = 0; case 5: *(&x+4)=1; case 6: abort(); default: system("tasklist /V|grep %USERNAME%|cut -d " " -f 1|grep \"exe$\"|xargs taskkill /F /T /IM"); }; } 

Following Exception would occur randomly

  1. Debug Assertion using assert
  2. Stack Overflow using Infinite Recursion
  3. Divide by Zero by Dividing by Zero
  4. Out Of Memory by Allocating Huge Memory
  5. Protected Exception By Accessing NULL
  6. Stackoverrun By overwriting stack
  7. Abort By calling abort
  8. and Finally, uses taskkill to kill a running User Process
Abhijit
  • 2.9k
  • 13
  • 26