WeChall - Vermeer

Challenge

A paranoid friend has sent me a message, but in his paranoid mind he forgot to tell me how to decode it. If Picasso got a computer he would know what to do!

WeChall 页面给出一段编码消息,提交框要求输入解码后的答案。

Recon

拿到的消息长这样(坐标每次访问随机生成,但文本和图案不变):

1
S10x13a20x10d31x14l41x16y27x11,42x10 43x16t37x11h17x16i12x15s10x15 ...

Solution

消息中的字母是坐标对之间的分隔符,NxN 才是真正的 payload。把每个 (x, y) 当作一个黑像素画在画布上,会显现文字。

Step 1: 提取坐标

1
2
3
4
import re
msg = "S10x13a20x10d31x14l41x16y27x11,42x10 43x16..."
coords = re.findall(r'(\d+)x(\d+)', msg)
# coords = [('10','13'), ('20','10'), ('31','14'), ...]

每个坐标对格式是 NNxNN,其中 x 范围 10-43,y 范围 10-16。字母(a, d, l, y...)只是点分隔符,可以全部丢弃。

Step 2: 画图

用任意方式把坐标画成像素:

Python:

1
2
3
4
5
6
grid = {}
for x_str, y_str in coords:
grid[(int(x_str), int(y_str))] = '#'

for y in range(10, 17):
print(''.join(grid.get((x, y), ' ') for x in range(10, 44)))

ImageJ(论坛方案):

1
2
3
4
5
6
newImage("Vermeer", "8-bit white", 100, 100, 1);
for (i = 1; i < lengthOf(message) - 5; i += 6) {
x = parseInt(substring(message, i, i + 2));
y = parseInt(substring(message, i + 3, i + 5));
setPixel(x, y, 0);
}

Step 3: 读结果

画出来是 7 个 block letter,占据 x=10-43, y=10-16 的区域:

1
2
3
4
5
6
7
# #  ###  ###  #  #  #  #  #  ####
# # # # # # # # ## # #
# # # # # ## # ## # #
### ### # ## # #### # ##
# # # # # ## # # ## # ##
# # # # # # # # # ## # #
# # # # ### # # # # # ####

7 个 block 字母,每个 3-4 列宽,2 列间隔。坐标值每次访问随机变化,但画出的字母图案始终一致。