Php – Decoding Windows 7 Sticky Notes File

PHPwindows 7

I love the windows 7 sticky note app and need to write a quick script to copy my notes to my iphone (easier than bringing a laptop to meetings). How can I extract my notes from the stick notes file (C:\Users\USER\AppData\Roaming\Microsoft\Sticky Notes\StickNotes.snt). The file stores undo entries, or other meta data, for each note, so I can't simply read n bytes from the start of a note.

Edit:
Sample file – http://www.mediafire.com/download.php?qzgkj5gmdek

The encoding is difficult for me to decode. Text fragments aren't continuous, they're broken up by deleted strings (probably allowing for a per-sticky undo), and there aren't any clear delimiters. There is a forensic app that decodes the files. App description, taken from website…

http://www.simplecarver.com/exchange/articles/article-4.html

Structured Storage Extractor is a utility for reading and extracting information from the Structured storage format (ole container) files.

Apparently the data is stored in an OLE stream format. I tried using the PEAR OLE Library but it didn't read the stream properly :/.

Best Answer

You can use 7-Zip for extracting the file, then copy the 0 file from each folder somewhere using the RTF file extension. Then you could use LibreOffice for converting the notes from RTF to PDF, for example. You could put this in a script, something along these lines:

7z x -yir!0 StickyNotes.snt
soffice --headless --convert-to pdf each_folder/each_0.rtf