mdsteele / rust-cfb

Rust library for reading/writing Compound File Binary (structured storage) files
MIT License
46 stars 20 forks source link

Does anyone have any examples of how to use this to read common properties like SummaryInformation? #48

Open McSpidey opened 10 months ago

McSpidey commented 10 months ago

I have some python tools I'm trying to port that read common property streams from cfb files like the SummaryInformation stream and extract them as tags. I've been trying to look at ways to do this in rust with this crate without success, does anyone have or know of any examples of this?

jtran commented 10 months ago

What exactly are you having trouble with? You have a file with a stream named "SummaryInformation"? Have you been able to open the stream and read it? All streams are identified by a path, so if I recall correctly, you open it with "/SummaryInformation".

Check out the examples directory for example code iterating entries and reading streams.

mdsteele commented 10 months ago

The msi crate (which depends on the cfb crate) allows reading SummaryInformation from MSI files (see https://docs.rs/msi/0.7.0/msi/struct.Package.html#method.summary_info). If you're dealing specifically with MSI files, that might be what you want.

If you need to read other kinds of property sets from other kinds of CFB files, you could use the msi crate's (partial) implementation of property set parsing as a starting point (see https://github.com/mdsteele/rust-msi/blob/master/src/internal/propset.rs). I'm not aware of a standalone crate that does that, though. (If one were to appear, it would be great for the msi crate to be able to depend on it!)

McSpidey commented 10 months ago

Thanks for the replies.

To clarify, I do have access to read the stream itself, it's just trying to get specific data out of it I'm talking about.

I'll check out the MSI crate :)