This commit is contained in:
Roman Hergenreder 2018-12-07 13:52:13 +01:00
parent 1b071a46e8
commit aa56104b3f
54 changed files with 684 additions and 1086 deletions

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Piet'ers Gallery</title>
<link rel="stylesheet" href="Piet'ers%20Gallery_files/bootstrap.css">
<link href="Piet'ers%20Gallery_files/css.css" rel="stylesheet">
<link rel="stylesheet" href="Piet'ers%20Gallery_files/baguetteBox.css">
<link rel="stylesheet" href="Piet'ers%20Gallery_files/styles.css">
</head>
<body>
<div class="container gallery-container">
<h1>Piet'ers Gallery</h1>
<p class="page-description text-center">We currently don't plan on selling any artwork!</p>
<div class="tz-gallery">
<div class="row">
<div class="col-sm-6 col-md-4">
<a class="lightbox" href="https://hackvent.hacking-lab.com/Mondrian-Gallery/img/house.png">
<img src="Piet'ers%20Gallery_files/house.png" alt="House">
<p style="color:grey;">"House" - 3200$</p>
</a>
</div>
<div class="col-sm-6 col-md-4">
<a class="lightbox" href="https://hackvent.hacking-lab.com/Mondrian-Gallery/img/trees.png">
<img src="Piet'ers%20Gallery_files/trees.png" alt="Trees">
<p style="color:grey;">"Trees" - 4200$</p>
</a>
</div>
<div class="col-sm-6 col-md-4">
<a class="lightbox" href="https://hackvent.hacking-lab.com/Mondrian-Gallery/img/lake.png">
<img src="Piet'ers%20Gallery_files/lake.png" alt="lake">
<p style="color:grey;">Lake" - 8500$</p>
</a>
</div>
<div class="col-sm-6 col-md-4">
<a class="lightbox" href="https://hackvent.hacking-lab.com/Mondrian-Gallery/img/sky.png">
<img src="Piet'ers%20Gallery_files/sky.png" alt="Sky">
<p style="color:grey;">"Sky" - 5000$</p>
</a>
</div>
<div class="col-sm-6 col-md-4">
<a class="lightbox" href="https://hackvent.hacking-lab.com/Mondrian-Gallery/img/sheep.png">
<img src="Piet'ers%20Gallery_files/sheep.png" alt="Sheep">
<p style="color:grey;">"Sheep" - 4030$</p>
</a>
</div>
<div class="col-sm-6 col-md-4">
<a class="lightbox" href="https://hackvent.hacking-lab.com/Mondrian-Gallery/img/snake.png">
<img src="Piet'ers%20Gallery_files/snake.png" alt="Snake">
<p style="color:grey;">"Snake" - 6030$</p>
</a>
</div>
</div>
</div>
</div>
<script src="Piet'ers%20Gallery_files/baguetteBox.js"></script>
<script>
baguetteBox.run('.tz-gallery');
</script><div role="dialog" id="baguetteBox-overlay" style="background-color: rgba(0, 0, 0, 0.8); display: none;" aria-labelledby="baguetteBox-figure-0 baguetteBox-figure-1 baguetteBox-figure-2 baguetteBox-figure-3 baguetteBox-figure-4 baguetteBox-figure-5" aria-describedby="baguetteBox-figcaption-0 baguetteBox-figcaption-1 baguetteBox-figcaption-2 baguetteBox-figcaption-3 baguetteBox-figcaption-4 baguetteBox-figcaption-5" class=""><div id="baguetteBox-slider" style="transform: translate3d(-300%, 0px, 0px);"><div class="full-image" id="baguette-img-0"></div><div class="full-image" id="baguette-img-1"><figure id="baguetteBox-figure-1"><img src="Piet'ers%20Gallery_files/trees.png" alt="Trees"></figure></div><div class="full-image" id="baguette-img-2"><figure id="baguetteBox-figure-2"><img src="Piet'ers%20Gallery_files/lake.png" alt="lake"></figure></div><div class="full-image" id="baguette-img-3"><figure id="baguetteBox-figure-3"><img src="Piet'ers%20Gallery_files/sky.png" alt="Sky"></figure></div><div class="full-image" id="baguette-img-4"><figure id="baguetteBox-figure-4"><img src="Piet'ers%20Gallery_files/sheep.png" alt="Sheep"></figure></div><div class="full-image" id="baguette-img-5"><figure id="baguetteBox-figure-5"><img src="Piet'ers%20Gallery_files/snake.png" alt="Snake"></figure></div></div><button type="button" id="previous-button" aria-label="Previous" class="baguetteBox-button"><svg width="44" height="60"><polyline points="30 10 10 30 30 50" stroke="rgba(255,255,255,0.5)" stroke-width="4" stroke-linecap="butt" fill="none" stroke-linejoin="round"></polyline></svg></button><button type="button" id="next-button" aria-label="Next" class="baguetteBox-button"><svg width="44" height="60"><polyline points="14 10 34 30 14 50" stroke="rgba(255,255,255,0.5)" stroke-width="4" stroke-linecap="butt" fill="none" stroke-linejoin="round"></polyline></svg></button><button type="button" id="close-button" aria-label="Close" class="baguetteBox-button"><svg width="30" height="30"><g stroke="rgb(160,160,160)" stroke-width="4"><line x1="5" y1="5" x2="25" y2="25"></line><line x1="5" y1="25" x2="25" y2="5"></line></g></svg></button></div>
<script src="Piet'ers%20Gallery_files/script.js"></script>
</body></html>
<!-- Mady with <3 by https://twitter.com/xorkiwi -->

@ -0,0 +1,6 @@
/*!
* baguetteBox.js
* @author feimosi
* @version 1.8.1
* @url https://github.com/feimosi/baguetteBox.js
*/#baguetteBox-overlay{display:none;opacity:0;position:fixed;overflow:hidden;top:0;left:0;width:100%;height:100%;z-index:1000000;background-color:#222;background-color:rgba(0,0,0,.8);-webkit-transition:opacity .5s ease;transition:opacity .5s ease}#baguetteBox-overlay.visible{opacity:1}#baguetteBox-overlay .full-image{display:inline-block;position:relative;width:100%;height:100%;text-align:center}#baguetteBox-overlay .full-image figure{display:inline;margin:0;height:100%}#baguetteBox-overlay .full-image img{display:inline-block;width:auto;height:auto;max-height:100%;max-width:100%;vertical-align:middle;-moz-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}#baguetteBox-overlay .full-image figcaption{display:block;position:absolute;bottom:0;width:100%;text-align:center;line-height:1.8;white-space:normal;color:#ccc;background-color:#000;background-color:rgba(0,0,0,.6);font-family:sans-serif}#baguetteBox-overlay .full-image:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#baguetteBox-slider{position:absolute;left:0;top:0;height:100%;width:100%;white-space:nowrap;-webkit-transition:left .4s ease,-webkit-transform .4s ease;transition:left .4s ease,-webkit-transform .4s ease;transition:left .4s ease,transform .4s ease;transition:left .4s ease,transform .4s ease,-webkit-transform .4s ease,-moz-transform .4s ease}#baguetteBox-slider.bounce-from-right{-webkit-animation:bounceFromRight .4s ease-out;animation:bounceFromRight .4s ease-out}#baguetteBox-slider.bounce-from-left{-webkit-animation:bounceFromLeft .4s ease-out;animation:bounceFromLeft .4s ease-out}@-webkit-keyframes bounceFromRight{0%,100%{margin-left:0}50%{margin-left:-30px}}@keyframes bounceFromRight{0%,100%{margin-left:0}50%{margin-left:-30px}}@-webkit-keyframes bounceFromLeft{0%,100%{margin-left:0}50%{margin-left:30px}}@keyframes bounceFromLeft{0%,100%{margin-left:0}50%{margin-left:30px}}.baguetteBox-button#next-button,.baguetteBox-button#previous-button{top:50%;top:calc(50% - 30px);width:44px;height:60px}.baguetteBox-button{position:absolute;cursor:pointer;outline:0;padding:0;margin:0;border:0;-moz-border-radius:15%;border-radius:15%;background-color:#323232;background-color:rgba(50,50,50,.5);color:#ddd;font:1.6em sans-serif;-webkit-transition:background-color .4s ease;transition:background-color .4s ease}.baguetteBox-button:focus,.baguetteBox-button:hover{background-color:rgba(50,50,50,.9)}.baguetteBox-button#next-button{right:2%}.baguetteBox-button#previous-button{left:2%}.baguetteBox-button#close-button{top:20px;right:2%;right:calc(2% + 6px);width:30px;height:30px}.baguetteBox-button svg{position:absolute;left:0;top:0}.baguetteBox-spinner{width:40px;height:40px;display:inline-block;position:absolute;top:50%;left:50%;margin-top:-20px;margin-left:-20px}.baguetteBox-double-bounce1,.baguetteBox-double-bounce2{width:100%;height:100%;-moz-border-radius:50%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:bounce 2s infinite ease-in-out;animation:bounce 2s infinite ease-in-out}.baguetteBox-double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes bounce{0%,100%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounce{0%,100%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,16 @@
/* latin */
@font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: 400;
src: local('Droid Sans Regular'), local('DroidSans-Regular'), url(https://fonts.gstatic.com/s/droidsans/v8/SlGVmQWMvZQIdix7AFxXkHNSbQ.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: 700;
src: local('Droid Sans Bold'), local('DroidSans-Bold'), url(https://fonts.gstatic.com/s/droidsans/v8/SlGWmQWMvZQIdix7AFxXmMh3eDs1Zw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@ -0,0 +1 @@
var _0x4ec1=['\x6c\x6f\x67','\x53\x75\x63\x68\x20\x68\x61\x78\x78\x6f\x72\x20\x2d\x20\x6d\x75\x63\x68\x20\x31\x33\x33\x37\x21'];var _0x1a98=function(_0x35db43,_0x135584){_0x35db43=_0x35db43-0x0;var _0x292945=_0x4ec1[_0x35db43];return _0x292945;};console[_0x1a98('0x0')](_0x1a98('0x1'));

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@ -0,0 +1,86 @@
body {
background-color: #434c50;
min-height: 100vh;
font: normal 16px sans-serif;
padding: 40px 0;
}
.container.gallery-container {
background-color: #fff;
color: #35373a;
min-height: 100vh;
padding: 30px 50px;
}
.gallery-container h1 {
text-align: center;
margin-top: 50px;
font-family: 'Droid Sans', sans-serif;
font-weight: bold;
}
.gallery-container p.page-description {
text-align: center;
margin: 25px auto;
font-size: 18px;
color: #999;
}
.tz-gallery {
padding: 40px;
}
/* Override bootstrap column paddings */
.tz-gallery .row > div {
padding: 2px;
}
.tz-gallery .lightbox img {
width: 100%;
border-radius: 0;
position: relative;
}
.tz-gallery .lightbox:before {
position: absolute;
top: 50%;
left: 50%;
margin-top: -13px;
margin-left: -13px;
opacity: 0;
color: #fff;
font-size: 26px;
font-family: 'Glyphicons Halflings';
content: '\e003';
pointer-events: none;
z-index: 9000;
transition: 0.4s;
}
.tz-gallery .lightbox:after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
background-color: rgba(46, 132, 206, 0.7);
content: '';
transition: 0.4s;
}
.tz-gallery .lightbox:hover:after,
.tz-gallery .lightbox:hover:before {
opacity: 0;
}
.baguetteBox-button {
background-color: transparent !important;
}
@media(max-width: 768px) {
body {
padding: 0;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

228
Day 6/decode.py Normal file

@ -0,0 +1,228 @@
#!/usr/bin/python
from PIL import Image
import math
import numpy
def to24Bit(data):
red = (data >> 5) * 32;
green = ((data & 28) >> 2) * 32;
blue = (data & 3) * 64;
return [red, green, blue]
def to8Bit(pixel):
# return (math.floor((pixel[0] / 32)) << 5) + (math.floor((pixel[1] / 32)) << 2) + math.floor((pixel[2] / 64))
return (pixel[0] * 7 // 255) << 5 + (pixel[1] * 7 // 255) << 2 + (pixel[2] * 3 // 255)
images = ["house", "trees", "lake", "sky", "sheep", "snake"]
tileSize = 10
im = Image.open("Piet'ers Gallery_files/house.png")
pix = im.load()
numTiles = im.size[0] // tileSize
for y in range(im.size[1] - 2 * tileSize):
line = ""
for x in range(im.size[0] - 2 * tileSize):
x_abs = x + tileSize
y_abs = y + tileSize
pixelX = min(math.floor(x_abs / tileSize) * tileSize + 5, im.size[0] - 5)
pixelY = min(math.floor(y_abs / tileSize) * tileSize + 5, im.size[1] - 5)
pixels = [
pix[5, pixelY],
pix[im.size[0] - 5, pixelY],
pix[pixelX, 5],
pix[pixelX, im.size[1] - 5]
]
result = ((pixels[0] | pixels[1]) & (pixels[2] | pixels[3]))
pix[x_abs, y_abs] = result
for tileY in range(numTiles):
line = ""
for tileX in range(numTiles):
p = pix[tileX * tileSize + 5, tileY * tileSize + 5]
# line += "%08d " % int(bin(p)[2:])
line += chr(p)
print(line)
im.save("test.png")
# def decodePixel(x, y, tileSize):
# # x_abs = x*tileSize + tileSize // 2
# # y_abs = y*tileSize + tileSize // 2
# pixel = pix[x, y]
#
# return pixel
# return "%02d" % pixel
# r = pixel[0]
# g = pixel[1]
# b = pixel[2]
# bit8 = to8Bit(pixel)
# return colors[pixel]
# r = 1 if r == 192 else (10 if r == 255 else r)
# g = 1 if g == 192 else (10 if g == 255 else g)
# b = 1 if b == 192 else (10 if b == 255 else b)
# return "%02d%02d%02d" % (r, g, b)
# return "%02d" % pixel
# return "%08d" % int(bin(bit8)[2:])
# What to do with this pixel?
# return bin(pixel)[2:]
# return "%04d" % int(bin(pixel)[2:])
# return str(chr(ord('A') + pixel))
# return pix[x,y]
# for imageName in images:
# im = Image.open("Piet'ers Gallery_files/%s.png" % imageName)
# pix = im.load()
#
# tileSize = 10
# tilesW = im.size[0] // tileSize
# tilesH = im.size[1] // tileSize
# #
# data = []
#
# # First row
# for x in range(tilesW):
# data.append(decodePixel(x, 0, tileSize))
#
# # Column right
# for y in range(1, tilesH - 1):
# data.append(decodePixel(tilesW - 1, y, tileSize))
#
# # Row bottom
# for x in reversed(range(tilesW - 1)):
# data.append(decodePixel(x, tilesH - 1, tileSize))
#
# # Column left
# for y in reversed(range(1, tilesH - 1)):
# data.append(decodePixel(0, y, tileSize))
#
# # print(''.join(data))
# print(imageName, "\t", ' '.join(data))
# for
# im = Image.open("Piet'ers Gallery_files/lake.png")
# im = Image.open("Piet'ers Gallery_files/house_2.png")
# im = Image.frombytes('P', im.size, im.tobytes())
# for imageName in images:
# im = Image.open("Piet'ers Gallery_files/%s.png" % imageName)
# pix = im.load()
#
# tileSize = 10
# tilesW = im.size[0] // tileSize
# tilesH = im.size[1] // tileSize
# for y in range(im.size[1] - 2 * tileSize):
# line = ""
# for x in range(im.size[0] - 2 * tileSize):
# x_abs = x + tileSize
# y_abs = y + tileSize
#
# pixelX = min(math.floor(x_abs / tileSize) * tileSize + 5, im.size[0] - 5)
# pixelY = min(math.floor(y_abs / tileSize) * tileSize + 5, im.size[1] - 5)
#
# pixels = [
# pix[5, pixelY],
# pix[im.size[0] - 5, pixelY],
# pix[pixelX, 5],
# pix[pixelX, im.size[1] - 5]
# ]
#
# result = (pixels[0] ^ pixels[1] ^ pixels[2] ^ pixels[3]) % 18
# line += str(result)
#
# print(pixels)
# pixelX = 5 if (x_abs < im.size[0] // 2) else im.size[0] - 5
# pixelY = 5 if (y_abs < im.size[1] // 2) else im.size[1] - 5
# print("pixelX, pixelY", pixelX, pixelY, x, y)
# print("asdas", x, y)
# pixel1 = decodePixel(pixelX, , tileSize)
# pixel2 = decodePixel(math.floor(x_abs / tileSize) * tileSize, pixelY, tileSize)
# pix[x_abs, y_abs] = result
# print(line)
#
# im.save("%s_decoded.png" % imageName)
# data = []
#
# # First row
# for x in range(tilesW):
# data.append(decodePixel(x, 0))
#
# # Column right
# for y in range(1, tilesH - 1):
# data.append(decodePixel(tilesW - 1, y))
#
# # Row bottom
# for x in reversed(range(tilesW - 1)):
# data.append(decodePixel(x, tilesH - 1))
#
# # Column left
# for y in reversed(range(1, tilesH - 1)):
# data.append(decodePixel(0, y))
# #
# print(''.join(data))
# print(len(''.join(data)))
# for x in range(tilesW):
# data.append(decodePixel(x, 0))
# pixel = numpy.array(im)
# print(bin(pix[4*tileSize + 5,0]))
# data = [[0 for x in range(tilesW)] for y in range(tilesH)]
# for y in range(tilesH):
# line = ""
# for x in range(tilesW):
# # pixel = im.getpixel((x * tileSize + 5, y * tileSize + 5))
# pixel = pix[x * tileSize + 5, y * tileSize + 5]
# # binary = bin(pixel)[2:]
# # binaryStr = "%08d" % int(binary)
# # line += binaryStr
# # line += chr(ord('A') + pixel)
# # data[x][y] = pixel
# # line += chr(pixel)
# # print(to24Bit(int(binaryStr[::-1], 2)))
# # print(binaryStr, binary, chr(pixel))
# # str = str + binaryStr
# # str += binary
# line += "%02d" % pixel
# print(line)
# data[1][1] = data[0][1] + data[1][0]
# for x in range(1,tilesW//2 + 1):
# data[x][1] = data[0][x] | data[1][0]
# print(chr(ord('A') + data[x][1]))
# for y in range(1,tilesH):
# pixel = pix[tilesW * tileSize - 5, y * tileSize + 5]
# binary = bin(pixel)[2:]
# binaryStr = "%08d" % int(binary)
# str = str + binaryStr
#
# print(str)
#
# data = [
# [255,192,255],
# [255,0,255],
# [0,255,255]
# ]
#
# print(' '.join(["%08d" % int(bin(to8Bit(p))[2:]) for p in data]))
# print(pix[5, 15], pix[5, 25], pix[5, 35], pix[5, 45], pix[5, 55])

BIN
Day 6/decoded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
Day 6/house_decoded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
Day 6/lake_decoded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
Day 6/sheep_decoded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
Day 6/sky_decoded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
Day 6/snake_decoded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
Day 6/test.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
Day 6/trees_decoded.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

85
Day 7/code.pl Normal file

@ -0,0 +1,85 @@
use Term::ReadKey;
sub k {
ReadKey(-1) # Perform a non-blocked read
}
ReadMode 3; # Echo off, unbuffered, signals enabled, Xon/Xoff
# possibly enabled, and 8-bit mode possibly enabled.
sub rk {
$Q = '';
$Q .= $QQ while ( $QQ = k() ); $Q
}
$| = 1;
print "\ec\e[0;0r\e[4242;1H\e[6n\e[1;1H";
# ???
( $p .= $c ) until ( ( $c = k() ) eq 'R' );
$x = 75;
$dx = 3;
# idk?
( ($yy) = ( $p =~ /(\d+);/ ) ) && ( $yy -= 10 );
# Border
print( ( "\r\n\e[40m\e[37m#" . ( ' ' x 78 ) . "#" ) x 100 );
# and what is this?
$r = (
sub {
$M = shift;
sub {
$M = ( ( $M * 0x41C64E6D ) + 12345 ) & 0x7FFFFFFF;
$M % shift;
}
}
)->(42);
# What is this?
$s = (
sub {
select( $HV18, $faLL, $D33p, shift );
}
);
# Does nothing?
$INT0 ? $H3ll : $PERL;
# Nowhere used?
# hex string -> ascii -> decimal
# ascii: b'st\x0c\x128vRHq\x05WSFb\x0elUe^\x1bKkoT\x1ak-ru'
# dec: [115, 116, 12, 18, 56, 118, 82, 72, 113, 5, 87, 83, 70, 98, 14, 108, 85, 101, 94, 27, 75, 107, 111, 84, 26, 107, 45, 114, 117]
# Length: 29
@HASH = unpack( "C*", pack( "H*", '73740c12387652487105575346620e6c55655e1b4b6b6f541a6b2d7275' ));
for $i ( 0 .. 666 ) {
$s->(0.1);
print("\e[40;91m\e[${yy};${x}H.");
$dx += int( rk() =~ / /g ) * 2 - 1;
$dx = ( $dx > 3 ? 3 : ( $dx < -3 ? -3 : $dx ) );
$x += $dx;
# ( $x > 1 && $x < 80 ) || last;
( ( $i % 23 ) && print( "\e[4242;1H\n\e[40m\e[37m#" . ( ' ' x 78 ) . "#" ) )
|| (
( $h = 20 + $r->(42) )
&& (
print(
"\e[4242;1H\n\e[40m\e[37m#"
. ( ( chr( $HASH[ $i / 23 ] ^ $h ) ) x ( $h - 5 ) )
. ( " " x 10 )
. ( ( chr( $HASH[ $i / 23 ] ^ $h ) ) x ( 73 - $h ) ) . "#"
)
)
);
# ( ( $i + 13 ) % 23 ) ? 42 : ( ( abs( $x - $h ) < 6 ) || last );
print("\e[${yy};${x}H\e[41m\e[37m@");
}
# Reset Read Mode
ReadMode 1;
###################-EOF-flappy.pl###############

@ -1,914 +0,0 @@
/Artifact <</Attached [/Bottom]/Type/Pagination/Subtype/Footer>> BDC /GS6 gs
q
-0.000005282 0.00024414 595.32 841.92 re
W* n
662.3 0 0 225.65 -29.35 1.5479 cm
/Image5 Do Q
EMC /Artifact <</Attached [/Top]/Type/Pagination/Subtype/Header>> BDC q
0.000008871 0 595.32 841.92 re
W* n
BT
/F1 11.04 Tf
1 0 0 1 70.944 796.08 Tm
0 g
/GS9 gs
0 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
Q
EMC /Artifact <</Attached [/Bottom]/Type/Pagination/Subtype/Footer>> BDC q
0.000008871 0 595.32 841.92 re
W* n
BT
/F1 11.04 Tf
1 0 0 1 70.944 38.4 Tm
0 g
0 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
Q
EMC /P <</MCID 0>> BDC 1 g
70.9 268.58 464.2 463.15 re
f*
0.75 w
0 G
70.9 268.58 464.2 463.15 re
S
EMC q
71.304 268.82 463.54 462.55 re
W* n
/P <</MCID 1>> BDC q
71.304 268.82 463.54 462.55 re
W* n
BT
/F1 11.04 Tf
1 0 0 1 537.84 264.74 Tm
0 g
0 G
[( )] TJ
ET
Q
Q
EMC /P <</MCID 2>> BDC q
71.28 268.92 463.44 462.48 re
W* n
463.15 0 0 463.15 72.75 266.72 cm
/Image10 Do Q
q
71.34 268.86 463.44 462.48 re
W* n
2 w
1 j
71.75 265.72 465.15 465.15 re
S
Q
EMC /P <</MCID 3>> BDC q
0.000008871 0 595.32 841.92 re
W* n
BT
/F2 20.04 Tf
1 0 0 1 211.49 749.02 Tm
0 g
0 G
[(HACKven)5(t )5(20)5(18)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F1 20.04 Tf
1 0 0 1 383.83 749.02 Tm
0 g
0 G
[( )] TJ
ET
Q
EMC /P <</MCID 4>> BDC q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 70.944 254.66 Tm
1 g
1 G
[(.... ...)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 94.944 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 98.904 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 101.9 254.66 Tm
1 g
1 G
[(.)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 104.9 254.66 Tm
1 g
1 G
[(--)6(-)-6(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 120.86 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 123.86 254.66 Tm
1 g
1 G
-0.036 Tc[(---)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 135.74 254.66 Tm
1 g
1 G
[(.. )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 144.86 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 148.82 254.66 Tm
1 g
1 G
[(....)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 160.82 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 164.78 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 167.78 254.66 Tm
1 g
1 G
0.084 Tc[(--)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 175.85 254.66 Tm
1 g
1 G
[(. )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 181.85 254.66 Tm
1 g
1 G
[(--)-3(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 193.85 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 196.85 254.66 Tm
1 g
1 G
[(.)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 199.85 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 203.81 254.66 Tm
1 g
1 G
[(. .. )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 218.81 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 222.77 254.66 Tm
1 g
1 G
[(....)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 234.77 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 238.73 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 241.85 254.66 Tm
1 g
1 G
-0.036 Tc[(--)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 249.77 254.66 Tm
1 g
1 G
[(.. .)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 261.77 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 265.73 254.66 Tm
1 g
1 G
[(. ... )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 283.73 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 287.71 254.66 Tm
1 g
1 G
[(... )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 299.83 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 303.79 254.66 Tm
1 g
1 G
[(..)-9(..)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 315.91 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 319.87 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 322.87 254.66 Tm
1 g
1 G
[(..)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 328.87 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 332.83 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 335.83 254.66 Tm
1 g
1 G
[(..)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 341.83 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 345.79 254.66 Tm
1 g
1 G
[(. .)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 354.79 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 358.75 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 361.75 254.66 Tm
1 g
1 G
[(. )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 367.87 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 371.83 254.66 Tm
1 g
1 G
[(....)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 383.83 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 387.79 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 390.79 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 394.75 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 397.75 254.66 Tm
1 g
1 G
[(... )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 409.78 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 413.74 254.66 Tm
1 g
1 G
[(.... )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 428.86 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 432.82 254.66 Tm
1 g
1 G
[(.)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 435.82 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 439.78 254.66 Tm
1 g
1 G
[(. )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 445.78 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 449.74 254.66 Tm
1 g
1 G
[(....)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 461.74 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 465.7 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 468.82 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 472.78 254.66 Tm
1 g
1 G
[(.)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 475.78 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 479.74 254.66 Tm
1 g
1 G
[(. ...)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 494.74 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 498.7 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 501.7 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 505.66 254.66 Tm
1 g
1 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 508.78 254.66 Tm
1 g
1 G
[(-)] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 512.74 254.66 Tm
0 g
0 G
[( )] TJ
ET
Q
q
0.000008871 0 595.32 841.92 re
W* n
BT
/F3 12 Tf
1 0 0 1 515.88 254.66 Tm
0 g
0 G
[( )] TJ
ET
Q
EMC /P <</MCID 5>> BDC q
0.000008871 0 595.32 841.92 re
W* n
BT
/F1 11.04 Tf
1 0 0 1 70.944 227.54 Tm
0 g
0 G
[( )] TJ
ET
Q
EMC /P <</MCID 6>> BDC q
0.000008871 0 595.32 841.92 re
W* n
BT
/F1 11.04 Tf
1 0 0 1 70.944 205.1 Tm
0 g
0 G
[( )] TJ
ET
Q
EMC /P <</MCID 7>> BDC 79.4 277.67 447 444.85 re
f*
1.5 w
79.4 277.67 447 444.85 re
S
EMC q
80.184 281.93 445.54 436.25 re
W* n
/P <</MCID 8>> BDC q
80.184 281.93 445.54 436.25 re
W* n
BT
/F1 11.04 Tf
1 0 0 1 525.84 279.77 Tm
0 g
0 G
[( )] TJ
ET
Q
Q
EMC /P <</MCID 9>> BDC q
87.36 282 431.04 436.2 re
W* n
438.4 0 0 438.4 87.35 279.77 cm
/Image15 Do Q
EMC

@ -1,18 +0,0 @@
22 0 26 51 27 107 25 158 28 227 30 283 31 334 29 390 32 459 33 515 34 566 35 617 21 668 17 771 18 862 19 1098 20 1121 23 1136 <</P 21 0 R/S/P/Type/StructElem/K[ 3] /Pg 3 0 R>>
<</P 25 0 R/S/Figure/Type/StructElem/K[ 7] /Pg 3 0 R>>
<</P 25 0 R/S/P/Type/StructElem/K[ 8] /Pg 3 0 R>>
<</P 21 0 R/S/Textbox/Type/StructElem/K[ 26 0 R 27 0 R] /Pg 3 0 R>>
<</P 21 0 R/S/Figure/Type/StructElem/K[ 9] /Pg 3 0 R>>
<</P 29 0 R/S/P/Type/StructElem/K[ 1] /Pg 3 0 R>>
<</P 29 0 R/S/Figure/Type/StructElem/K[ 0] /Pg 3 0 R>>
<</P 21 0 R/S/Textbox/Type/StructElem/K[ 30 0 R 31 0 R] /Pg 3 0 R>>
<</P 21 0 R/S/Figure/Type/StructElem/K[ 2] /Pg 3 0 R>>
<</P 21 0 R/S/P/Type/StructElem/K[ 4] /Pg 3 0 R>>
<</P 21 0 R/S/P/Type/StructElem/K[ 5] /Pg 3 0 R>>
<</P 21 0 R/S/P/Type/StructElem/K[ 6] /Pg 3 0 R>>
<</P 17 0 R/S/Document/Type/StructElem/K[ 22 0 R 25 0 R 28 0 R 29 0 R 32 0 R 33 0 R 34 0 R 35 0 R] >>
<</Type/StructTreeRoot/RoleMap 18 0 R/ParentTree 19 0 R/K[ 21 0 R] /ParentTreeNextKey 1>>
<</Footnote/Note/Endnote/Note/Textbox/Sect/Header/Sect/Footer/Sect/InlineShape/Sect/Annotation/Sect/Artifact/Sect/Workbook/Document/Worksheet/Part/Macrosheet/Part/Chartsheet/Part/Dialogsheet/Part/Slide/Part/Chart/Sect/Diagram/Figure>>
<</Nums[ 0 23 0 R] >>
<</Names[] >>
[ 31 0 R 30 0 R 32 0 R 22 0 R 33 0 R 34 0 R 35 0 R 26 0 R 27 0 R 28 0 R]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

@ -1,55 +0,0 @@
#!/usr/bin/python
from PIL import Image
from qrtools import QR
import itertools
img = Image.open('QR3C.png')
pixels_orig = img.load()
(w,h)=img.size
outimg = Image.new( 'RGB', (23,23), "white")
pixels_out = outimg.load()
for i in range(0,h,6):
for j in range(0,w,6):
(r,g,b) = pixels_orig[j,i]
if((r,g,b)==(255,255,255)):
pixels_out[j/13,i/13]=(255,255,255)
elif((r,g,b)==(0,0,0) or r>0 ):
pixels_out[j/13,i/13]=(0,0,0)
# bruteforce missing section until readable
count=0
for i in itertools.product('01', repeat=60):
count+=1
if count%1000 ==0:
print count
for x in range(1,12):
for y in range (10,14):
if( i[((y-10)%4)*11 + x] == '0' ):
pixels_out[x,y]=(0,0,0)
outimg=outimg.resize((300,300))
outimg.save("dec17_out.png","png")
# read qr code
nugget=''
myCode = QR(filename="dec17_out.png")
if myCode.decode():
nugget=myCode.data_to_string()
print nugget
break
#else:
# print "could not decode"
#break

@ -1,91 +0,0 @@
#!/usr/bin/python
from PIL import Image
def invert(value):
return ''.join(["1" if x == "0" else "0" for x in value])
# Load Image
im = Image.open('QR3C_cropped.png')
# im.crop((33, 34, 264, 265)).save("QR3C_cropped.png")
pix = im.load()
tiles = 21
tileSize = im.size[0] // tiles
version = (tiles - 17) // 4
data = [[0 for x in range(tiles)] for y in range(tiles)]
print("tiles=%d tileSize=%d version=%d" % (tiles, tileSize, version))
for x in range(tiles):
for y in range(tiles):
x_mid = x * tileSize + 0.5 * tileSize
y_mid = y * tileSize + 0.5 * tileSize
color = pix[x_mid, y_mid]
# print(x, y, x_mid, y_mid, color)
data[x][y] = invert("%d%d%d" % ( color[0] // 255, color[1] // 255, color[2] // 255 ))
# print(data)
def blackWhiteValue(string):
new_value = ""
if len(string) % 3 != 0:
print("Cannot return black white value of", string)
return new_value
for i in range(len(string) // 3):
new_value += string[i * 3]
return new_value
mask1 = [data[8][18], data[8][17], data[8][16]]
mask2 = [data[2][8], data[3][8], data[4][8]]
if mask1 != mask2:
print("masks do not match")
exit()
# mask = [mask1[0][0] + mask1[1][0] + mask[2][0],]
mask = [''.join(mask1[i][j] for i in range(3)) for j in range(3)]
print("Mask:", mask)
def apply_mask(x, y, bit, mask):
doInvert = False
if mask == "111":
doInvert = x % 3 == 0
elif mask == "110":
doInvert = (x + y) % 3 == 0
elif mask == "101":
doInvert = (x + y) % 2 == 0
elif mask == "100":
doInvert = y % 2 == 0
elif mask == "000":
doInvert = ((x*y) % 2) + ((x + y) % 3) == 0
return invert(bit) if doInvert else bit
def get_masked_value(x, y):
return ''.join([apply_mask(x, y, data[x][y][i], mask[i]) for i in range(3)])
def read_block(x, y, orientation):
indizes = []
if orientation == "UP":
indizes = [[0,0], [-1,0], [0,-1], [-1,-1], [0,-2], [-1,-2], [0, -3], [-1, -3]]
elif orientation == "LEFT":
indizes = [[0,0], [-1,0], [0,-1], [-1,-1], [-2,-1], [-3,-1], [-2, 0], [-3, 0]]
return ''.join([get_masked_value(x + offset[0], y + offset[1]) for offset in reversed(indizes)])
encoding = blackWhiteValue(data[20][20] + data[19][20] + data[20][19] + data[19][19])
print("Encoding:", encoding)
# Alphanumeric? 11 bits per 2 character
# for y in range(tiles):
# print(''.join(data[y]))
block1 = read_block(20, 14, "UP")
block2 = read_block(20, 10, "LEFT")
print(block1, len(block1))
print(block2, len(block2))

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -7,13 +7,24 @@ However, his team's memory capacity is limited and so he can only use
their names (Dasher, Dancer, Prancer, Vixen, Comet, Cupid, Donder and their names (Dasher, Dancer, Prancer, Vixen, Comet, Cupid, Donder and
Blitzen) as keys. Blitzen) as keys.
Dasher
Dancer
Prancer
Vixen
Comet
Cupid
Donder
Blitzen
Where is the team headed to? Where is the team headed to?
STTYN YATLOEP DNEA ONBL TGNTO MHEHH EISTIARIB FHSRA LD IIONA NL HERUV LN17-PTAA-RTON-RDOE-MCTN-AHCO ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
XXXXX XXXXXXX XXXX XXXX XXXXX XXXXX XXXXXXXXX XXXXX XX XXXXX XX XXXXX HV18-XXXX-XXXX-XXXX-XXXX-XXXX
DDPVCCDB
L -> H
N -> V STTYN YATLOEP DNEA ONBL TGNTO MHEHH EISTIARIB FHSRA LD IIONA NL HERUV LN17-PTAA-RTON-RDOE-MCTN-AHCO
-4 +8 +0 +1
6 I A B
W I A B
5 H 9 A
-0100 +1000 +0000 +0001

@ -0,0 +1,147 @@
#!/usr/bin/python
from PIL import Image
def invert(value):
return ''.join(["1" if x == "0" else "0" for x in value])
# Load Image
im = Image.open('QR3C_cropped.png')
pix = im.load()
tiles = 21
tileSize = im.size[0] // tiles
version = (tiles - 17) // 4
print("tiles=%d tileSize=%d version=%d" % (tiles, tileSize, version))
# Data Array
data = [[0 for x in range(tiles)] for y in range(tiles)]
# Fill data
# Black -> 111
# White -> 000
# Blue -> 110 ...
for y in range(tiles):
for x in range(tiles):
x_mid = x * tileSize + 0.5 * tileSize
y_mid = y * tileSize + 0.5 * tileSize
color = pix[x_mid, y_mid]
data[x][y] = invert("%d%d%d" % ( color[0] // 255, color[1] // 255, color[2] // 255 ))
def blackWhiteValue(string):
new_value = ""
if len(string) % 3 != 0:
print("Cannot return black white value of", string)
return new_value
for i in range(len(string) // 3):
new_value += string[i * 3]
return new_value
mask1 = [data[8][18], data[8][17], data[8][16]]
mask2 = [data[2][8], data[3][8], data[4][8]]
if mask1 != mask2:
print("masks do not match")
exit()
mask = [''.join(mask1[i][j] for i in range(3)) for j in range(3)]
print("Mask:", mask)
def apply_mask(x, y, bit, mask):
doInvert = False
if mask == "111":
doInvert = x % 3 == 0
elif mask == "110":
doInvert = (x + y) % 3 == 0
elif mask == "101":
doInvert = (x + y) % 2 == 0
elif mask == "100":
doInvert = y % 2 == 0
elif mask == "000":
doInvert = ((x*y) % 2) + ((x + y) % 3) == 0
return invert(bit) if doInvert else bit
def get_masked_value(x, y):
return ''.join([apply_mask(x, y, data[x][y][i], mask[i]) for i in range(3)])
def read_block(x, y, orientation):
indizes = []
if orientation == "UP":
indizes = [[0,0], [-1,0], [0,-1], [-1,-1], [0,-2], [-1,-2], [0, -3], [-1, -3]]
elif orientation == "LEFT_TOP":
indizes = [[0,0], [-1,0], [0,-1], [-1,-1], [-2,-1], [-3,-1], [-2, 0], [-3, 0]]
elif orientation == "DOWN":
indizes = [[0,0], [-1,0], [0,1], [-1,1], [0,2], [-1,2], [0, 3], [-1, 3]]
elif orientation == "LEFT_BOTTOM":
indizes = [[0,0], [-1,0], [0,1], [-1,1], [-2,1], [-3,1], [-2, 0], [-3, 0]]
return (''.join([get_masked_value(x + offset[0], y + offset[1]) for offset in indizes]))
def map_alphanumeric(x):
if x < 10:
return chr(ord('0') + x)
elif x < 36:
return chr(ord('A') + x - 10)
else:
special = { 36: " ", 37: "$", 38: "%", 39: "*", 40: "+", 41: "-", 42: ".", 43: "/", 44: ":" }
if x in special:
return special[x]
else:
print("unknown special character:", x)
return "?"
def decode_alphanumeric(x):
a = x // 45
b = x % 45
return map_alphanumeric(a) + map_alphanumeric(b)
encoding = blackWhiteValue(data[20][20] + data[19][20] + data[20][19] + data[19][19])
# encoding = data[20][20] + data[19][20] + data[20][19] + data[19][19]
# encoding = [get_masked_value(20, 20), get_masked_value(19, 20), get_masked_value(20, 19), get_masked_value(19, 19)]
print("Encoding:", encoding)
len_block = read_block(20, 18, "UP")
print("Length:", int(len_block, 2))
# 19 Blocks
blocks = ''.join([
read_block(20, 14, "UP"),
read_block(20, 10, "LEFT_TOP"),
read_block(18, 11, "DOWN"),
read_block(18, 15, "DOWN"),
read_block(18, 19, "LEFT_BOTTOM"),
read_block(16, 18, "UP"),
read_block(16, 14, "UP"),
read_block(16, 10, "LEFT_TOP"),
read_block(14, 11, "DOWN"),
read_block(14, 15, "DOWN")
])
channels = ["", "", ""]
blockSize = 3
for i in range(len(blocks) // blockSize):
channels[0] += blocks[i*3]
channels[1] += blocks[i*3+1]
channels[2] += blocks[i*3+2]
# chunk = int(blocks[blockSize*i:blockSize*i+blockSize],2)
# string += chr(chunk)
# string += decode_alphanumeric(chunk)
line = ""
for c in channels:
for i in range(len(c) // 8):
line += chr(int(c[i*8:i*8+8], 2))
print(line)
# print(len(blocks) /8)
# print(''.join(blocks))
# for x in range(tiles):
# print(''.join(data[x]))

Before

Width:  |  Height:  |  Size: 514 KiB

After

Width:  |  Height:  |  Size: 514 KiB

@ -1 +0,0 @@
ZOoxjUSe1OVB7OPoVrsX.pdf