码迷,mamicode.com
首页 > 其他好文 > 详细

CTF-reverse-daily(2)-wow

时间:2016-09-13 00:09:19      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

链接:http://pan.baidu.com/s/1eS9JNP4 密码:ltl4

本体分析比较简单,算法是解一个22元一次方程

这里引入了numpy这样一个python库,灰常强大

import numpy

NUM=0x16
matrix=[[0 for i in range(NUM)] for j in range(NUM)]
strings = [
"ThelightTokeepinmindtheholylight",
"Timeismoneymyfriend",
"WelcometotheaugerRuiMa",
"Areyouheretoplayforthehorde",
"ToarmsyeroustaboutsWevegotcompany",
"Ahhwelcometomyparlor",
"Slaytheminthemastersname",
"YesrunItmakesthebloodpumpfaster",
"Shhhitwillallbeoversoon",
"Kneelbeforemeworm",
"Runwhileyoustillcan",
"RisemysoldiersRiseandfightoncemore",
"LifeismeaningleshThatwearetrulytested",
"BowtothemightoftheHighlord",
"ThefirstkillgoestomeAnyonecaretowager",
"Itisasitshouldbe",
"Thedarkvoidawaitsyou",
"InordertomoregloryofMichaelessienray",
"Rememberthesunthewellofshame",
"Maythewindguideyourroad",
"StrengthandHonour",
"Bloodandthunder"
]

verify=[
0x000373ca,
0x00031bdf,
0x000374f7,
0x00039406,
0x000399c4,
0x00034adc,
0x00038c08,
0x00038b88,
0x00038a60,
0x0002b568,
0x00032471,
0x00037dea,
0x00036f97,
0x000378e4,
0x00038706,
0x00029010,
0x00034c23,
0x00038ef8,
0x00038e29,
0x0003925e,
0x0002b5fc,
0x0002584e
]

def gen_matrix():
    for i in range(NUM):
        for j in range(NUM):
            matrix[i][j]=0

    for i in range(NUM):
        for j in range(len(strings[i])):
            if j>=NUM:
                break
            matrix[i][j]=ord(strings[i][j])

if __name__==__main__:
    gen_matrix()
    verify=numpy.array(verify)
    matrix=numpy.array(matrix)
    a=numpy.linalg.solve(matrix,verify)
    print a
b=[ 104, 99, 116,102,123,76,74,95,121,54,  99, 100, 99,
95, 113, 119, 101, 101, 114, 116, 33, 125]
c=‘‘
for i in b:
c+=(chr(i))
print c

 

CTF-reverse-daily(2)-wow

标签:

原文地址:http://www.cnblogs.com/lomooo/p/5866747.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!