香山杯 [rev] easy_py Posted on 2021-11-07 逆向PYC文件: 123456789101112131415161718def encode(enc, length): if length == 0: return 0 for i in range(length): enc[length + i] ^= enc[i] encode(enc, length >> 1)tmp = [100, 5, 87, 2, 86, 0, 3, 84, 80, 2, 87, 80, 80, 86, 85, 2, 85, 87, 7, 0, 87, 4, 3, 3, 5, 84, 84, 11, 81, 5, 6, 13]flag = "?"if len(flag) != 32: exit(0)enc = map(ord, flag)encode(enc, len(enc) >> 1)if tmp == enc: print("yes")else: print("wrong") 解密: 123456def decode(enc, length): if length > 16: return 0 for i in range(length): enc[length + i] ^= enc[i] decode(enc, length << 1) 今日教训:比赛摸鱼不好好看题,痛失一血= =。