coldfusion39 / excel-press

Python script to compress VBA macro files
MIT License
23 stars 14 forks source link

Flaw in the compression algorithm #2

Open ahmad-siavashi opened 8 years ago

ahmad-siavashi commented 8 years ago

Hello, First, I thank you for your contribution. I'd like to report a bug in your implementation, more specifically in the compression algorithm. To figure out the bug you can compress a macro using your implementation then try to decompress it.; You'll find out the decompressed macro is totally unshaped and deformed. Here's the point, you've always used "<H" in your struct.pack function. You should used "=H" instead, except for the part which is explicitly mentioned in the MSOVBA document of Microsoft that instructs to use little-endian byte order.

Sincerely,

Beakerboy commented 1 year ago

I don't think this is the problem. As long as both the compression and decompression steps pack and unpack the data consistently. it will work. Instead it looks like there is a straight-up bug in the compression algorithm #4