from subprocess import call, check_output
swf_file = "filename.swf"
dump_file = "dump_swf.txt"
# run TrID on file and get results
result_string = check_output(["trid", "-v", filename])
# parse result_string - is it compressed?
??? YOUR CODE GOES HERE ???
if is_compressed:
# decompress it
call(["flasm", "-x", filename])
# decompile it
dump = check_output(["swfdump", "-D", filename])
# save the decompiled result
with open(dump_file, "w") as outf:
outf.write(dump)
对于简单的选择,总是有
os.system
。要获得更大的灵活性,您可以查看subprocess
模块。你知道吗相关问题 更多 >
编程相关推荐