首页 > 代码库 > CTF-reverse-daily(2)-wow

CTF-reverse-daily(2)-wow

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

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

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

import numpyNUM=0x16matrix=[[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