Skip to content

Commit

Permalink
Update decode.py
Browse files Browse the repository at this point in the history
  • Loading branch information
smallfawn authored Jun 28, 2024
1 parent b19c080 commit 3b61b72
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions src/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import lzma
import gzip
from datetime import datetime

from Crypto.Cipher import AES
from cryptography.fernet import Fernet
from Crypto.Cipher import ChaCha20
# 获取当前日期和时间
now = datetime.now()

Expand Down Expand Up @@ -66,6 +68,11 @@ def extract_base64_encoded(data):
return encoded_string


def Encoded_script_decode(data):

return


def decrypt_nested(data):
while True:
new_data = try_decode_base64(data)
Expand All @@ -74,7 +81,16 @@ def decrypt_nested(data):
# print("解密后的数据:", new_data)
if "exec(" in str(new_data):
# 更新 decrypted_data 以便下一次循环使用
data = extract_base64_encoded(str(new_data))
if "Encoded script" in str(new_data):
new_data = "该加密未适配 敬请期待"
print("该加密未适配 敬请期待")
break
elif "exec(" in str(new_data):
data = extract_base64_encoded(str(new_data))
else:
print("未知 加密 无法进一步解密")
new_data = "未知 加密 无法进一步解密"
break # 如果 new_data 中不再包含 "exec",跳出循环
# print(data)
else:
print("无法进一步解密,退出循环")
Expand All @@ -83,15 +99,15 @@ def decrypt_nested(data):
return new_data # 返回最终解密后的数据


with open('./input.py', 'r') as file:
with open('./input.py', 'r', encoding='utf-8') as file:
# 读取文件内容
content = file.read().strip()
# 打印内容
encoded_data = extract_base64_encoded(content)
#print(encoded_data)
# print(encoded_data)
# 解密嵌套加密数据
final_decrypted_data = decrypt_nested(encoded_data)
# 输出最终解密结果
#print("最终解密结果:")
# print("最终解密结果:")
with open("./onput.py", 'wb') as f:
f.write(final_decrypted_data)
f.write(final_decrypted_data.encode('utf-8'))

0 comments on commit 3b61b72

Please sign in to comment.