Re: Any zip or tgz that decompress to itself ?



Someone called Caspian Maclean, made such a file a couple of years
ago. Here it is:http://www.maximumcompression.com/selfgz.gz

bizarre. seems to work, dunno how.
any explanation?...

The website it was on doesn't exist anymore, but I have some snippets
of information saved. Hope it helps:

Treating gzip files as a programs that output the
result, here is the pseudocode with code addresses
and output addresses:

addr pseudocode output
000: begin
010: unc(15)
015: begin ;0
025: unc(15) ;10
030: nop10
040: copy(8,15),(7,15), unc(30) ;15,25
050: nop10 ;30
060: copy(8,15),(7,15), unc(30) ;40
070: nop10 ;50
080: nop10
090: nop10
100: copy(20,20),(10,10), unc(20) ;60,70,80
110: nop10 ;90
120: copy(20,20),(10,10), unc(20) ;100
130: copy(20,20),(10,10), unc(20) ;110,120,130
140: data-for-crc ;140
150: copy(5,10),(5,10), unc(20) ;150
160: copy(5,10),(5,10), unc(20) ;160
170: copy(10,20),(10,20), unc(0) ;170
180: end ;180
190: copy(10,20),(10,20), unc(0) ;190,200
200: end
210:

unc(n) is a header for n uncompressed bytes.
copy(length, dist) repeats "length" bytes from a

position starting "dist" bytes before the new
copy.

nop10 outputs nothing.


==========

He also mentions 'helper programs' used for solving the checksum.

.