Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Thread Tools Display Modes
Old 23-02-2019, 04:58
describe19 describe19 is offline
Registered User
Join Date: Jul 2017
Location: australia
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
describe19 is on a distinguished road
Question Can someone explain cls-*.dlls and how to use them?

Hello I've been reading a lot around this forum and I am making a repack with srep+lolz.

I downloaded lolz from krinkels.org and I have a packcmd specified in arc.ini, however I do not need an unpackcmd as somehow the cls-lolz.dll does it automatically...I need to move the cls-lolz stuff it away from arc.exe during packing though as it seems to interfere.

I tried using ProFrager's cls-srep files from krinkels.org but when I unpack my file compressed with srep+lolz I get a crc check error, this doesn't happen when I use cls-lolz and normal srep64.exe -d -s -- <stdin> <stdout> in arc.ini.

My questions are:
How do cls-*.dlls work with arc.exe and unarc.exe - what happens? I have tried searching but haven't been able to find much about cls plugins.
How can I use other cls dlls like cls-srep.dll?
Is there a way I can use cls dlls to unpack without an arc.ini at all?
Reply With Quote
Sponsored Links
Old 25-02-2019, 12:50
JRD!'s Avatar
JRD! JRD! is offline
Registered User
Join Date: Sep 2015
Location: Matrix
Posts: 274
Thanks: 225
Thanked 596 Times in 168 Posts
JRD! is on a distinguished road
The key contains the same encoding and decoding information as in arc.ini except that you can add additional options that are specific to the compressor or for example automatically test whether the target system is 32 or 64 bits in order to use the version the appropriate program.

The name of the compressor you used during compression must be the same as the name of the CLS, and the programs on which it is referenced conform to those specified in the part encoding / decoding.

They do not require an arc.ini file but can search for preferences in the CLS.ini file as needed.

Exemple in C++

int ClsMain (int op, CLS_CALLBACK callback, void* instance)
    case CLS_COMPRESS:
            char param[100];
            callback(instance, CLS_GET_PARAMSTR, param, 100);  // Get method parameters as single string

            const int BUFSIZE = 4096;
            char buf[BUFSIZE];
            for (int len; (len=callback(instance, CLS_PARTIAL_READ, buf, BUFSIZE)) != 0; )
                if (len<0)  return len;  // Return errcode on error
                int result = callback(instance, CLS_FULL_WRITE, buf, len);
                if (result != len)  return result<0? result : CLS_ERROR_WRITE;
            return CLS_OK;

Practice makes perfect.
Reply With Quote
Old 27-02-2019, 15:21
elit elit is offline
Registered User
Join Date: Jun 2017
Location: sun
Posts: 256
Thanks: 182
Thanked 315 Times in 113 Posts
elit is on a distinguished road
Your problem is what I had before and surprisingly there is not much info about it. Only thank to Simonq help I got it right. Create separate folders inside Freearc/bin for compression and decompression, e.g. /COM and /DEC. Then place only compression related things to COM and only decompression related things to DEC. Otherwise you get conflicst you mentioned. But, FreeArc does not detect cld dll's in other than main directory, so you need to use Fazip for it(yes its all totally stupid).

Example, lolz:

COM dir >> lolz_x64.exe (only)
DEC dir >> cls.ini, cls-lolz.dll, cls-lolz_x64.exe, cls-lolz_x86.exe, fazip.exe
^Btw I think fazip must be 32bit but not sure.

Finally, arc.ini >>
[External compressor:lolz]
header = 0
packcmd = CMP\lolz_x64.exe {options} $$arcdatafile$$.tmp $$arcpackedfile$$.tmp
unpackcmd = DEC\fazip -i0 decompress:lolz <stdin> <stdout>
Reply With Quote
The Following User Says Thank You to elit For This Useful Post:
hydefromt70s (13-07-2020)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 00:17.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com