/*** Sleep for a certain amounts of seconds.*/privatevoidSleep(intseconds){Thread.Sleep(seconds*1000);}
Mouse is moving
usingSystem.Runtime.InteropServices;// ...[DllImport("user32.dll")]staticexternboolGetCursorPos(outPointlpPoint);publicPointGetMousePosition(){GetCursorPos(outPointlpPoint);returnlpPoint;}[StructLayout(LayoutKind.Sequential)]publicstructPoint{publicintX;publicintY;}/*** Exit the program if the position of the mouse has not changed in 30 seconds.*/publicvoidCheckMouseIsMoving(){PointmousePosition=this.GetMousePosition();this.Sleep(30);PointnewMousePosition=this.GetMousePosition();if(mousePosition.X==newMousePosition.X&&mousePosition.Y==newMousePosition.Y)Environment.Exit(1337);}
Numbers of CPUs
/*** Exit the program if the number of CPU is below or equals to 2.*/publicvoidCheckCPUCount(){if(Environment.ProcessorCount<=2)Environment.Exit(1337);}
Presence of Debugger
usingSystem.Diagnostics;// .../*** Exit the program if a debugger is attached to the process.*/publicvoidCheckDebugger(){if(Debugger.IsAttached)Environment.Exit(1337);}
Uptime
/*** Exit the program if the uptime is less than 15 minutes.*/publicvoidCheckUptime(){intuptime=(Environment.TickCount&Int32.MaxValue)/1000;if(uptime/60<15)Environment.Exit(1337);}