Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions fact_extractor/plugins/unpacking/patool/code/patool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

NAME = 'PaTool'
MIME_PATTERNS = [
'application/gzip',
'application/java-archive',
'application/vnd.debian.binary-package',
'application/vnd.ms-cab-compressed',
Expand All @@ -22,7 +21,6 @@
'application/x-cpio',
'application/x-debian-package',
'application/x-dms',
'application/x-gzip',
'application/x-lha',
'application/x-lrzip',
'application/x-lz4',
Expand All @@ -40,7 +38,7 @@
'application/zpaq',
'audio/flac',
]
VERSION = '0.6.0'
VERSION = '0.6.1'

TOOL_PATH = execute_shell_command('which patool').strip()

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ def test_unpacker_selection_generic(self):
('test.shar', None),
('test.tar.Z', None),
('test.tar.bz2', None),
('test.tar.gz', None),
('test.tar', None),
('test.tar.lz', None),
('test.tar.xz', None),
('test.tar.zip', None),
('test.zoo', None),
('test.zpaq', None),
],
Expand All @@ -45,7 +44,6 @@ def test_archive_extraction(self, in_file, ignore):
[
'test.a',
'test.bz2',
'test.gz',
'test.lrz',
'test.lz',
'test.lz4',
Expand Down
8 changes: 5 additions & 3 deletions fact_extractor/plugins/unpacking/sevenz/code/sevenz.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import logging
import os
from pathlib import Path

from common_helper_passwords import get_merged_password_set
from common_helper_process import execute_shell_command
Expand All @@ -13,8 +13,10 @@
NAME = '7z'
MIME_PATTERNS = [
# compressed archives
'application/gzip',
'application/rar',
'application/x-7z-compressed',
'application/x-gzip',
'application/x-iso9660-image',
'application/x-lzma',
'application/x-rar',
Expand All @@ -32,13 +34,13 @@
'filesystem/hfs',
'filesystem/ntfs',
]
VERSION = '0.8.2'
VERSION = '0.8.3'

UNPACKER_EXECUTABLE = '7z'

# Empty password must be first in list to correctly detect if archive has no password
PW_LIST = ['']
PW_LIST.extend(get_merged_password_set(os.path.join(get_src_dir(), 'unpacker/passwords')))
PW_LIST.extend(get_merged_password_set(Path(get_src_dir()) / 'unpacker/passwords'))


def unpack_function(file_path, tmp_dir):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ def test_extraction_password(self, test_file):
TEST_DATA_DIR / test_file, additional_prefix_folder='get_files_test', output=True
)
assert meta['password'] == 'test', 'password info not set'

def test_gzip_extraction(self):
input_file = TEST_DATA_DIR / 'test.gz'
files, meta_data = self.unpacker.extract_files_from_file(str(input_file), self.tmp_dir.name)
assert meta_data['plugin_used'] == '7z'
assert len(files) == 1
assert Path(files[0]).name == 'test.data'
assert 'Type = gzip' in meta_data['output']
assert 'Everything is Ok' in meta_data['output']
Loading