diff --git a/games/compaq/jpegs/build.py b/games/compaq/jpegs/build.py new file mode 100755 index 0000000..9c398f6 --- /dev/null +++ b/games/compaq/jpegs/build.py @@ -0,0 +1,57 @@ +#! /usr/bin/python + +import zipfile +import pyexiv2 +import os +import random +import shutil +import tempfile +import time + +basedir = 'src' + +jpegs = os.listdir(basedir) +jpegs.append(jpegs[0]) +jpegs.append(jpegs[1]) +jpl = len(jpegs) + +payload = open('payload.zip').read() +pll = len(payload) + +chunksize = pll / jpl +chunks = [] +while payload: + chunk = pyexiv2.StringToUndefined(payload[:chunksize]) + chunks.append(chunk) + payload = payload[chunksize:] + +date_time = (2009, 8, 20, 9, 15) +seconds = 12 +ofiles = [] +for fn in jpegs: + src = open(os.path.join(basedir, fn)) + dst = tempfile.NamedTemporaryFile(prefix='img', suffix='.jpg') + shutil.copyfileobj(src, dst) + dst.flush() + + # Write exif chunk + chunk = chunks.pop(0) + i = pyexiv2.Image(dst.name) + i.readMetadata() + i['Exif.Image.0x1663'] = chunk + i.writeMetadata() + + timestamp = date_time + (seconds,) + zinfo = zipfile.ZipInfo(os.path.basename(dst.name), timestamp) + zinfo.external_attr = 0644 << 16 + ofiles.append((dst.name, dst, zinfo)) + seconds += 1 + +ofiles.sort() + +zip = zipfile.ZipFile('out.zip', 'w') +for _, f, zinfo in ofiles: + f.seek(0) + zip.writestr(zinfo, f.read()) + +print('whew!') diff --git a/games/compaq/jpegs/key b/games/compaq/jpegs/key new file mode 100644 index 0000000..4a1b0b3 --- /dev/null +++ b/games/compaq/jpegs/key @@ -0,0 +1 @@ +PEANUT BUTTER JELLY TIME diff --git a/games/compaq/jpegs/key.gif b/games/compaq/jpegs/key.gif new file mode 100644 index 0000000..ed6d5b2 Binary files /dev/null and b/games/compaq/jpegs/key.gif differ diff --git a/puzzles/compaq/100/mom.jpg b/puzzles/compaq/100/aacaaebb0cd0503e7bad97c42321a738 similarity index 100% rename from puzzles/compaq/100/mom.jpg rename to puzzles/compaq/100/aacaaebb0cd0503e7bad97c42321a738 diff --git a/puzzles/compaq/1000/1d45b460b5844d0d769ca469f7b5bdc7 b/puzzles/compaq/1000/1d45b460b5844d0d769ca469f7b5bdc7 new file mode 100644 index 0000000..fbf0b16 Binary files /dev/null and b/puzzles/compaq/1000/1d45b460b5844d0d769ca469f7b5bdc7 differ diff --git a/puzzles/compaq/1000/key b/puzzles/compaq/1000/key new file mode 100644 index 0000000..4a1b0b3 --- /dev/null +++ b/puzzles/compaq/1000/key @@ -0,0 +1 @@ +PEANUT BUTTER JELLY TIME diff --git a/puzzles/compaq/200/a.out b/puzzles/compaq/200/a6bcc9cff02efe6ae870e422014ee8c2 similarity index 100% rename from puzzles/compaq/200/a.out rename to puzzles/compaq/200/a6bcc9cff02efe6ae870e422014ee8c2 diff --git a/puzzles/compaq/300/dad.jpg b/puzzles/compaq/300/936bc08007a9076673a81040024728be similarity index 100% rename from puzzles/compaq/300/dad.jpg rename to puzzles/compaq/300/936bc08007a9076673a81040024728be diff --git a/puzzles/compaq/400/a.out b/puzzles/compaq/400/d56b7cb684b7d5137cbf7980b4e4a68f similarity index 100% rename from puzzles/compaq/400/a.out rename to puzzles/compaq/400/d56b7cb684b7d5137cbf7980b4e4a68f diff --git a/puzzles/compaq/500/a.out b/puzzles/compaq/500/02cb1e1d65a68b29ac851936c9bb4684 similarity index 100% rename from puzzles/compaq/500/a.out rename to puzzles/compaq/500/02cb1e1d65a68b29ac851936c9bb4684