2 回答
TA贡献1875条经验 获得超5个赞
该代码只是使用 b64 编码。要对其进行解码,您只需打印传递给 eval 的结果
data = ((base64.b64decode(eval('\x74\x72\x75\x73\x74')),'<string>','exec'))
print(data[0].decode("utf-8"))
如果你想避免评估,你可以使用
joy = 'rot13'
trust = magic + codecs.decode(love, joy) + god + codecs.decode(destiny, joy)
code = (base64.b64decode(trust),'<string>','exec')
print(code[0].decode("utf-8"))
TA贡献1844条经验 获得超8个赞
这不是一个完整的答案,但是您的大部分文件在未转义并打印出来时看起来都是正确的。例如,简单地从您的文件复制粘贴decoded.txt到 python REPL 中并将其打印出来会产生:
>>> print(
... """\r\n@Exeter.command(aliases=["stopcopycatuser", "stopcopyuser", "stopc
... opy"])\r\nasync def stopcopycat(ctx):\r\n await ctx.message.delete()\r
... \n if Exeter.user is None:\r\n await ctx.send("You weren\'t cop
... ying anyone to begin with")\r\n return\r\n await ctx.send("Stop
... ped copying " + str(Exeter.copycat))\r\n Exeter.copycat = None\r\n"""
... )
@Exeter.command(aliases=["stopcopycatuser", "stopcopyuser", "stopcopy"])
async def stopcopycat(ctx):
await ctx.message.delete()
if Exeter.user is None:
await ctx.send("You weren't copying anyone to begin with")
return
await ctx.send("Stopped copying " + str(Exeter.copycat))
Exeter.copycat = None
使用您以编程方式完成此操作的一种方法decoded.txt是:
with read("decoded.txt") as f:
data = f.read()
unescaped = data.encode("utf8").decode("unicode_escape")
print(unescaped)
添加回答
举报