![]() |
editing with LBA with C
i want to make a program that can write to a haard drive via the LBA number (so i can go all the way through it)
what library can i do this with, dos.h can do CHS but i want to use LBA so i can do large drives. basicly i want to write a program that i can run and it will wipe everything on a hard drive. it will take a while but it just needs to be done. im thinking of placeing it on a botable floppy so i stick it in and it erases hard drive 0. |
if you're not wedded to writing it yourself, you could use one of those bootable linux floppies and write a shell script that uses dd to overwrite it.
Sorry I coulndn't be more helpful :) |
As a note, if you're doing this for information security (ie: I want to be paranoid and wipe all of my data):
The DoD standard for data wiping is a minimum of seven passes, alternating between writing 0x00 and 0xFF - though there are much more hefty methods involving 20+ passes writing random data. |
Code:
#!/usr/bin/perl |
hmmm i've had no trouble finding libraries that will allow me to do CHS, but not LBA, CHS limits me to the first 528 meg of the hard drive, anyone else have an idea?
|
Access to the HD is provided by the OS, it's also protected by it, so what operating system do you want to access the disk directly on?
Normally you access it through the filesystem and not directly, so most libraries don't focus on it. The Win32 API probably has something for it, LBA access at least, you could inline assembly and talk directly to the HD. I would say more, but Win32 and intel assembly aren't well documented ;-) |
in the end it will be from a boot disk, dos most likely
|
Well if it's a boot disk then do exactly what Yakk showed you, you can probably find a floppy or CD linux distro that has Perl, Knoppix definitely does, and you could cut it up so Knoppix boots to the console really quickly without loading everything.
|
You should be able to inline assembly in C
http://home.teleport.com/~brainy/diskaccess.htm Here is a little on inlining assembly http://www.idt.com/docs/79R3041_AN_78591.pdf How you do it is compiler and platform specific. |
now were geting some where thanks for the help ill try with that and come back for more later
|
All times are GMT -8. The time now is 08:02 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project