954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

creating a directory structure

hi basically i have a couple of questions. I have an image of a thumb drive. I have gone through the image extracting information from the file allocation table until i have all of the files saved as strings. Basically i would like to progress from this stage to reconstrcuting the directory structure to the way that it would have been on the thumb drive. Can anyone help me with reconstructing directory structures from memory?

any resources/ websites would be much appreciated

thanks

tootypegs
Junior Poster in Training
78 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

pretty simple really, just call mkdir() for each directory in the tree.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

CreateDirectory or mkdir can certenly create the directory.
Do you just want to craete the dir structure? Howz about attibutes like hidden or read only? Also security atrribute?
Seems it is a good amount of work...

dubeyprateek
Junior Poster
176 posts since Mar 2006
Reputation Points: 39
Solved Threads: 24
 
Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

i would like to basically recreate what the thumb drive looks like to the user, from the image file i obtained, reconstructing the directory structure and all of the files it contains. I think its called parsing? (could be wrong there tho). Ive looked for information on this topic but i cant find anywhere so im just sort of blagging it a bit and hoping im on the right direction. I'm guessing its gunna be a lot of work, it took ages just to work out the bits of the file allocation table and creating the calculations to find the files.

Even general information on parsing FAT would also be appreciated!!

thanks for the help!

tootypegs
Junior Poster in Training
78 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

> I have gone through the image extracting information from the file allocation table
So you have a list of filenames and directories then?

It seems odd that you can figure the intricacies of the internal format of FAT, yet can't call an API function to create a few directories.
AD pretty much nailed it in post #2.

Writing to a new FAT file system is considerably easier than the "forensic" investigation you did to read the old data in the first place.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

yer buts thats because i work in forensics and im new to C++ programming. I understand file systems fine, i just wanted to create a program to display it. Its the programming im rubbish at and trying to improve at.


Can you explain what you mean by "writing to a new FAT file system"?

Is there an easyier way of doing what im trying to achieve?

thanks

tootypegs
Junior Poster in Training
78 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

>>Is there an easyier way of doing what im trying to achieve?
You never said what you are trying to achieve other than creating directories. How much easier do you want it to get anyway, just call mkdir () for each of the directory names.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

ah right sorry, that was my fault, my last post was off topic. I meant in terms of parsing the FAT to redisplay its contents. I wondered if there was an easier way of doing this than going through the file allocation table and working out where all the directory entries are stored. sorry i didn't explain very well in my last post.

I get the directory structure help, much appreciated.

thanks

tootypegs
Junior Poster in Training
78 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

Yes == see these code snippets which build directory trees in memory for both *nix and MS-Windows.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You