02 March 2017, 21:35 | #1 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Open source decompressors for many "old" amiga compressors
Hi,
I wanted to access/decompress some old Amiga compressed files (on a PC) and I noticed that many of the compressed files had compression formats that do not have proper cross-platforms tools. Some things I found (dernc, defimp, unsqsh) did not look pretty, were missing rudimentary error checking, exploded on 64-bit, were pure 68k to C translations or had shaky licensing terms. Some of the stuff did not have anything available on non-amiga. So what to do? Wel it took me three weeks but I wrote my own (hopefully better) ones. Currently it contains CrM!, CrM2, Crm!, Crm2, IMP (and variants), RNC1 (old and new), RNC2, TPWM, XPK with MASH, NONE, SQSH modes. (This was the stuff I needed) After checking on the files what I have (~10k of them) I'm convinced that what I have is at least as good as what is available otherwise. Some files I suspect are broken and nothing helps. In some cases I'm missing the reference what the uncompressed file should be. And in some case I believe my decompressor is actually doing better job than the tools I found. I'm sure there are still real bugs as well I tagged the license as BSD 2-clause and uploaded it to github: https://github.com/temisu/ancient_format_decompressor Enjoy. (If you have feedback, I'd love to hear that as well) |
02 March 2017, 22:20 | #2 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
welcome, cool project.
on my cygwin 32 bit installation i had to "fix" something: Code:
diff -u -p1 ancient-orig/HuffmanDecoder.hpp ancient-new/HuffmanDecoder.hpp --- ancient-orig/HuffmanDecoder.hpp +++ ancient-new/HuffmanDecoder.hpp @@ -11,2 +11,4 @@ +#define ssize_t int + template<typename T> Only in ancient-new: IMPDecompressor.o diff -u -p1 ancient-orig/main.cpp ancient-new/main.cpp --- ancient-orig/main.cpp +++ ancient-new/main.cpp @@ -76,3 +76,3 @@ Buffer *readFile(const std::string &file file.seekg(0,std::ios::end); - size_t length=file.tellg(); + size_t length = (size_t) file.tellg(); file.seekg(0,std::ios::beg); |
03 March 2017, 12:14 | #3 |
Registered User
Join Date: May 2004
Location: Somewhere secret
Age: 50
Posts: 364
|
There was (is) an existing RNC1/2 depacker in C from 199x, done around the PSX/N64 days, which was widely used by various cracking groups on those platforms.
But cool work, might come in useful sometimes, thanks for releasing it! |
03 March 2017, 16:27 | #4 |
Registered User
Join Date: Feb 2017
Location: fastmem
Posts: 53
|
Awesome stuff! This was on my list of 'things I must find or write' - will try it out this weekend for sure.
Because you asked... It would be great if there was an option to pass in a binary blob (scan from start until it hits a signature, decompress, dump, continue until blob ended - one input, potentially many outputs). Not that I would feed it an entire .adf. Oh, no. Of course not. That would be cheating... >.> <.< Thanks again, this already is a big timesaver... |
03 March 2017, 17:28 | #5 | ||
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Good catch. Last minute brainfart on my side. I should not use ssize_t and I did not test the latest on 32bit...
Quote:
Quote:
|
||
03 March 2017, 20:34 | #6 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
|
13 March 2017, 18:52 | #7 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Added now a few more things for XPK: GZIP and wired CrunchMania through XPK as well (CMR2, CRMS)
I still plan to add the trivial ones for XPK: CBR0, CBR1, and RLEN, as well as wire the IMPL. (I did not finish binary scanner yet though, although I have it under work) If you have some feedback/wishlist let me know |
17 March 2017, 21:03 | #8 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Well, I'll continue a bit more my monologue here.
Cholok provided me with a excellent references of XPK-sublibs with sources. Now I know the details that I had to guess earlier. I'm thankful This means I have been able to implement support for a many algorithms, and there is still many more to come. Also now I finished a scanner for embedded streams in files that can be applied to whole directories... |
17 March 2017, 21:06 | #9 |
Pastafarian
Join Date: Sep 2010
Location: Uppsala/Sweden
Posts: 290
|
Cool project temisu!
|
17 March 2017, 22:19 | #10 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
now it got its correct filename
if you dont mind, you can add some diskimage decruncher from uaeunp. DMS, WRP and DSQ. amiga-stuff.com lists alot of amiga crunchers and archivers - most without sources. some have sourcecode, for example: zoosrc2-10.lha maybe they will help. Last edited by emufan; 17 March 2017 at 22:24. |
08 April 2017, 06:54 | #11 | |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
I have reached a big milestone finally which is that I surpassed xpk_User when it comes to supporting different decompressors. Now there are just 24 XPK-decompressors supported (+some non-XPKs as well)
Final piece of that puzzle was SHRI which made me almost cry, the horror There are a few popular comps left like LHLB, BLZW and BZP2 and rest is just esoterics. Oh well, now when I started I can add them all as well Quote:
|
|
08 April 2017, 16:03 | #12 |
Zone Friend
Join Date: Nov 2005
Location: Italy
Posts: 139
|
Use stat, not d_type
The d_type member is not portable, MinGW in Windows bombs errors:
main.cpp: In lambda function: main.cpp:227:14: error: 'struct dirent' has no member named 'd_type'; did you me an 'd_name'? if (de->d_type==DT_DIR) ^~~~~~ main.cpp:227:22: error: 'DT_DIR' was not declared in this scope if (de->d_type==DT_DIR) ^~~~~~ main.cpp:230:21: error: 'struct dirent' has no member named 'd_type'; did you me an 'd_name'? } else if (de->d_type==DT_REG) { ^~~~~~ main.cpp:230:29: error: 'DT_REG' was not declared in this scope } else if (de->d_type==DT_REG) { ^~~~~~ Makefile:21: recipe for target 'main.o' failed mingw32-make: *** [main.o] Error 1 |
08 April 2017, 18:13 | #13 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
|
08 April 2017, 21:01 | #14 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Thanks, this is pretty useful to have.
|
09 April 2017, 12:50 | #15 |
Registered User
Join Date: Feb 2017
Location: fastmem
Posts: 53
|
|
09 April 2017, 14:20 | #16 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
"Others" - support for dsq and wrp would be of good use - "when" doesnt matter #2) regarding DMS, there are some encrypted DMS files, you have to use some sort of brute-force. uaeunp should have that method already - to get an idea. |
|
09 April 2017, 20:11 | #17 |
Junior Member
Join Date: Aug 2001
Location: France
Posts: 1,385
|
i don't know if it can be useful but i have used in the past http://wiki.xentax.com/index.php/Jaeder_Naub on pc, i'm not sure if it allow amiga packers
|
01 October 2017, 13:44 | #18 |
Junior Member
Join Date: Aug 2001
Location: France
Posts: 1,385
|
some packers/depackers on amiga and PC : ftp://ftp.spaceballs.no/public/Proje...er_Test_Suite/
|
01 October 2017, 15:23 | #19 | |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
Quote:
Funny thing though when I run scan with the current tool: Code:
Found compressed stream at 548, size 129968 in file Amiga_Packed_File_Examples/Amiga_UnknownCruncher01 with type 'RNC1: Rob Northen RNC1 Compressor (old)' |
|
07 November 2017, 22:36 | #20 |
Registered User
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
|
I added DMS support now. I think the implementation is as good or better than anything else out there for DMS
It is disturbing to see that there are corner cases which are handled differently between xdms and uae port. Unfortunately *files what I have do not exercise those corner cases. But I found some others that were not handled correctly in neither and tried to handle them properly. Please try it. And then there is files like these: http://aminet.net/package/demo/disk/Eradication It is obviously broken by the compressor already. But I think it could be fixed in decompression stage. However, I would need more than one datapoint to support my theory Also I added password bypassing in the code. Already 16-bit key is ridiculously weak but I even added plaintext attack to it: if it is bootable image i.e. starting with 'DOS' the password bypassing is lightning fast. (if not, it is just fast) Banner and file_id.diz will be thrown away. Who cares Anyway. I need more files to test. Especially password protected and currently files that cant be decompressed. If someone has those, I'd love if you zone em... *I have currently 1670 dms files. Basically I downloaded everything from aminet (I'm glad they did not IP-block me) as well as some other sources I could find. Googling password protected dms-files lead to me for searching amiga format subscriber disks. But I only found 1 of those |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" | DemosongIHunter | request.Music | 45 | 23 May 2022 20:07 |
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" | rockape | News | 4 | 30 January 2013 00:06 |
After creating OS 3.9 Emergency Disk: Cannot open "cd.device" unit 2 | Snowwie | support.Other | 2 | 31 March 2012 14:44 |
A source of cheap LCD for "small Amiga" projects... | mabus | support.Hardware | 2 | 14 February 2008 00:25 |
Who hides behind the handle "Source / The Source"? | andreas | Retrogaming General Discussion | 15 | 04 January 2005 16:02 |
|
|