|
@@ -7,6 +7,7 @@ import json
|
|
|
import time
|
|
|
from os import walk
|
|
|
import subprocess
|
|
|
+import rarfile
|
|
|
import py7zr
|
|
|
import tarfile
|
|
|
from zipfile import ZipFile
|
|
@@ -1388,6 +1389,11 @@ def decode_path(path):
|
|
|
def detection_type(path, system):
|
|
|
tempdir = time.strftime("%Y_%m_%dT%H_%M_%S")
|
|
|
os.mkdir(tempdir)
|
|
|
+ # 传入 rar 压缩文件
|
|
|
+ if os.path.isfile(path) and path.endswith('.rar'):
|
|
|
+ rar = rarfile.RarFile(path)
|
|
|
+ rar.extractall('./cache/' + tempdir)
|
|
|
+ path = "./cache/" + tempdir
|
|
|
# 传入 tar.gz 压缩文件
|
|
|
if os.path.isfile(path) and path.endswith('.tar.gz'):
|
|
|
tf = tarfile.open(path)
|