Napalm v.7 Alpha

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

Napalm v.7 Alpha

Post by chezzestix »

I may seem a little ADD starting this project only a couple days after starting hungry dots but it has some signifigance I swear.

Napalm:
This program is for when your HDD or FDD needs a REALLY good cleaning because nothing cleans better than Napalm. Not a single trace of any data will be left on your media when this program gets through with it.

What it does:
It may not be the most efficient way to clean a drive but what the program does is literally goes through and fills the whole disk with 00s ignoring any special formatting. Wiping every single bit clean of any trace of data.

The Reason:
I was asked if I could and its giving me valuable practice with FDD and HDD I/O which I'm going to need for Hungry dots. That and this program I have broken the 512 barrier.

What needs to get done before v1.0:
+HDD wiping (Don't try to choose a fixed disk, I'm yet to program that part of it but you can clean a disk)
+Progress Bar
+Possibly an ASCII art spash
+possibly support for other FDD than 3.25" 1.44 MB

Known Bugs:
VirtualBox reports wrong number of fixed disks (I dont much care though since it works fine on my hardware)
Attachments
napalm.zip
(1.34 KiB) Downloaded 127 times
Last edited by chezzestix on Thu Oct 09, 2008 9:55 pm, edited 7 times in total.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Napalm v.45 Alpha

Post by AJ »

FYI, an interesting (GPL'd / LGPL'd) opensource project that does very similar is Darik's Boot and Nuke (interesting that you have gone down a similar line with the project naming!).

Unfortunately I can't test yours at the moment because I don't have an appropriate target machine (could do it on an emu, but that won't tell you more than you already know). If I get access to one, I'll give it a go!

Cheers,
Adam
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Napalm v.45 Alpha

Post by 01000101 »

one wipe of 0's won't completely erase all data from ever being recovered. IIRC the govt standard is seven passes with alternating data and that is deemed unrecoverable by data forensics.
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

Re: Napalm v.4 Alpha

Post by chezzestix »

Huh good to know, I will have to add a prompt as to whether they want a single pass or an unrecoverable wipe.

BTW:
Does anyone know how standard INT 13/AH=25h is? IBM officially lists it as optional but it would make identifying drives a TON easier and safer for the user.
Last edited by chezzestix on Thu Oct 09, 2008 9:38 pm, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Napalm v.45 Alpha

Post by Combuster »

Since it gives you the output of the ATA identify command, I would expect that it'd only work for ATA harddisks (and thus not for SCSI drives)

But of course you can try to call it and see whether it returns a success value. :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

Re: Napalm v.45 Alpha

Post by chezzestix »

The command works fine on my hardware. I have provided provisions if it fails so whether or not it works the user will still be able to use napalm.

My first weirdness:
When I try to write on the second head it gives me a status code of 80h... whats going on here. Int 13/ah=01h says 80h=timeout but If I write the second head first it still screws up.
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

Re: Napalm v.5 Alpha

Post by chezzestix »

Long time no post, I got caught up in my commitment to another hobby and school. Anyhow single 0 wipe over floppies has been implemented so next I tried to tackle HDDs. I thought what better way to identify the HDDs than by model? So I print out a list of HDD models when the program starts. However Its a tad... weird (ignore the dashes they are just there to keep spacing)

Test drive 1: WD2000JB-00DUA3
Output 1:---- DW CDW0200BJ0-D0AU 3
My fix:- WDC WD2000JB-00DUA3

Test Drive 2: AC36400-00LC
Output 2:---- DW CCA6304L0
My fix:- WDC AC36400L

I studied these for awhile and I found a pattern. If you filp every two letters you get the my fix which corrects it. HDD2 has some extra issue of its own but thats no fault of my code. They are both Western Digital Caviar HDDs so that explains the WDC prefix.

So then my question is, WTF? I'll post my code just in case there is something wrong with it I can't see but what is going on here?
Last edited by chezzestix on Thu Oct 09, 2008 9:38 pm, edited 2 times in total.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Napalm v.45 Alpha

Post by 01000101 »

seems like you have a bit of endianness confusion.
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

Re: Napalm v.6 Alpha

Post by chezzestix »

WHAT COULD BE THE POSSIBLE REASONS FOR USING MIDDLE ENDIAN!?!

What ever... I changed the model output code to match middle Endian.

Code updated in first post

Napalm .60 A additions:
+HDD Model bugfix
+HDD Wiping
-Although massively buggy (possibly middle endian crap....)
+ASCII art splash
+Foundation laid for DoD and uber sani methods on FDDs
Last edited by chezzestix on Thu Oct 09, 2008 9:39 pm, edited 1 time in total.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Napalm v.60 Alpha

Post by JamesM »

chezzestix wrote:WHAT COULD BE THE POSSIBLE REASONS FOR USING MIDDLE ENDIAN!?!

What ever... I changed the model output code to match middle Endian.

Code updated in first post

Napalm .60 A additions:
+HDD Model bugfix
+HDD Wiping
-Although massively buggy (possibly middle endian crap....)
+ASCII art splash
+Foundation laid for DoD and uber sani methods on FDDs
You're still confused. The ATA IDENTIFY command returns 256 little endian 16-bit integers. So if you want a coherent string from them, you will have to byteswap each 16-bit integer. I have no idea where you got that it was using middle endian from...
geppy
Member
Member
Posts: 27
Joined: Wed Jun 11, 2008 5:30 pm

Re: Napalm v.60

Post by geppy »

For future,if you are serious about this:
You should read Secure Deletion of Data from Magnetic and Solid-State Memory by Peter Gutmann. His method may even be better than 7 pass US standard that 01000101 mentioned. And any of the 2 methods shouldn't work for flash memory. Keep in mind that some hard drives may have special commands for secure data erase.

or better yet get a device that fries hard drive (something has to do with magnetism). Enough for data being deleted but not enough for hard drive to be damaged. Few second job + time to take the drive out of the case. However, such a hard drive might not be seeing by BIOS anymore.
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

Re: Napalm v.6

Post by chezzestix »

@JamesN

Pulled from the table of addresses that Int 13/ah=25h save to and that I am using:
36h 40 BYTEs model number in ASCII

That is what I am printing. I'm not sure where you are getting your assumptions... Your probably assuming I'm using a smarter more stable method I am yet to find. HA! Jokes on you. :P

As far as my middle endian conclusion:
1) 01000101 mentioned endianess
2) I looked at the article and middle endian matched the crazyness that was going on with the models

@geppy
lol. I'm not in trouble with the government for any reason so device fryers would be a tad extreme but I will give the paper a read. I have seen secure data erase functions lying around but as you said thats a bit of a future thing.
Last edited by chezzestix on Thu Oct 09, 2008 9:38 pm, edited 1 time in total.
chezzestix
Member
Member
Posts: 118
Joined: Mon May 05, 2008 5:51 pm

Re: Napalm v.7 Alpha

Post by chezzestix »

New version in first post!

Added:
+DoD wipe for floppies
+"Uberwipe" for floppies
+Replace progress bar with spinny magig

Still to do:
-HDD wiping
User avatar
mystran
Member
Member
Posts: 670
Joined: Thu Mar 08, 2007 11:08 am

Re: Napalm v.45 Alpha

Post by mystran »

01000101 wrote:one wipe of 0's won't completely erase all data from ever being recovered. IIRC the govt standard is seven passes with alternating data and that is deemed unrecoverable by data forensics.
If I'm not mistaken, the best plan is to run around 7 passes of cryptographically strong random numbers. The idea being that by using random numbers, statistical analysis on the traces left on the disk become considerably harder.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
Post Reply