Hello, I am working on a program to wipe the partition table on
a hard disk quickly.
I found some code that Mel wrote for Int13 read/writes (below)
I just need a little info on how to use it. The plan is to
overwrite sector 0 - 575 with the Null character to wipe the
Partition table and any of these boot managers that use the
63 sector offset method. (EzDrive, GoBack, etc.)
What I need to know is if the following code will work in theory.
(I will test it in reality before deployment)
Mel's code below here.
------------------
Amos
mailto:[email protected][email protected]</A>
a hard disk quickly.
I found some code that Mel wrote for Int13 read/writes (below)
I just need a little info on how to use it. The plan is to
overwrite sector 0 - 575 with the Null character to wipe the
Partition table and any of these boot managers that use the
63 sector offset method. (EzDrive, GoBack, etc.)
What I need to know is if the following code will work in theory.
(I will test it in reality before deployment)
Code:
for sector%=0 to 575 call write.hard(1,1,1,sector%,1,chr$(0)) next OR call write.hard(1,1,1,0,575,1,string$(chr$(0),575)) 'I think this 'syntax is wrong
Code:
function read.hard$(d, t, h, s, n) ' Read a hard drive sector d$ = string$(n * 512,65) ' d = drive number (0-3) Reg 1, (2 * 256) + n ' t = track Reg 2, strptr(d$) ' h = head Reg 3, ((t and &hff) * 256) + s ' s = sector Reg 3, Reg(3) or (t and &h300) \ &h4 ' n = number to read Reg 4, (h * 256) + (d or &h80) ' Reg 9, strseg(d$) ' Call Interrupt &h13 ' read.hard$ = d$ ' end function ' function write.hard(d, t, h, s, n, d$) ' Write a hard drive sector Reg 1, (3 * 256) + n ' d = drive (0-3) Reg 2, strptr(d$) ' t = track number Reg 3, ((t and &hff) * 256) + s ' h = head number Reg 3, Reg(3) or (t and &h300) \ &h4 ' s = sector number Reg 4, (h * 256) + (d or &h80) ' n = nbr sects to write Reg 9, strseg(d$) ' d$ = data to write Call Interrupt &h13 ' Call the interrupt (13h) end function '
Amos
mailto:[email protected][email protected]</A>
Comment