14

My understanding of a .DS_Store file is that is contains details that describe a folder and the files within that folder. Based on that description, I can think of a few uses from being able to read a .DS_Store file.

My question: Is there any form of a tool or program that would allow for the reading/examination of a .DS_Store file?

Follow up question: If there's not a tool, can anyone explain to me the syntax of the file?

1
  • 1
    Did you have a look at the Wikipedia page? Especially the sentence "Its internal structure is proprietary"? And there are links to some pages with reverse-engineered format at the bottom of the article too.
    – techraf
    Commented May 30, 2016 at 1:24

2 Answers 2

11

There is a great write up and some easier solutions posted at http://ponderthebits.com/2017/01/mac-dumpster-diving-identifying-deleted-file-references-in-the-trash-ds_store-files-part-1/

Including this Terminal one-liner to convert a .DS_Store file to (mostly) text:

xxd -p <path/to/.DS_Store> | sed 's/00//g' | tr -d '\n' | sed 's/\([0-9A-F]\{2\}\)/0x\1 /g' | xxd -r -p | strings | sed 's/ptb[LN]ustr//g'
2

You can use hexdump or xxd to inspect the file contents directly - it is a binary file.

I would start with a perl or Python package rather than reinvent the wheel.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .