EasyProgram
Eeemmm…this is a easy game.Have fun~ 注意:得到的 flag 请包上 flag{} 提交
附件:
file.txt
簭+"烸?K?镝?灸註? z?Q碉=??
啥也看不出来,拖入winhex看看
38位十六进制(加上0x)数据
0x00,0xBA,0x8F,0x11,0x2B,0x22,0x9F,0x51,0xA1,0x2F,0xAB,0xB7,0x4B,0xD7,0x3F,0xEF,0xE1,0xB5,0x13,0xBE,0xC4,0xD4,0x5D,0x03,0xD9,0x00,0x7A,0xCA,0x1D,0x51,0xA4,0x73,0xB5,0xEF,0x3D,0x9B,0x31,0xB3
附件.txt
get buf unsign s[256]
get buf t[256]
we have key:whoami
we have flag:????????????????????????????????
for i:0 to 256
set s[i]:i
for i:0 to 256
set t[i]:key[(i)mod(key.lenth)]
for i:0 to 256
set j:(j+s[i]+t[i])mod(256)
swap:s[i],s[j]
for m:0 to 38
set i:(i + 1)mod(256)
set j:(j + S[i])mod(256)
swap:s[i],s[j]
set x:(s[i] + (s[j]mod(256))mod(256))
set flag[m]:flag[m]^s[x]
fprint flagx to file
百度后发现是伪代码,大致能看懂,根据加密流程发现不难写出解密脚本,唯一疑惑的是set x部分的括号,和flag运算的只有一句,那就是^运算,不难知道,异或运算是可