XOR

       
-------------已经到底啦!-------------
 

关于python xor的脚本

IDA打开看看

找到main函数,我们看到有异或字符,和global比较,相同的话就获得flag

[第9行得知flag的长度为33]{.purple}

[第13行比较v6和global处存放的前31位字符是否相同;相同则输出success]{.red}

[从main函数里面可以得到V6的处理方式为v6[i]等于v6[i]原来的值与v6[i-1]按位异或.]{.rainbow}

查看global字符串

编写解密脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
s = ['f',10,'k',12,'w&O.@',17,'x',13,'Z;U',17,'p',25,'F',31,'v"M#D',14,'g',6,'h',15,'G2O',0]

ss = 'fkw&O.@xZ;UpFv"M#DghG2O'

x = "f"

a = [102, 10, 107, 12, 119, 38, 79, 46, 64, 17, 120, 13, 90, 59, 85, 17, 112, 25, 70, 31, 118, 34, 77, 35, 68, 14, 103, 6, 104, 15, 71, 50, 79 ,0] #字符串转换成10进制

for i in range(1,len(a)):
x += chr(a[i]^a[i-1]) #对应v6

print(x)

拿到flag: !!flag{QianQiuWanDai_YiTongJiangHu}!!{.bulr}

参考

https://www.runoob.com/python/python-operators.html
https://blog.csdn.net/weixin_44731100/article/details/89156141