Skip to content

Instantly share code, notes, and snippets.

@zorix
Created October 5, 2017 23:06
Show Gist options
  • Select an option

  • Save zorix/ec1fa7f128e8f70395ade65f5584e8af to your computer and use it in GitHub Desktop.

Select an option

Save zorix/ec1fa7f128e8f70395ade65f5584e8af to your computer and use it in GitHub Desktop.
Rozwiązanie do misji 12 - https://www.youtube.com/watch?v=R9iLVrldsZ0
import itertools
import string
import zlib
print "START!"
#extrected CRC for all files from zip file
crcs = [2052753413, 1113988531, 110572445, 3531532864, 2044948426, 1259702269,
2791285457, 866085692, 80487387, 3991321359, 3808665081, 3058506935,
3110191185, 3078787955, 1525006434, 501092716, 3982160619, 1058723290,
991174988, 3060760631, 2394769374, 1350633220, 236986140, 2657877971]
for x in itertools.product(string.printable, repeat=4):
x = ''.join(x)
crc = zlib.crc32(x) % (1<<32)
if crc in crcs:
print crcs.index(crc), x
for x in string.printable:
crc = zlib.crc32(x) % (1<<32)
if crc in crcs:
print crcs.index(crc), x
"""
START!
33 !
6 away
20 d yo
14 for
3 have
8 h it
17 ling
16 medd
13 n't
19 s an
5 ten
2 uld
21 ur C
12 were
15 you
0 And
1 I wo
22 RC32
10 , if
4 got
11 it
18 kid
9 too
7 wit
And I would have gotten away with it too, if it weren't for you meddling kids and your CRC32!
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment