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\[email protected](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)
添加回答
舉報