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 c5599e2 commit c560213
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,18 @@ def decrypt_nested(data):
final_decrypted_data = decrypt_nested(encoded_data)
# 输出最终解密结果
# print("最终解密结果:")
def process_data(data):
if isinstance(data, str):
# 如果是字符串,则编码为字节对象
byte_data = data.encode('utf-8')
elif isinstance(data, bytes):
# 如果已经是字节对象,则直接使用
byte_data = data
else:
# 如果不是字符串也不是字节对象,抛出异常或做其他处理
raise TypeError("Expected string or bytes-like object")
return byte_data


with open("./onput.py", 'wb') as f:
f.write(final_decrypted_data.encode('utf-8'))
f.write(process_data(final_decrypted_data))

0 comments on commit c560213

Please sign in to comment.