其他分享
首页 > 其他分享> > buuctf

buuctf

作者:互联网

注意,strcat拼接时,是以小端序方式拼接的,0x……LL中的LL指的是long long类型,从右到左读字符。

from binascii import a2b_hex
import gmpy2
t1 = '4E44434C53'
key = 'ADSFK' + a2b_hex(t1).decode()
v5=len(key)
v3=0
keyt=""
for i in range(v5):
if ord(key[v3 % v5]) > 64 and ord(key[v3 % v5])<= 90:
keyt += chr(ord(key[v3 % v5]) + 32)
v3=v3+1


print(keyt)
text='killshadow'
dict='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
flag=''
for i in range(len(text)):
for ch in dict:
if ord(text[i]) == (ord(ch) - 39 - ord(keyt[i % v5])+ 97) % 26 + 97:
flag+=ch
break
print(flag)

标签:buuctf,text,v3,ch,v5,key,ord
来源: https://www.cnblogs.com/kubopiy/p/16585838.html