flat assembler
Message board for the users of flat assembler.

Index > Main > File Creation

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
LocoBird



Joined: 18 Feb 2007
Posts: 1
LocoBird
I think what u want is to use windows api createfile NOT readfile.
you can read raw sectors with createfile in win xp. Its the only way.
i don't know how to read NTFS but i can send you a Visual Basic 6.0 example that can read raw data for all the FATs. is a windows undelete program.

im assumeing thats the type of read/write you want?
P.S. it can be done in NTFS to, my example just dosn't show how.
also this vb scource can be rewiten in any programming langage that can call win API. Rolling Eyes

_________________
I don't know what to say i just don't know!
Post 18 Feb 2007, 22:37
View user's profile Send private message Reply with quote
assemblyNewbie



Joined: 14 Feb 2007
Posts: 12
Location: England
assemblyNewbie
I'm building a disk imaging tool which needs to copy the raw binary data from a storage device (mainly a hard disk at the moment) and write it to a file on another device (an external hard disk). This is why I need to read sectors in xp.

Shoorick, I'm not sure what you meant by "yes" in your post above. Do the two pieces of code i attatched earlier work ("read sectors".txt and "driveInfo.txt"), in which case its written in C++, or is there an error which is causing me to not be able to compile it.

Thanks for your help
Post 19 Feb 2007, 10:39
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
"yes" was for the first post - i had no time to provide clear example, so, just had modified existing program which just copies files to copy only first 512 bytes and at once (operations with such devices required to use n*512 bytes reading per time), then i had used "\\.\c:" as "from" and "d.txt" as "to" with this program. it is possible, but if you wish to have valid image of drive, then you must lock it while image will be created - it is impossible if drive is used as system.
if my example was not clear i'll try to do better but not so fast (busy with other work)

_________________
UNICODE forever!
Post 19 Feb 2007, 10:56
View user's profile Send private message Visit poster's website Reply with quote
assemblyNewbie



Joined: 14 Feb 2007
Posts: 12
Location: England
assemblyNewbie
I realise that I'd need to lock the drive. In theory i'd use a hardware write blocker with the disk being imaged - but they cost up to $350 so i'll just have to try and manage imaging the drive thats in use, or I could image the second hard drive of a different computer.

At the moment I'm making good progress. Thankyou for all your help and I'll be in touch if i get into serious difficulties
Post 19 Feb 2007, 15:21
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
if you need just imaging it could be better check OS creation: after loading such special kind of OS from floppy or CD you can send ATA commands to drives and get full info about partitions etc. and copy all data to some another device, and you will be safe becouse of monopolic access to hdd.
Post 19 Feb 2007, 15:32
View user's profile Send private message Visit poster's website Reply with quote
assemblyNewbie



Joined: 14 Feb 2007
Posts: 12
Location: England
assemblyNewbie
I'll check that out. For arguments sake, assuming I was using the program I create to access the second hard disk (which doesn't have the OS), would the image be valid (assuming the I have a device to prevent data being written to that hard disk).

If i was to use my program on the hard disk which windows is using, would it be possible to read all the sectors from the disk or would exceptions be created when i tried to access a sector containing a file currently being used by windows. In what ways would the image be invalid?
Post 19 Feb 2007, 16:06
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
never did it before - try Smile there possible two results: 1. refusing of reading 2. not actual image - changed structure while image creating. system disk can be locked while os boot, but this technique implementation unknown to me.
Post 20 Feb 2007, 05:51
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.