Results 1 to 12 of 12

Thread: Tool for JDLZ Compression

  1. #1
    Member
    Join Date
    Aug 2018
    Location
    Brazil
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tool for JDLZ Compression

    Hi guys, someone can make for me a tool to unpack/repack/recompress this archive https://drive.google.com/file/d/1-z9...w?usp=drivesdk ?
    Already there is a BMS script that unpack this archive, but don't recompress, only reimport the files without recompress and the game read the archive compressed only.

  2. #2
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,977
    Thanks
    296
    Thanked 1,304 Times in 740 Posts

  3. #3
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,977
    Thanks
    296
    Thanked 1,304 Times in 740 Posts
    http://nishi.dreamhosters.com/u/jdlz_v1.rar

    Ported my LZSS encoder for this... now size is pretty similar and until 0x7ABB the compressed output matches pretty good,
    but after that it becomes quite different.

  4. #4
    Member
    Join Date
    Aug 2018
    Location
    Brazil
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, I'ii test it here

  5. #5
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,977
    Thanks
    296
    Thanked 1,304 Times in 740 Posts
    Btw, its an interesting version of LZSS, with two flag bytes - one usual for literal/match flags,
    and the second one to switch between 11:5 and 4:12 match layouts.
    int ea_jdlz( byte* in, int insz, byte* out, int outsz ) {
    byte* inl = in + insz;
    byte* o = out;
    byte* outl = out + outsz;
    uint flags1 = 1, flags2 = 1;
    int i, t, length;

    while( (in<inl) && (o<outl) ) {
    if( flags1==1 ) flags1 = *in++ | 0x100;
    if( flags2==1 ) flags2 = *in++ | 0x100;

    if( flags1 & 1 ) {
    if( flags2 & 1 ) {
    length = (in[1] | ((*in & 0xF0) << 4)) + 3;
    t = (*in & 0xF) + 1;
    } else {
    t = (in[1] | ((*in & 0xE0) << 3)) + 17;
    length = (*in & 0x1F) + 3;
    }
    in += 2;

    for( i=0; i<length; i++ ) {
    if( (o+i+1)>outl ) break;
    o[i] = o[i - t];
    }
    o += i;
    flags2 >>= 1;
    } else {
    if( o<outl ) *o++ = *in++;
    }
    flags1 >>= 1;
    }

    return o - out;
    }

  6. #6
    Member
    Join Date
    Aug 2018
    Location
    Brazil
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, I have a LZSS compressor here made by you, helped me a lot to finish a game translation to my language

  7. #7
    Member
    Join Date
    Aug 2018
    Location
    Brazil
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey, I've tested the jdlz tool here with the following comands:
    Jdlz.exe d FRONTB1.LZC Unpacked - Unpack successfully the FRONTB1. LZC
    Jdlz. exe c Unpacked NEW_FRONTB1. LZC - Compress the FRONTB1. LZC unpacked creating a new FRONTB1.LZC packed.
    But there is an small problem, the output file packed is too large, the original is 456Kb and the new packed is about 700Kb, so it is impossible to me reinsert this edited file in the game. The strange thing is that I did'nt changed nothing in the unpacked FRONTB1, I just compress using the tool and the tool create a new packed file too large.
    Can you adjust the compress rate/level in the tool to reach the original size in the recompress mode? There is no problem if the new FRONTB1 file to increase 5 or 10Kb larger, but for me is impossible to work with more of 10Kb because the limitations used by game.

  8. #8
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,977
    Thanks
    296
    Thanked 1,304 Times in 740 Posts
    1) v0 actually has two encoding functions, one from the dll: "c" command, and another from the other thread: "e" command.
    2) v1 contains another encoding function, written by myself, its slower, but more similar to original file.

  9. #9
    Member
    Join Date
    Aug 2018
    Location
    Brazil
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hm, can you give me the v1?
    I have the v0 here

  10. #10
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,977
    Thanks
    296
    Thanked 1,304 Times in 740 Posts

  11. #11
    Member
    Join Date
    Aug 2018
    Location
    Brazil
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've replaced this source in the ea_jdlz compress function in the ea_jdlz.inc file and the packed ouput file continue with the 700Kb size. Maybe I've not replaced properly the source?

  12. #12
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,977
    Thanks
    296
    Thanked 1,304 Times in 740 Posts
    The compression function is in ea_jdlz_comp.inc
    Just download http://nishi.dreamhosters.com/u/jdlz_v1.rar and test it alone first, compressed size should be 467,505

Similar Threads

  1. Compressibility Tool
    By thometal in forum Data Compression
    Replies: 3
    Last Post: 30th September 2018, 02:03
  2. Creating A Compressor for 'JDLZ'
    By MWisBest in forum Data Compression
    Replies: 2
    Last Post: 17th January 2016, 22:11
  3. Can anyone identify this compression/encryption tool?
    By Mexxi in forum The Off-Topic Lounge
    Replies: 2
    Last Post: 9th August 2014, 16:52
  4. compression trace tool
    By Shelwien in forum Data Compression
    Replies: 6
    Last Post: 19th August 2009, 03:52
  5. LZBW1 - compression tool by another newbye :)
    By stfox in forum Data Compression
    Replies: 4
    Last Post: 28th April 2009, 16:33

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •