FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Can someone explain cls-*.dlls and how to use them? (https://fileforums.com/showthread.php?t=102636)

describe19 23-02-2019 03:58

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:eek:...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?

JRD! 25-02-2019 11:50

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++

Code:

int ClsMain (int op, CLS_CALLBACK callback, void* instance)
{
    switch(op)
    {
    case CLS_COMPRESS:
    case CLS_DECOMPRESS:
        { 
            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<0return 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;
        }

    default:
        return CLS_ERROR_NOT_IMPLEMENTED;
    }
}


elit 27-02-2019 14:21

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:

Code:

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 >>
Code:

[External compressor:lolz]
header = 0
packcmd = CMP\lolz_x64.exe {options} $$arcdatafile$$.tmp $$arcpackedfile$$.tmp
unpackcmd = DEC\fazip -i0 decompress:lolz <stdin> <stdout>



All times are GMT -7. The time now is 19:14.

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