Page 2 of 3

Posted: Mon Aug 17, 2009 7:11 pm
by Nihlaeth
I started manually at my linux server, but after about 300 times renaming, unzipping and using the file command I gave up and started to look up the bash basics...

I could have guessed the answer easily, but I didn't know that in advance :p

However, I must say I really learned something on this one, thanks!

Posted: Sat Aug 28, 2010 9:23 pm
by Curiosu
used this php function ..it was a pain, first I thought it was simple zip,

Code: Select all

     function extractGzip ($src, $dest=false)
    {
        $zp = gzopen( $src, "r" );
       if (!is_resource($zp)) return false;
        $data = '';
        while (!gzeof($zp))
            $data .= gzread($zp, 1024*1024);
        gzclose( $zp );
        if (empty($dest)) return $data;
        elseif (file_put_contents($dest, $data)) return true;
        return false;
    }
And my code was bugged, and runned the func for like 15k times, but it was fun

Posted: Sun Aug 29, 2010 8:01 am
by laz0r
It's really easy under Mac OS - it will do all the unarchiving at once if you ask it to unarchive a file. It just meant sitting waiting for it to finish, and renaming the files every now and again (because Mac OS appends ' 2' onto the archive each iteration, and they get far too long).

Posted: Sat Oct 16, 2010 2:17 pm
by driest
Python solution:

Code: Select all

import gzip
while 1:
    f = gzip.open('doll.bin', 'rb')
    content = f.read()
    f.close()
    out = open('doll.bin', 'wb')
    out.write(content)
    out.close()

Posted: Sat Oct 16, 2010 10:48 pm
by junkpete
under mac os x you only have to click about 10 times, it automatically extraxts but stops when the filename is too long ;-)

Posted: Fri Dec 24, 2010 4:53 pm
by al_paz
i guessed the answer... first tried "babushka" and then the correct one.

Posted: Thu Mar 03, 2011 11:56 pm
by kjangwa
No way, such good solutions, this took me ages.
first copied 7z.exe and 7z.dll into sys32 so 7zip would work from cmdline then wrote this python script.
renamed doll.gz to doll1.gz

Code: Select all

import os

for i in range(1,1000):
    unzip="doll"+str(i)
    q=i+1
    name="doll"+str(q)
    
    os.system("7z e "+unzip+".gz")
    print "unzipped",unzip
    print "renamed to ",name
    os.rename(unzip, name+".gz")
I didnt realize till now that 7zip would unzip a file without a .gz extension

Posted: Mon May 16, 2011 12:32 am
by Millennium
I did it in C++ XD

Script?

Posted: Tue May 17, 2011 3:38 pm
by awf
I solved this like "mystery file" by pressing the unpack shortcut
in 7-zip until the solution was found.

Does somebody know how this .bin-packing works? I first tried
to write a script from hand to solve "mystery file" but the input
string from the file is seemingly random hex-numbers that aren't
connected to the solution obtained by 7-zip. :?

Re: Script?

Posted: Thu May 26, 2011 10:35 am
by FreeFull
awf wrote:I solved this like "mystery file" by pressing the unpack shortcut
in 7-zip until the solution was found.

Does somebody know how this .bin-packing works? I first tried
to write a script from hand to solve "mystery file" but the input
string from the file is seemingly random hex-numbers that aren't
connected to the solution obtained by 7-zip. :?
It's just simple gzip encryption

...

Posted: Sun Jul 31, 2011 9:44 am
by rain1024
Finally I got it
It's nice challenge
But seem all comment too open???

I wrote a script to get answer.

Posted: Sat Aug 06, 2011 11:06 pm
by hut
At first I did it with aunpack which is a wrapper for unpacking any kind of archives. But with each unpack, the file size got doubled... then I read the hint that it's 999 layers and I thought damn, I dont have 10^9999 GB here :(
but luckily it worked fine using gzip directly.

Posted: Tue Sep 13, 2011 4:36 pm
by bspus
Too bored to boot a live linux just for the file command
I couldn't get 7z to report the file type. Then after I solved it, I noticed it was in file-properties all along... duh!

renaming it to doll.bin.zip worked anyway. 7z does not care about the corect extension.
Then I used the following batch file

Code: Select all

@echo off

set /a counter=0

:top
ren doll.bin doll.bin.zip
7z x doll.bin.zip
del doll.bin.zip
set /a counter+=1
if %counter% LEQ 996 goto :top

:end
exit
I knew aready that it was 999 times compressed so i left a few out just in case

Posted: Tue Dec 13, 2011 1:02 pm
by Schnapphahn
bat using 7zip did it.

Posted: Wed Jan 18, 2012 12:01 am
by chc4
Used a C# 7zip wrapper dll. Came out around 10 lines long ^_^