The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: zcoder on September 24, 2008, 04:18:49 AM

Title: floppy IMG file backup.
Post by: zcoder on September 24, 2008, 04:18:49 AM
Here is a program I made by mistake, and I thought I would share the code.
The mistake I made was having my filename and path, messed up.(mangled)

This did not open a file on a floppy, But what it did do was open the
floppy drive as a device, allowing me to read and write to each sector
on the drive. So I stopped writing the program I was working on and
played with this and found out I could read floppy images to disk files
and back to floppies. this was good for making boot images. it also worked
on Cd's to make CD IMG files.

So I thought some of you might be interested in a program that could
make floppy IMG files and restore them onto other floppies.  The source
is included.

I also would like to know from others to test this out if it works, and if it don'y
could you let me know your OS? I have XP Home, and I am not sure if this
works accros other OS's

Zcoder....


[attachment deleted by admin]
Title: Re: floppy IMG file backup.
Post by: ragdog on September 24, 2008, 07:07:01 AM
Nice source

Here is a other source for read/write img file to floppy


I canot test your tool ,i have no floppy-drive :bg


[attachment deleted by admin]
Title: Re: floppy IMG file backup.
Post by: BlackVortex on September 24, 2008, 12:02:17 PM
Quote from: ragdog on September 24, 2008, 07:07:01 AM
Nice source

Here is a other source for read/write img file to floppy


I canot test your tool ,i have no floppy-drive :bg

You don't need to have the hardware to do it, you can use emulation, for example VMWARE Workstation can mount disk images in its virtual floppy drive   :wink
Title: Re: floppy IMG file backup.
Post by: ecube on September 24, 2008, 01:41:43 PM
Nice clean source, shame you're using another assembler :P seems everyone on masm32 using everything but masm ;) code seems to work fine with vista home.
Title: Re: floppy IMG file backup.
Post by: ragdog on September 24, 2008, 02:41:35 PM


i dont install 100te apps for test a tool ! :bg

Title: Re: floppy IMG file backup.
Post by: Vortex on September 24, 2008, 04:44:57 PM
Thanks for the floppy image tool.
Title: Re: floppy IMG file backup.
Post by: Tedd on September 29, 2008, 12:37:28 PM
You can access any drive by opening "\\.\X:" (where X is the drive letter) with CreateFile and then treat it as a normal file - just remember to open with "FILE_SHARE_READ or FILE_SHARE_WRITE"
Works for all version since windows 95 (though I think there were some limits on 95/98)

See also: "\\.\PHYSICALDRIVE0" for the first hard-disk (starting from the MBR, rather than the first partition.)
Title: Re: floppy IMG file backup.
Post by: PBrennick on September 29, 2008, 05:29:50 PM
I sure would be careful, though!  :U

-- Paul