Results 1 to 2 of 2

Thread: Self replicating archives

  1. #1
    Join Date
    Jul 2015
    Thanked 0 Times in 0 Posts

    Self replicating archives

    On there is a description of socalled "lz quines", LZ-archives that when extracted manually just expand to themselves. The page also provides actual examples for gz, tar.gz and even zip files.

    Does some know of corresponding examples for other algorithms/formats too, in particular for bzip2 and xz (maybe even for 7z containers using either of lzma or ppmd compression).

  2. #2
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Kharkov, Ukraine
    Thanked 1,360 Times in 777 Posts
    I think it should be possible with lzma2, but likely not BWT/PPM.

    An example:
    #include <stdio.h>
    char*s="#include <stdio.h>%cchar*s=%c%s%c;%cint main(void){printf(s,10,34,s,34,10,10);}%c";
    int main(void){printf(s,10,34,s,34,10,10);}

    Same method is used to generate an archive - you need 2+ different methods to encode data and reference previous data,
    which don't really exist in BWT/PPM.
    And lzma is not 100% impossible, but you'd have a hard time adjusting it, while the whole code changes from any modification.

  3. Thanks:

    jf1 (2nd June 2017)

Similar Threads

  1. reproductible (compressed) archives
    By sebbu in forum Data Compression
    Replies: 6
    Last Post: 8th December 2016, 00:09
  2. ZPAQ self extracting archives
    By Matt Mahoney in forum Data Compression
    Replies: 31
    Last Post: 17th April 2014, 04:39
  3. Bittorrent and solid archives
    By lunaris in forum Data Compression
    Replies: 8
    Last Post: 29th December 2010, 11:54
  4. MS CAB archives
    By nanoflooder in forum Data Compression
    Replies: 0
    Last Post: 10th April 2010, 01:58
  5. Multi-Volume Archives
    By osmanturan in forum Data Compression
    Replies: 12
    Last Post: 13th June 2009, 02:46

Posting Permissions

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