Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin


halt.c linux

Author:mike - Sat Feb 12 06:13:27 2005

Dont ask, its a result from a reverse engineering of has shutdown -h


halt.c
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(void)
{
        int fh;
        fh=open("/dev/initctl", O_WRONLY);
        write(fh, "i\31\t\3\1\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 384);
        close(fh);
}
----endfile

cc halt.c -o myhalt
./myhalt

and everything gos puf...en poweroff. :D
Copyright(c) Unifix.org 2002-2011


Dashboard - News - Search - List - About - Admin
 
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk