pythonchallenge 解谜 Level 5

时间:2025-05-09 23:38:02

第五关的确很坑爹。。。

不过,根据之前的思路,我想着是把信息放在了 “源码” 中。

翻了下源码。有用的东西在以下部分。

<html><head>
<title>peak hell</title>
<link rel="stylesheet" type="text/css" href="../style.css">
<script async="" src="http://c.cnzz.com/core.php"></script></head>
<body>
<center>
<img src="peakhell.jpg">
<br><font color="#c0c0ff">
pronounce it
<br>
<peakhell src="banner.p">
<!-- peak hell sounds familiar ? -->
</peakhell></font></center></body></html>

出现了一个 src = "banner.p" 应该是一个有用的文件,替换下 url 下载,打开后发现

(lp0
(lp1
(S' '
p2
I95
tp3
aa(lp4
...

下一个信息 peak hell sounds familiar ? pick? 于是手动百度过发现有 pickle 这个模块。

替换下 url 发现下一个页面是 yes! pickle!  说明我们的方向是对的。

关于 pickle 模板 的使用。下面豆瓣这个介绍还是值得看一下的。

https://www.douban.com/note/143585267/

想着我们得到的文件应该是需要把文件进行重构对象。

重构先。

 #-*- coding:utf-8 -*-
#代码版本均为python 3.5.1
#Level 5 import pickle pkl_file = open('banner.p', 'rb') data = pickle.load(pkl_file) print (data)

得到的是

[[(' ', 95)], [(' ', 14), ('#', 5), (' ', 70), ('#', 5), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 6), ('#', 3), (' ', 6), ('#', 4), (' ', 3), ('#', 3), (' ', 9), ('#', 3), (' ', 7), ('#', 5), (' ', 3), ('#', 3), (' ', 4), ('#', 5), (' ', 3), ('#', 3), (' ', 10), ('#', 3), (' ', 7), ('#', 4), (' ', 1)], [(' ', 3), ('#', 3), (' ', 3), ('#', 2), (' ', 4), ('#', 4), (' ', 1), ('#', 7), (' ', 5), ('#', 2), (' ', 2), ('#', 3), (' ', 6), ('#', 4), (' ', 1), ('#', 7), (' ', 3), ('#', 4), ...

接下来把这些输出进行处理。代码如下

 #-*- coding:utf-8 -*-
#代码版本均为python 3.5.1
#Level 5 import pickle pkl_file = open('banner.p', 'rb') data = pickle.load(pkl_file) print (data) print ('\n'.join([''.join([p[0] * p[1] for p in row]) for row in data]))

然后,进入下一关。

              #####                                                                      #####
#### ####
#### ####
#### ####
#### ####
#### ####
#### ####
#### ####
### #### ### ### ##### ### ##### ### ### ####
### ## #### ####### ## ### #### ####### #### ####### ### ### ####
### ### ##### #### ### #### ##### #### ##### #### ### ### ####
### #### #### ### ### #### #### #### #### ### #### ####
### #### #### ### #### #### #### #### ### ### ####
#### #### #### ## ### #### #### #### #### #### ### ####
#### #### #### ########## #### #### #### #### ############## ####
#### #### #### ### #### #### #### #### #### #### ####
#### #### #### #### ### #### #### #### #### #### ####
### #### #### #### ### #### #### #### #### ### ####
### ## #### #### ### #### #### #### #### #### ### ## ####
### ## #### #### ########### #### #### #### #### ### ## ####
### ###### ##### ## #### ###### ########### ##### ### ######
http://www.pythonchallenge.com/pc/def/channel.html