Skip to content

Commit ede97d5

Browse files
committed
feat: convert nop unpacker to new base class
1 parent 3190840 commit ede97d5

File tree

1 file changed

+13
-16
lines changed
  • fact_extractor/plugins/unpacking/nop/code

1 file changed

+13
-16
lines changed
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
"""
2-
This plugin does not unpack any files files.
2+
This plugin does not unpack any files.
33
"""
44

5-
NAME = 'NOP'
6-
MIME_PATTERNS = ['generic/nop', 'inode/symlink']
7-
VERSION = '0.1'
5+
from plugins.base_class import UnpackingPlugin
86

97

10-
def unpack_function(*_, **__):
11-
"""
12-
file_path specifies the input file.
13-
tmp_dir should be used to store the extracted files.
14-
Optional: Return a dict with meta information
15-
"""
16-
return {'info': 'unpacking skipped'}
8+
class NopUnpacker(UnpackingPlugin):
9+
NAME = 'NOP'
10+
MIME_PATTERNS = ('generic/nop', 'inode/symlink')
11+
VERSION = '0.1'
1712

18-
19-
# ----> Do not edit below this line <----
20-
def setup(unpack_tool):
21-
for item in MIME_PATTERNS:
22-
unpack_tool.register_plugin(item, (unpack_function, NAME, VERSION))
13+
def unpack_file(self, *_, **__):
14+
"""
15+
file_path specifies the input file.
16+
tmp_dir should be used to store the extracted files.
17+
Optional: Return a dict with meta information
18+
"""
19+
return {'info': 'unpacking skipped'}

0 commit comments

Comments
 (0)