Beakerboy / vbaProject-Compiler

Create a vbaProject.bin file from VBA source files.
15 stars 3 forks source link

Compression checks #19

Closed Beakerboy closed 1 year ago

Beakerboy commented 1 year ago

Reading the docs, it might not be too hard to just code up the compression algorithm within this module. Excel_press has no formal testing and code coverage metrics.

Beakerboy commented 1 year ago

@sancarn after reading the docs, it looks like it is perfectly acceptible to include uncompressed VBA code within a vbaProject.bin file. VBA code is saved in the bin file in “chunks” and each chunk has a header that gives information on how it is compressed. One of the options is “uncompressed”.

Beakerboy commented 1 year ago

In the vbaProject.bin file included with tests File offset 800 begins with 01 16 03 . 0x0160 = 352. We add 3 to mean there are 355 bytes in this compressed chunk.

sancarn commented 1 year ago

@sancarn after reading the docs, it looks like it is perfectly acceptible to include uncompressed VBA code within a vbaProject.bin file. VBA code is saved in the bin file in “chunks” and each chunk has a header that gives information on how it is compressed. One of the options is “uncompressed”.

Interesting... would be useful to see this in action! If you don't need the compression algorithm that does make it a whole lot easier... Is there any examples of this that you have found? I'd imagine it might also make the file smaller too as modern compression is likely better than excel_press compression

Beakerboy commented 1 year ago

I thought the same thing. The fact that the bin file is going to be zip compressed anyways might mean it does not matter.

Beakerboy commented 1 year ago

@sancarn i was able to implement the decompression algorithm. This will make it easier to test hinge with just this app. Next step is to implement the compression algorithm.

Beakerboy commented 1 year ago

Compression has been implemented, tested, and resides in its own package https://github.com/Beakerboy/MS-OVBA-Compression