fragglet / lhasa

Free Software LHA implementation
http://fragglet.github.io/lhasa/
ISC License
80 stars 15 forks source link

Some -pm1- archives extract with CRC errors #12

Closed fragglet closed 10 years ago

fragglet commented 11 years ago

As reported by Fábio Ricardo Schmidlin, these archives contain some -pm1- archives:

http://www.msxarchive.nl/pub/msx/utils/misc/freewar1.pma http://www.msxarchive.nl/pub/msx/utils/misc/freewar2.pma http://www.msxarchive.nl/pub/msx/utils/misc/freewar3.pma

Some of the -pm1- files extract correctly, but others fail with CRC errors. The ones that fail seem to be one byte too short, so there may be an off-by-one bug in the extractor code that's causing it to finish decompression one byte too early.

fragglet commented 10 years ago

Fixed in a72435781400bfe3f66e8731cf315df7656c7db4.

roytam1 commented 10 years ago

Not yet fixed! I got PMArc 1.24 from SMC-NETWORKS, local mirrored: http://roy.dnsd.me/PMARC124.PMA and compressing GPL2 license text file (via Takeda's CP/M player, bin+src: http://homepage3.nifty.com/takeda-toshiya/cpm/cpmcons.zip)

I:\>cpm PMARC.COM GPL2TXT.PMA COPYING.txt/T

PMarc Standard Version 1.24 for 47K CP/M(Z80)
Copyright(C) 1990 by Yoshihiko Mino.

Archive file = PM1A.PMA (NEW)

  COPYING .TXT  Compressing 00C6/00C6  38.8%  Adding  Done.

http://roy.dnsd.me/GPL2TXT.PMA

and comparing between decompressed by PMA.COM and lhasa:

I:\>fc /b COPYING.PME COPYING.TXT
000062C1: 21 1A
000062C2: 0A 1A
fragglet commented 10 years ago

Okay, thanks for finding this, and for finding the tool (that'll be really useful!). I'll take a look ASAP.

fragglet commented 10 years ago

Can you provide me a copy of the original COPYING.TXT file, from before you compressed it?

roytam1 commented 10 years ago

Oops, that is LGPL 2.0 license text, not GPL2. http://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt

fragglet commented 10 years ago

Thanks, but that doesn't seem to be the same file (there are some differences, like the FSF address). Can you upload your copy of copying.txt?

roytam1 commented 10 years ago

OK the original COPYING.TXT is almost same as the decompressed version by PMA.COM without EOF(0x1A) at the end. http://roy.dnsd.me/COPYING.TXT

fragglet commented 10 years ago

Thanks! I reworked my previous fix to work in a different way, so all the archives now work, including yours.