有没有办法让这个代码“正常”呢

2024-09-27 00:19:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在解码/解密这段代码,python看起来像This

200d\\U0001f466)))|(?:(?:(?:\\U0001f468\\u200d\\U0001f468)|(?:\\U0001f469\\u200d\\U0001f469))\\u200d\\U0001f466)|[\\u2194-\\u2199]|[\\u23e9-\\u23f3]|[\\u23f8-\\u23fa]|[\\u25fb-\\u25fe]|[\\u2600-\\u2604]|[\\u2638-\\u263a]|[\\u2648-\\u2653]|[\\u2692-\\u2694]|[\\u26f0-\\u26f5]|[\\u26f7-\\u26fa]|[\\u2708-\\u270d]|[\\u2753-\\u2755]|[\\u2795-\\u2797]|[\\u2b05-\\u2b07]|[\\U0001f191-\\U0001f19a]|[\\U0001f1e6-\\U0001f1ff]|[\\U0001f232-\\U0001f23a]|[\\U0001f300-\\U0001f321]|[\\U0001f324-\\U0001f393]|[\\U0001f399-\\U0001f39b]|[\\U0001f39e-\\U0001f3f0]|[\\U0001f3f3-\\U0001f3f5]|[\\U0001f3f7-\\U0001f3fa]|[\\U0001f400-\\U0001f4fd]|[\\U0001f4ff-\\U0001f53d]|[\\U0001f549-\\U0001f54e]|[\\U0001f550-\\U0001f567]|[\\U0001f573-\\U0001f57a]|[\\U0001f58a-\\U0001f58d]|[\\U0001f5c2-\\U0001f5c4]|[\\U0001f5d1-\\U0001f5d3]|[\\U0001f5dc-\\U0001f5de]|[\\U0001f5fa-\\U0001f64f]|[\\U0001f680-\\U0001f6c5]|[\\U0001f6cb-\\U0001f6d2]|[\\U0001f6e0-\\U0001f6e5]|[\\U0001f6f3-\\U0001f6f6]|[\\U0001f910-\\U0001f91e]|[\\U0001f920-\\U0001f927]|[\\U0001f933-\\U0001f93a]|[\\U0001f93c-\\U0001f93e]|[\\U0001f940-\\U0001f945]|[\\U0001f947-\\U0001f94b]|[\\U0001f950-\\U0001f95e]|[\\U0001f980-\\U0001f991]|\\u00a9|\\u00ae|\\u203c|\\u2049|\\u2122|\\u2139|\\u21a9|\\u21aa|\\u231a|\\u231b|\\u2328|\\u23cf|\\u24c2|\\u25aa|\\u25ab|\\u25b6|\\u25c0|\\u260e|\\u2611|\\u2614|\\u2615|\\u2618|\\u261d|\\u2620|\\u2622|\\u2623|\\u2626|\\u262a|\\u262e|\\u262f|\\u2660|\\u2663|\\u2665|\\u2666|\\u2668|\\u267b|\\u267f|\\u2696|\\u2697|\\u2699|\\u269b|\\u269c|\\u26a0|\\u26a1|\\u26aa|\\u26ab|\\u26b0|\\u26b1|\\u26bd|\\u26be|\\u26c4|\\u26c5|\\u26c8|\\u26ce|\\u26cf|\\u26d1|\\u26d3|\\u26d4|\\u26e9|\\u26ea|\\u26fd|\\u2702|\\u2705|\\u270f|\\u2712|\\u2714|\\u2716|\\u271d|\\u2721|\\u2728|\\u2733|\\u2734|\\u2744|\\u2747|\\u274c|\\u274e|\\u2757|\\u2763|\\u2764|\\u27a1|\\u27b0|\\u27bf|\\u2934|\\u2935|\\u2b1b|\\u2b1c|\\u2b50|\\u2b55|\\u3030|\\u303d|\\u3297|\\u3299|\\U0001f004|\\U0001f0cf|\\U0001f170|\\U0001f171|\\U0001f17e|\\U0001f17f|\\U0001f18e|\\U0001f201|\\U0001f202|\\U0001f21a|\\U0001f22f|\\U0001f250|\\U0001f251|\\U0001f396|\\U0001f397|\\U0001f56f|\\U0001f570|\\U0001f587|\\U0001f590|\\U0001f595|\\U0001f596|\\U0001f5a4|\\U0001f5a5|\\U0001f5a8|\\U0001f5b1|\\U0001f5b2|\\U0001f5bc|\\U0001f5e1|\\U0001f5e3|\\U0001f5e8|\\U0001f5ef|\\U0001f5f3|\\U0001f6e9|\\U0001f6eb|\\U0001f6ec|\\U0001f6f0|\\U0001f930|\\U0001f9c0|[#|0-9]\\u20e3"\r\n\r\n\r\n@Exeter.command(aliases=["stopcopycatuser", "stopcopyuser", "stopcopy"])\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 copying anyone to begin with")\r\n return\r\n await ctx.send("Stopped copying " + str(Exeter.copycat))\r\n Exeter.copycat = None\r\n\r\n\r\n@Exeter.command(aliases=["copycatuser", "copyuser"])\r\nasync def copycat(ctx, user: discord.User):\r\n await ctx.message.delete()\r\n Exeter.copycat = user\r\n await ctx.send("Now copying " + str(Exet

有没有办法把它转换成普通的python代码?下面是加密/加密文件和解密/解码文件

Encoded File (Filebin)

Decoded File (Filebin)


Tags: 代码sendawait解码commandaliasesctxuser
2条回答

这并不是一个完整的答案,但在取消转义并打印出来时,大多数文件看起来都是正确的。例如,只需将粘贴从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)

代码只是使用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"))

相关问题 更多 >

    热门问题