Skip to content

Instantly share code, notes, and snippets.

Created October 19, 2016 13:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/41fa9fb30365edee081282d64eb29039 to your computer and use it in GitHub Desktop.
Save anonymous/41fa9fb30365edee081282d64eb29039 to your computer and use it in GitHub Desktop.
PKàSI7b╤mû╗ instructionsmÆ┴n█0 å∩·▄⌐@╨&÷£á═n├Ç┤╜φ░-╙╢Y$z^÷⌠ú¼+░╛Φ╖° )╛ÉsⁿΘ÷µ÷µ╟hΦ'#ü├$0
p┐
fDτ╚┤àk┼▓¬I($hI╧█l⌡6¢g╕≥ßäåZµ ╠ëó╟ë6╜sΓ⌠ ºαΦª+ä╚╜uöú╧úHH_v╗eY╢²▀Ω¡ßi≈ì"DG⌐:Cb¡{3-à∩ ö╧σkΣ;░┬p╛\φO
φl]ùdε√ç≤D▌zo╛z7┘√╙¿╬8<Uuc¬╢┴ª⌐╗²íφƒÄç║«÷d║πXW▌c▀≈j»╨┘╬▀ $╝┬2Z3║üúòq╩╨sR╟v^'¬í╙£41½σr ∞ 0ü⌡Yz├(C╪g╨oæP₧m0∞¡╖~(Å4jk»S╩,èPT,╣e╠r£E╥ÿ¿╟╗an¥5YNd"II=Σ╘∩£ñ∞Æ⌡.i!ôórLy.╪┌±`=║K8╖Z65lÿ;p│╣Φ╩■PK?àSI7b╤mû╗ $ instructions
╓^⌠k*╥»7⌠k*╥ìÄ╘k*╥PK^└
@igerasymchuk
Copy link

thinking... but have no idea yet :(

@igerasymchuk
Copy link

This is a corrupted zip file, can't recover it :(

@pidorUeban
Copy link

хуйня ебаная

@zaccharles
Copy link

Sorry, it seems GitHub has corrupted this file. Please use this link instead: https://gist.github.com/zaccharles/35bd87b1ce7655f35126ae38b8bd631b

@zaccharles
Copy link

@eXhausted
Copy link

@zaccharles вы что шутите? я сутки убил на ваш архив чтоб узнать что он поломан?

@mkramskoy
Copy link

@zaccharles, 2 sleepless nights with zip format documentation and hex editor...

@igerasymchuk
Copy link

@mkramskoy same thing :( @zaccharles my first comment here 22 hours ago. I spent many hours to fix this zip :( installed a lot of zip repairs, hex editor and more... and now I'm only third with correct answer :( life is unfair...

@zaccharles
Copy link

@eXhausted @mkramskoy @igerasymchuk

I'm sorry guys, but here's your second chance to not waste your work. I used a library to create the original Gist. Obviously, it didn't work as expected.

The broken ZIP has 898 bytes. The working one has 564 bytes. I think all the data is still there. The first one to prove it, and provide a script which takes the broken ZIP and produces the working ZIP, will get guaranteed a ticket. If this is possible, I imagine the script will work on any ZIP that has been broken in the same way. If it's not possible, maybe you can prove it's not.

This is optional, and in any case, you're all still in the draw for the 3 remaining tickets (2, if someone gets this right).

Here's a hint. I used this library: https://github.com/defunkt/gist

@mkramskoy
Copy link

When I'm trying to upload the correct zip file using this "gist" lib I get this

$ gist last-steps-correct
Error: Got Net::HTTPBadRequest from gist: {"message":"Problems parsing JSON","documentation_url":"https://developer.github.com/v3/gists/#create-a-gist"}

It works with other text files thought, like this
And the difference between correct and corrupted bin is 548 bytes, which isn't recoverable. So I can't replicate the problem and also can't recover it by removing garbage. I can dig into the library of course, but this game proved to be not very fun, so I guess the best decision is to exit from it.

@igerasymchuk I was on your hex editing stage two days ago, like 3 or 5 hours from this quiz was up :)

@mkramskoy
Copy link

Looks like it puts the file into JSON string and it brakes everything. Have no idea how you managed to upload it using this tool :D

@zaccharles
Copy link

Please tag me when you comment to me. Because this is an anonymous gist I don't get notifications :(

C:\Temp\comp>gist last-steps
https://gist.github.com/c6b26792847aed4f4475c6b6d98c30a5

C:\Temp\comp>ruby --version
ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

@zaccharles
Copy link

@igerasymchuk
Copy link

@igerasymchuk I was on your hex editing stage two days ago, like 3 or 5 hours from this quiz was up :)
@mkramskoy you have more patience than me :) I almost gave up

@igerasymchuk
Copy link

@zaccharles Ok, I created simple console converter. It can convert "wrong" file from "normal" one. I've tested it on "last-steps" files. The file size and content are same after conversion. The problem is in ASCII8bit to UTF8 conversion. Each symbol with dec code 128 and higher converted to 2bytes. Unfortunately I have no idea how to determine wrong bytes and convert it back :( I guess that this task has no solution. Console app https://dl.dropboxusercontent.com/u/933318/challenge.exe Simply add fileName as a parameter and program creates foo.txt file

@igerasymchuk
Copy link

igerasymchuk commented Oct 21, 2016

C# code
class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
var fileName = args[0];
byte[] bytes = File.ReadAllBytes(fileName);
byte[] arrBytes = Encoding.UTF8.GetBytes(ASCII8ToString(bytes));
File.WriteAllBytes("foo.txt", arrBytes);
}
else Console.Write("File not found!");
}
static string ASCII8ToString(byte[] ASCIIData)
{
var e = Encoding.GetEncoding("437");
return e.GetString(ASCIIData);
}
}

@zaccharles
Copy link

@igerasymchuk it does have a solution and you're very close.

@igerasymchuk
Copy link

@zaccharles Finally I fix it (with a little help of my friend :) The new converter is ready to download https://dl.dropboxusercontent.com/u/933318/gistfix.exe

    static void Main(string[] args)
    {
        if (args.Length > 0)
        {
            var fileName = args[0];
            var content = File.ReadAllText(fileName);
            var encoding = Encoding.GetEncoding(437);
            var bytes = encoding.GetBytes(content);
            File.WriteAllBytes("repaired.zip", bytes);
        }
        else Console.Write("File not found!");
    }

@zaccharles
Copy link

Woohoo! It's correct :D :shipit:

@eXhausted
Copy link

@zaccharles @igerasymchuk try another archive :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment