https://blog.yakumoran.top/wp-content/uploads/2024/04/20240411ezre.7z(题目备份)(原题是sb蓝桥杯的一题)
错解:
进去看似很简单一题
s2='`\x0F5>5\x02)5wa\x1Ae&d\x06 N `S`hdZdQq~Tg!k!e\x05sdQ`uJa'
s='SEcRET7'
flag=''
for i in range(0,len(s2)):
k=ord(s2[i])^ord(s[i%len(s)])
flag+=chr(k)
print(flag)
写个简单的脚本,一跑
???为啥是乱码啊???
然后陷入了长久的沉寂
--------------------------我是分界线--------------------------
正解
后来发现这个是拿Ubuntu,Ubuntu是小端读取
也就是像s2[0] = 0x600F353E35022935LL;不是正常从左往右读取如60,0F,35
而是从右往左读取,如35,29,02
mgj
重新写脚本
s='SEcRET7'
s2=['' for i in range(6)]
s2[0] = '`\x0F5>5\x02)5'
s2[1] = 'wa\x1Ae&d\x06 '
s2[2] = 'N `S`hdZ'
s2[3] = 'dQq~Tg!k'
s2[4] = '!e\x05sdQ`u'
v5 = 'Ja'
flag=s2[0][::-1]+s2[1][::-1]+s2[2][::-1]+s2[3][::-1]+s2[4][::-1]+v5[::-1]
out_flag=''
for i in range(0,len(flag)):
k=ord(flag[i])^ord(s[i%len(s)])
out_flag+=chr(k)
print(out_flag)
flag{a83ee6c1-2296-4d3e-9d3c-42604f76f7d5}