import subprocess as sp
import os
# Source file
pcap_file = "C:\\...\\DICOM.pcap"
dest_dir = "exported"
os.mkdir(dest_dir)
# Read the file and use export-objects. Next arg must be `protocol,dir`.
sp.run(["tshark", "-Q", "-r", pcap_file, " export-objects", "DICOM," + dest_dir])
如果我们使用的是python和tshark,这主要是对子流程的调用,因为tshark已经有了这个功能:
然后,如果您
ls exported
,您将看到导出的文件。我已经测试并验证了this wireshark bug file有一个dicom文件,可以用这些命令导出如果您想更好地理解提取过程,Wireshark是开源的,您可以查看它的DICOM code
相关问题 更多 >
编程相关推荐