Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird entry names in .msi file #3

Closed
kjk opened this issue Apr 23, 2018 · 5 comments
Closed

Weird entry names in .msi file #3

kjk opened this issue Apr 23, 2018 · 5 comments

Comments

@kjk
Copy link

kjk commented Apr 23, 2018

MSI file is also MS-CFB format.

I opened https://cmake.org/files/v3.11/cmake-3.11.1-win64-x64.msi with http://sheetjs.com/cfb-editor

The file can be opened and the content of entries seems to be correct but file names seem wrong:

screen shot 2018-04-22 at 9 07 57 pm

@SheetJSDev
Copy link
Contributor

Those are the actual entry names.

MS-CFB 2.6.1 asserts the names are encoded in UTF-16. Here are the actual bytes from the first four directory entries:

5200 6f00 6f00 7400 2000 4500 6e00 7400
7200 7900 0000
"Root Entry" (this is not included in the output)

3042 2743 6438 be41 6441 0000 
"䈰䌧㡤䆾䅤"

0500 5300 7500 6d00 6d00 6100 7200 7900
4900 6e00 6600 6f00 7200 6d00 6100 7400
6900 6f00 6e00 0000
"\u0005SummaryInformation"

4048 ff3f e443 ec41 e445 ac44 3148 0000
"䡀㿿䏤䇬䗤䒬䠱"

Since both the Root Entry and the standard \u0005SummaryInformation stream appear, I'm inclined to believe that MSI is doing something funky with the filenames.

And if this blog post is to be believed, MSI is in fact doing something funky with the filenames:

The Windows Installer actually compresses the stream names to double the space available to 62 or 63 characters (plus one extra for the null terminator, but again, who's counting?). That compression is why if you open a MSI file with dfview.exe you'll see a bunch of gobbledygook names. That compression algorithm is not documented so I can't comment on it.

@SheetJSDev
Copy link
Contributor

We added the display to the website, reversing the algorithm based on the expected names in the Installer Database documentation:

screen shot 2018-04-23 at 13 40 45

@kjk
Copy link
Author

kjk commented Apr 23, 2018

Awesome, thanks!

@msauper
Copy link

msauper commented Jun 14, 2019

can you describe the algorithm used to encode the names?

@msauper
Copy link

msauper commented Jun 17, 2019

Thanks for your help. This worked quite well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants