fix: 修复Uncomply反编译报错

This commit is contained in:
dqy 2024-06-04 16:14:34 +08:00
parent 3f6375977c
commit cd779ef43f
3 changed files with 4 additions and 11 deletions

View File

@ -1,5 +1,4 @@
from typing import List, Tuple from typing import List, Tuple
import uncompyle6
import io import io
import os import os
import subprocess import subprocess
@ -39,10 +38,6 @@ def disassemble_pyc(file_path: str, pycdc_addr=None) -> str:
str: The disassembled code as a string. str: The disassembled code as a string.
""" """
output = io.StringIO() output = io.StringIO()
try:
uncompyle6.main.decompile_file(file_path, output)
return output.getvalue()
except Exception as e:
if pycdc_addr is None: if pycdc_addr is None:
return "none" return "none"
else: else:

View File

@ -3,6 +3,5 @@ requests
packaging packaging
openai openai
bs4 bs4
uncompyle6
colorama colorama
tqdm tqdm

View File

@ -38,7 +38,6 @@ setup(
"packaging", "packaging",
"openai", "openai",
"bs4", "bs4",
"uncompyle6",
"tqdm", "tqdm",
"colorama", "colorama",
], ],