Monday, September 17, 2007

CSC/Offline File Parser/Copier

Addendum, Mar 22, 2008: Look at the March 22 2008 blog Entry as it has a newer version of the software. That post can be found here


As promised here is a link to the CSC/Offline File parser Copier. There is some more work that needs to be done on this but it does work pretty well.

In the zip file you can either run the csc_parser_gui.exe (autoit program) if you want to run in windows. Here is an explanation of the fields on the screen:

csc base file to parse : This is either 00000002 or csc1.tmp (backup of 00000002). Without this file your CSC is useless.

Database file to create: This is the sqlite database file that will be created and read from.

Base CSC Directory: Where you saved the CSC directory to. The default CSC directory is C:\Windows\CSC

Type of program to run: You can either run the perl scripts (.pl) or the executable (.exe). I did this encase you want to change the perl scripts and still want to use the gui.

Program to open the report in: Which program do you want to open the report in Excel or a web browser.

Once you fill in the fields you want then just press the button of the action you want, if you do not fill in one of the fields required for that action it will let you know.

Now if you want to run the perl scripts on a platform other then windows here is the sequence to run them in and parameters needed:

read-csc-dir.pl <base file to parse , with 00000002 or csc1.tmp> <DB File Name if it does not exist then it will be created> <Base CSC Directory, ie: c:\Windows\CSC>

read-csc-file.pl <DB File Name created in previous step>

To get a report of the files run this program, (Note: this will create a temp file and will try and open excel or a web browser so you may want to modify this program to your needs):

print-csc-files.pl <DB File Name created in previous step> <Directory to copy files to> <A or U for Allocated files or Unallocated files>

Sqlitespy.exe has been included in case you want to look at the database.

Any feedback would be appreciated. One thing that probably needs to be done is to be able to parse the sqlite database and recreate the directory structure so you can copy into the correct directories. If I get some more time I will try and document the file structures but in the mean time look at the code and you should be able to figure it out. Hope this helps someone out.

As always Comments/Questions/Suggestions are always welcome.

Addendum, Dec 6, 2007: After several questions I realized I failed to mention that you have to read/parse the csc file before you can report on it, so hit the read/parse buttone before any other button Also if you have spaces in any of the file/direcotry names then you will have to put double quotes around the whole field. If I get time I will try and make the change in the code to allow for this.

16 comments:

Ken said...

I tried to use your program to extract files from my csc directory. On another computer, I cannot get windows to boot properly, but i was able to copy over the windows/csc directory.
do i also need the csccmd v1.1 to get your program to work? do you have it?
thanks for your help.

Mark McKinnon said...

Kenny,

You do not need the csccmd program to use my programs. To minimally use my program you just select the main directory file to read from 00000002 or csc1.tmp. The database name to write to and the directory where you copied your windows/csc directory to. After that is defined just click on the read/parse button and it will read everything into the database. If you want to run the report just clik on print file listing and it will output it into a web browser or excel. If you want to write out the files to another directory you can do that as well. The only thing my programs do not do is recreate the original directory structure. When you do the copy it may overwrite like name files.

Any other questions let me know.

Mark

Ken said...

I should have left more details -
I extracted the CSC folder from the computer that won't boot. The total size was about 4gb.

When running your program to extract the files, the command prompt comes up and says ..."copy-csc-file.exe csc1.db3 C:\Restored A

End of program.

This happens immediately, and there is nothing in my restored folder.

Can you explain the second input, the database file to "create/report on" I am putting in csc1.db3, should this be different?

is it possible that i am not putting the correct path to the csc directory? i entered C:\Windows\CSC

Thanks again
Kenny

Mark McKinnon said...

Kenny,

Shoot me an e-mail mark dot mckinnon at sbcglobal dot net and I can try and help you out.

Mark

Unknown said...

I am looking to try this program out, it seems I need some version of perl in order to run this program? Can you advise what to install so the .pl files execute, at this point they open in notepad due to that current file association. Sorry for the stupid question.

Mark McKinnon said...

Ryan,

No question is stupid (unless asked 4 times becuase you did not write it down). You do not need to have perl installed. There is an option to run either perl or the exe program. Just choose option exe and it will run the executable programs. I have include both in case someone wants to modify the perl code and just run that. Any problems let me know.

Mark

Unknown said...

Mark,

Well, I was using the "exe" option and it would always open the .pl in a text editor when i ran the exe... So i don't know if that option choice is broken and always running the .pl no matter what or if the exe is referencing it... I installed activeperl and this stopped happening. (No more notepad opening)

However, it is immediately going to "end of program" and showing no files in the excel. Something seems to not be working. I have tried this both on a PC working fine with offline files and one that I am trying to 'recover' csc files from. I have tried all the options and they all return blank. For reference the csc directory is the default c:\windows\csc . I have tried both the 00000002 and the csc1.tmp file. I appreciate your work on this program, it could be very valuable. If there is anything I can do to help troubleshoot the issue, please let me know.

Thanks,

Ryan

Mark McKinnon said...

Ryan,

Can you e-mail me the following information.

1. All the fields you have filled in with there values.

2. The directory where the files reside.

3. If possible the 00000002 or the csc1.tmp file.

My email address is above in the comments.

Regards.

Mark

Anonymous said...

Does this work with windows vista?

I've got some files to retrieve from the CSC and it's been a real pain that I can't use CSCCMD: http://support.microsoft.com/default.aspx/kb/884739

Mark McKinnon said...

I have not tested it with windows vista but unless they changed the way that the CSC is stored and accessed then it should work.

Mark

Unknown said...

Did you figure out the index file format purely by inspection? Excellent work either way!

I'm trying to recover CSC files, but I'm in linux. I've used your perl scripts to recover the filenames, but I'm unable to re-create the directory structure.

Have I missed something or is directory recreation handled by the exe?

Thanks!
Aidan.

Mark McKinnon said...

Aidan,

I figured out the structure with the cscdmp program and a hex editor. It took quite awhile. Getting the original directory structure is quite a hassle, this is why I have not done it yet. It can be done though. I can try and walk you thru it if you would like. Shoot me an email (address is in the 4th comment of this comment section). It would be best if we had the same copy of the database.

I was thinking of compiling these programs under linux as well. The only piece that will not work under linux in Version 2 is the report piece and that would be just commenting out the code to look for the default web browser and launching the web browser.

Mark

Anonymous said...

Your program saved my bacon! Thanks so much.
I was able to recover all of my offline files.
whew, back to work again.
Sincerely,
Roger S

Anonymous said...

The first misconception that wannabes might invariably have is Hogan could be marginally harder than mountain trekking. If Hogan scarpe donna was the case, Hogan uomo need not have to be stiffer and flexible simultaneously. Add to Hogan scarpe uomo the extra mid-sole cushion to make you forget the heavy thumping downhill running.

pay per head said...

Thanks so much for the post, really effective data.

hermes kelly 32 said...

Thanks for sharing the nice pictures. You have done a great work. Every homeowner can benefit from property management services.