解题思路:

参考了鸽子小姐姐的脚本:https://zhuanlan.zhihu.com/p/22678856

具体题目就不贴了。

题目中提示将问题图像化,猜测是将这些16进制数转化为图像,尝试将16进制转换为二进制

乍一看是不是有点像一个二维码,接下来就是具体将0转化为白色,1转化为黑色了。

这里贴一下鸽子小姐姐的代码:

#!/usr/bin/env python
# -*- coding: utf-8 -*- from PIL import Image
import numpy as np def hex2bin(hexmat):
binmattemp = [bin(m)[2:] for m in hexmat] #全转成二进制
rowlen = max([len(m) for m in binmattemp]) #取最宽的值
binmat = [[0]+[int(b) for b in row.zfill(rowlen)] for row in binmattemp] #用0补齐 print rowlen+1, 'x', len(binmat)
for i in xrange(len(binmat)):
print ''.join([str(b) for b in binmat[i]]) return binmat, rowlen+1, len(binmat) def rm_col(binmat, col): #移除指定的列
return [row[:col]+row[col+1:] for row in binmat] def make_bw_img(binmat, w, h, outfilename, blackbit=0): bwmat = [[0 if b==blackbit else 255 for b in row] for row in binmat] #用255表示白,0表示黑 imagesize = (w, h)
img = Image.fromarray(np.uint8(np.array(bwmat)))
img.save(outfilename) if __name__ == '__main__':
hexmat = [0x00000000,
0xff71fefe,
0x83480082,
0xbb4140ba,
0xbb6848ba,
0xbb4a80ba,
0x83213082,
0xff5556fe,
0x00582e00,
0x576fb9be,
0x707ef09e,
0xe74b41d6,
0xa82c0f16,
0x27a15690,
0x8c643628,
0xbfcbf976,
0x4cd959aa,
0x2f43d73a,
0x5462300a,
0x57290106,
0xb02ace5a,
0xef53f7fc,
0x00402e36,
0xff01b6a8,
0x83657e3a,
0xbb3b27fa,
0xbb5eaeac,
0xbb1017a0,
0x8362672c,
0xff02a650,
0x00000000] binmat, w, h = hex2bin(hexmat)
binmat = rm_col(binmat, 22) #发现第七行和第22行多余,故删除
binmat = rm_col(binmat, 7)
make_bw_img(binmat, w, h, 'matrix_rmcol.png', blackbit=1)

IceCTF-Matrix的更多相关文章

  1. angular2系列教程(十一)路由嵌套、路由生命周期、matrix URL notation

    今天我们要讲的是ng2的路由的第二部分,包括路由嵌套.路由生命周期等知识点. 例子 例子仍然是上节课的例子:

  2. Pramp mock interview (4th practice): Matrix Spiral Print

    March 16, 2016 Problem statement:Given a 2D array (matrix) named M, print all items of M in a spiral ...

  3. Atitit Data Matrix dm码的原理与特点

    Atitit Data Matrix dm码的原理与特点 Datamatrix原名Datacode,由美国国际资料公司(International Data Matrix, 简称ID Matrix)于 ...

  4. Android笔记——Matrix

    转自:http://www.cnblogs.com/qiengo/archive/2012/06/30/2570874.html#translate Matrix的数学原理 在Android中,如果你 ...

  5. 通过Matrix进行二维图形仿射变换

    Affine Transformation是一种二维坐标到二维坐标之间的线性变换,保持二维图形的"平直性"和"平行性".仿射变换可以通过一系列的原子变换的复合来 ...

  6. [LeetCode] Kth Smallest Element in a Sorted Matrix 有序矩阵中第K小的元素

    Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth ...

  7. [LeetCode] Longest Increasing Path in a Matrix 矩阵中的最长递增路径

    Given an integer matrix, find the length of the longest increasing path. From each cell, you can eit ...

  8. [LeetCode] Search a 2D Matrix II 搜索一个二维矩阵之二

    Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the follo ...

  9. [LeetCode] Search a 2D Matrix 搜索一个二维矩阵

    Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the follo ...

  10. [LeetCode] Set Matrix Zeroes 矩阵赋零

    Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click ...

随机推荐

  1. vue实现轮播效果

    vue实现轮播效果 效果如下:(不好意思,图有点大:) 功能:点击左侧图片,右侧出现相应的图片:同时左侧边框变颜色. 代码如下:(也可以直接下载文件) <!DOCTYPE html> &l ...

  2. 20140923 cin.get() getline cin

    #include<iostream> #include<string> using namespace std; int main() {     string title; ...

  3. UML指南系列——活动图

    活动图用来描述传统意义上的流程图

  4. c++计算1到100以内的质数

    自考c++实践的时候,有个求计算1-100的质数的问题,没搞出来 由于考试使用的是Dev-C++开发工具,为了下次考试做准备,改用该工具,直接下载安装即可,不会涉及到什么破解等 下载地址:https: ...

  5. Spring Boot 中 @SpringBootApplication注解背后的三体结构探秘

    概 述 SpringBoot 约定大于配置 的功力让我们如沐春风,在我之前写的文章<从SpringBoot到SpringMVC> 也对比过 SpringBoot 和 SpringMVC 这 ...

  6. nginx + gunicorn + django 2.0 踩坑

    部署踩坑 部署踩坑提前准备服务器端准备安装nginx使用uwsgi部署使用gunicorn配置配置nginx配置django中的路径url 提前准备 在本地能够 python(3) manage.py ...

  7. JS window对象 返回浏览历史中的其他页面 go()方法,根据当前所处的页面,加载 history 列表中的某个具体的页面。 语法: window.history.go(number);

    返回浏览历史中的其他页面 go()方法,根据当前所处的页面,加载 history 列表中的某个具体的页面. 语法: window.history.go(number); 参数: 浏览器中,返回当前页面 ...

  8. C基础学习记录

    函数 1:子函数定义的变量只在调用的时候才会分配空间,调用结束后会收回空间. 2:在调用子函数时只会向函数传递值,是单向传递的. 3.返回值的类型一般与函数的类型一致,如果不一致会以函数类型为准. 4 ...

  9. Codeforces 348E 树的中心点的性质 / 树形DP / 点分治

    题意及思路:http://ydc.blog.uoj.ac/blog/12 在求出树的直径的中心后,以它为根,对于除根以外的所有子树,求出子树中的最大深度,以及多个点的最大深度的lca,因为每个点的最长 ...

  10. docker linux基本操作

    容器运行起来之后一些基本的工具还是要安装好: 这个工具的安装方式和linux是一样的,因为容器本身就是一个微linux系统 先安装 apt, 1 / apt-get update 安装了apt之后 可 ...