mirror of https://github.com/dirtbags/moth.git
Add a few more sequence puzzles
This commit is contained in:
parent
7aced93118
commit
10077e3fe4
|
@ -0,0 +1,2 @@
|
||||||
|
install: generate.py salad.jpg
|
||||||
|
./generate.py salad.jpg > $(DESTDIR)/blob
|
|
@ -0,0 +1,37 @@
|
||||||
|
#! /usr/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import struct
|
||||||
|
import random
|
||||||
|
|
||||||
|
class Container:
|
||||||
|
def __init__(self):
|
||||||
|
self.contents = []
|
||||||
|
|
||||||
|
def add(self, opcode, subcode, part, text):
|
||||||
|
hdr = struct.pack('!BBHH',
|
||||||
|
opcode, subcode, part,
|
||||||
|
len(text))
|
||||||
|
self.contents.append(hdr + text)
|
||||||
|
random.shuffle(self.contents)
|
||||||
|
|
||||||
|
def bytes(self):
|
||||||
|
body = b''.join(self.contents)
|
||||||
|
hdr = struct.pack('!LHL',
|
||||||
|
0xB00FB00F,
|
||||||
|
2,
|
||||||
|
len(body))
|
||||||
|
return hdr + body
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
c = Container()
|
||||||
|
s = open(sys.argv[1], 'rb')
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
b = s.read(3150)
|
||||||
|
if not b:
|
||||||
|
break
|
||||||
|
c.add(5, 8, i, b)
|
||||||
|
i += 1
|
||||||
|
sys.stdout.buffer.write(c.bytes())
|
|
@ -1,7 +1 @@
|
||||||
00000000 ff 41 42 43 44 45 46 47 48 ff 49 4a 4b 4c 4d 4e |.ABCDEFGH.IJKLMN|
|
This time, you can run the `hd` program on your own.
|
||||||
00000010 4f 50 ff 51 52 53 54 55 56 57 58 ff 59 5a 0a 54 |OP.QRSTUVWX.YZ.T|
|
|
||||||
00000020 68 65 20 72 6f 61 69 6e 20 11 00 53 70 10 01 7f |he roain ..Sp...|
|
|
||||||
00000030 73 74 61 79 73 20 6d 10 00 6b 6c 79 13 01 74 0c |stays m..kly..t.|
|
|
||||||
00000040 00 70 6c 10 00 df 2c 20 61 6e 64 2c 02 61 6e ff |.pl..., and,.an.|
|
|
||||||
00000050 73 77 65 72 20 69 73 20 cd 22 31 00 6e 65 21 03 |swer is ."1.ne!.|
|
|
||||||
00000060 1d 01 22 2e 01 0a |.."...|
|
|
|
@ -1 +1 @@
|
||||||
planes mainstay
|
enjoy delicious salad
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 140 KiB |
|
@ -0,0 +1,7 @@
|
||||||
|
00000000 ff 41 42 43 44 45 46 47 48 ff 49 4a 4b 4c 4d 4e |.ABCDEFGH.IJKLMN|
|
||||||
|
00000010 4f 50 ff 51 52 53 54 55 56 57 58 ff 59 5a 0a 54 |OP.QRSTUVWX.YZ.T|
|
||||||
|
00000020 68 65 20 72 6f 61 69 6e 20 11 00 53 70 10 01 7f |he roain ..Sp...|
|
||||||
|
00000030 73 74 61 79 73 20 6d 10 00 6b 6c 79 13 01 74 0c |stays m..kly..t.|
|
||||||
|
00000040 00 70 6c 10 00 df 2c 20 61 6e 64 2c 02 61 6e ff |.pl..., and,.an.|
|
||||||
|
00000050 73 77 65 72 20 69 73 20 cd 22 31 00 6e 65 21 03 |swer is ."1.ne!.|
|
||||||
|
00000060 1d 01 22 2e 01 0a |.."...|
|
|
@ -0,0 +1 @@
|
||||||
|
planes mainstay
|
|
@ -1,25 +1,34 @@
|
||||||
00000000 01 01 fe 43 61 6c 6c 20 6d 65 20 49 73 68 6d 61
|
00000000 b0 0f b0 0f 00 02 00 00 65 51 05 01 00 00 0f 8e |····␀·␀␀eQ··␀␀··|
|
||||||
00000010 65 6c 2e 20 53 6f 6d 65 20 79 65 61 72 73 20 61
|
00000010 ff d8 ff e0 00 10 4a 46 49 46 00 01 02 00 00 64 |····␀·JFIF␀··␀␀d|
|
||||||
00000020 67 6f e2 80 94 6e 65 76 65 72 20 6d 69 6e 64 20
|
00000020 00 64 00 00 ff ec 00 11 44 75 63 6b 79 00 01 00 |␀d␀␀··␀·Ducky␀·␀|
|
||||||
00000030 68 6f 77 20 6c 6f 6e 67 20 70 72 65 63 69 73 65
|
00000030 04 00 00 00 3c 00 00 ff ee 00 0e 41 64 6f 62 65 |·␀␀␀<␀␀··␀·Adobe|
|
||||||
00000040 6c 79 e2 80 94 68 61 76 69 6e 67 20 6c 69 74 74
|
00000040 00 64 c0 00 00 00 01 ff db 00 84 00 06 04 04 04 |␀d·␀␀␀···␀·␀····|
|
||||||
00000050 6c 65 20 6f 72 20 6e 6f 20 6d 6f 6e 65 79 20 69
|
00000050 05 04 06 05 05 06 09 06 05 06 09 0b 08 06 06 08 |················|
|
||||||
00000060 6e 20 6d 79 20 70 75 72 73 65 2c 20 61 6e 64 20
|
00000060 0b 0c 0a 0a 0b 0a 0a 0c 10 0c 0c 0c 0c 0c 0c 10 |··␊␊·␊␊·········|
|
||||||
00000070 6e 6f 74 68 69 6e 67 20 70 61 72 74 69 63 75 6c
|
00000070 0c 0e 0f 10 0f 0e 0c 13 13 14 14 13 13 1c 1b 1b |················|
|
||||||
00000080 61 72 20 9a 01 02 fd 74 6f 20 69 6e 74 65 72 65
|
00000080 1b 1c 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 01 07 07 07 |················|
|
||||||
00000090 73 74 20 6d 65 20 6f 6e 20 73 68 6f 72 65 2c 20
|
00000090 0d 0c 0d 18 10 10 18 1a 15 11 15 1a 1f 1f 1f 1f |␍·␍·············|
|
||||||
000000a0 49 20 74 68 6f 75 67 68 74 20 49 20 77 6f 75 6c
|
000000a0 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |················|
|
||||||
000000b0 64 20 73 61 69 6c 20 61 62 6f 75 74 20 61 20 6c
|
*
|
||||||
000000c0 69 74 74 6c 65 20 61 6e 64 20 73 65 65 20 74 68
|
00000f90 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 05 01 |················|
|
||||||
000000d0 65 20 77 61 74 65 72 79 20 70 61 72 74 20 6f 66
|
00000fa0 00 00 0f 8e 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |␀␀··············|
|
||||||
000000e0 20 74 68 65 20 77 6f 72 6c 64 2e 20 49 74 20 69
|
00000fb0 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |················|
|
||||||
000000f0 73 20 61 20 77 61 79 20 49 20 68 61 76 65 20 6f
|
*
|
||||||
00000100 66 20 64 72 69 76 69 db 01 03 fc 6e 67 20 6f 66
|
00001f30 1f 1f 05 01 00 01 0f 8e 1f 1f 1f 1f 1f 1f 1f 1f |····␀···········|
|
||||||
00000110 66 20 74 68 65 20 73 70 6c 65 65 6e 20 61 6e 64
|
00001f40 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |················|
|
||||||
00000120 20 72 65 67 75 6c 61 74 69 6e 67 20 74 68 65 20
|
*
|
||||||
00000130 63 69 72 63 75 6c 61 74 69 6f 6e 2e 20 57 68 65
|
00002ec0 1f 1f 1f 1f 1f 1f 05 01 00 02 0f 8e 1f 1f 1f 1f |········␀·······|
|
||||||
00000140 6e 65 76 65 72 20 49 20 66 69 6e 64 20 6d 79 73
|
00002ed0 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |················|
|
||||||
00000150 65 6c 66 20 67 72 6f 77 69 6e 67 20 67 72 69 6d
|
*
|
||||||
00000160 20 61 62 6f 75 74 20 74 68 65 20 6d 6f 75 74 68
|
00003e50 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 05 01 00 03 0f 8e |············␀···|
|
||||||
00000170 3b 20 77 68 65 6e 65 76 65 72 20 69 74 20 69 73
|
00003e60 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |················|
|
||||||
00000180 20 61 20 64 61 6d 70 2c 20 64 72 59 __ __ __ 69
|
*
|
||||||
|
00004de0 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 05 01 |················|
|
||||||
|
00004df0 00 04 0f 8e 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |␀···············|
|
||||||
|
00004e00 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |················|
|
||||||
|
*
|
||||||
|
00005d80 1f 1f __ __ __ __ __ __ 1f 1f 1f 1f 1f 1f 1f 1f |··◌◌◌◌◌◌········|
|
||||||
|
00005d90 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |················|
|
||||||
|
*
|
||||||
|
00006550 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f 1f |···········|
|
||||||
|
0000655b
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
01 04 fb
|
05 01 00 05 07 d3
|
||||||
01 04 FB
|
05 01 00 05 07 D3
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
00000000 01 01 fe 43 61 6c 6c 20 6d 65 20 49 73 68 6d 61
|
||||||
|
00000010 65 6c 2e 20 53 6f 6d 65 20 79 65 61 72 73 20 61
|
||||||
|
00000020 67 6f e2 80 94 6e 65 76 65 72 20 6d 69 6e 64 20
|
||||||
|
00000030 68 6f 77 20 6c 6f 6e 67 20 70 72 65 63 69 73 65
|
||||||
|
00000040 6c 79 e2 80 94 68 61 76 69 6e 67 20 6c 69 74 74
|
||||||
|
00000050 6c 65 20 6f 72 20 6e 6f 20 6d 6f 6e 65 79 20 69
|
||||||
|
00000060 6e 20 6d 79 20 70 75 72 73 65 2c 20 61 6e 64 20
|
||||||
|
00000070 6e 6f 74 68 69 6e 67 20 70 61 72 74 69 63 75 6c
|
||||||
|
00000080 61 72 20 9a 01 02 fd 74 6f 20 69 6e 74 65 72 65
|
||||||
|
00000090 73 74 20 6d 65 20 6f 6e 20 73 68 6f 72 65 2c 20
|
||||||
|
000000a0 49 20 74 68 6f 75 67 68 74 20 49 20 77 6f 75 6c
|
||||||
|
000000b0 64 20 73 61 69 6c 20 61 62 6f 75 74 20 61 20 6c
|
||||||
|
000000c0 69 74 74 6c 65 20 61 6e 64 20 73 65 65 20 74 68
|
||||||
|
000000d0 65 20 77 61 74 65 72 79 20 70 61 72 74 20 6f 66
|
||||||
|
000000e0 20 74 68 65 20 77 6f 72 6c 64 2e 20 49 74 20 69
|
||||||
|
000000f0 73 20 61 20 77 61 79 20 49 20 68 61 76 65 20 6f
|
||||||
|
00000100 66 20 64 72 69 76 69 db 01 03 fc 6e 67 20 6f 66
|
||||||
|
00000110 66 20 74 68 65 20 73 70 6c 65 65 6e 20 61 6e 64
|
||||||
|
00000120 20 72 65 67 75 6c 61 74 69 6e 67 20 74 68 65 20
|
||||||
|
00000130 63 69 72 63 75 6c 61 74 69 6f 6e 2e 20 57 68 65
|
||||||
|
00000140 6e 65 76 65 72 20 49 20 66 69 6e 64 20 6d 79 73
|
||||||
|
00000150 65 6c 66 20 67 72 6f 77 69 6e 67 20 67 72 69 6d
|
||||||
|
00000160 20 61 62 6f 75 74 20 74 68 65 20 6d 6f 75 74 68
|
||||||
|
00000170 3b 20 77 68 65 6e 65 76 65 72 20 69 74 20 69 73
|
||||||
|
00000180 20 61 20 64 61 6d 70 2c 20 64 72 59 __ __ __ 69
|
|
@ -0,0 +1,2 @@
|
||||||
|
01 04 fb
|
||||||
|
01 04 FB
|
|
@ -0,0 +1,86 @@
|
||||||
|
#! /usr/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import struct
|
||||||
|
import random
|
||||||
|
stdch = ('␀·········␊··␍··'
|
||||||
|
'················'
|
||||||
|
' !"#$%&\'()*+,-./'
|
||||||
|
'0123456789:;<=>?'
|
||||||
|
'@ABCDEFGHIJKLMNO'
|
||||||
|
'PQRSTUVWXYZ[\]^_'
|
||||||
|
'`abcdefghijklmno'
|
||||||
|
'pqrstuvwxyz{|}~·'
|
||||||
|
'················'
|
||||||
|
'················'
|
||||||
|
'················'
|
||||||
|
'················'
|
||||||
|
'················'
|
||||||
|
'················'
|
||||||
|
'················'
|
||||||
|
'················')
|
||||||
|
|
||||||
|
def hexdump(buf, fd=sys.stdout, charset=stdch):
|
||||||
|
offset = 0
|
||||||
|
last = None
|
||||||
|
elided = False
|
||||||
|
for offset in range(0, len(buf), 16):
|
||||||
|
l = buf[offset:offset+16]
|
||||||
|
|
||||||
|
if l == last:
|
||||||
|
if not elided:
|
||||||
|
fd.write("*\n")
|
||||||
|
elided = True
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
last = l
|
||||||
|
elided = False
|
||||||
|
|
||||||
|
pad = 16-len(l)
|
||||||
|
|
||||||
|
hx = []
|
||||||
|
for b in l:
|
||||||
|
hx.append('%02x' % b)
|
||||||
|
hx += [' '] * pad
|
||||||
|
|
||||||
|
fd.write('%08x ' % offset)
|
||||||
|
fd.write(' '.join(hx[:8]))
|
||||||
|
fd.write(' ')
|
||||||
|
fd.write(' '.join(hx[8:]))
|
||||||
|
fd.write(' |')
|
||||||
|
fd.write(''.join(charset[b] for b in l))
|
||||||
|
fd.write('|\n')
|
||||||
|
fd.write('%08x\n' % len(buf))
|
||||||
|
|
||||||
|
|
||||||
|
class Container:
|
||||||
|
def __init__(self):
|
||||||
|
self.contents = []
|
||||||
|
|
||||||
|
def add(self, opcode, subcode, part, text):
|
||||||
|
hdr = struct.pack('!BBHH',
|
||||||
|
opcode, subcode, part,
|
||||||
|
len(text))
|
||||||
|
self.contents.append(hdr + text)
|
||||||
|
random.shuffle(self.contents)
|
||||||
|
|
||||||
|
def bytes(self):
|
||||||
|
body = b''.join(self.contents)
|
||||||
|
hdr = struct.pack('!LHL',
|
||||||
|
0xB00FB00F,
|
||||||
|
2,
|
||||||
|
len(body))
|
||||||
|
return hdr + body
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
c = Container()
|
||||||
|
s = open('salad.jpg', 'rb')
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
b = s.read(3150)
|
||||||
|
if not b:
|
||||||
|
break
|
||||||
|
c.add(5, 8, i, b)
|
||||||
|
i += 1
|
||||||
|
hexdump(c.bytes())
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
||||||
|
05 08 00 08 04 99
|
Loading…
Reference in New Issue