From 76e86b2f0231d96c9ad69edb76677900c56eeec5 Mon Sep 17 00:00:00 2001 From: LukasEpheser Date: Wed, 23 Nov 2022 16:25:39 +0100 Subject: [PATCH] add image signature to return dict --- .../draytek_vigor_167/code/draytek_vigor_167.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fact_extractor/plugins/unpacking/draytek_vigor_167/code/draytek_vigor_167.py b/fact_extractor/plugins/unpacking/draytek_vigor_167/code/draytek_vigor_167.py index 75cf26bb..f9b34ebb 100644 --- a/fact_extractor/plugins/unpacking/draytek_vigor_167/code/draytek_vigor_167.py +++ b/fact_extractor/plugins/unpacking/draytek_vigor_167/code/draytek_vigor_167.py @@ -44,7 +44,17 @@ def unpack_function(file_path, tmp_dir): output_file_path = Path(tmp_dir) / 'squashfs_root' write_binary_to_file(squashfs, output_file_path) - return {'output': 'successfully unpacked image'} + return { + 'output': 'successfully unpacked image', + 'file_header': { + 'magic_field': signature[0], + 'header_size': signature[1], + 'file_size': signature[2], + 'crc32': signature[3], + 'kernel_size': signature[4], + 'squashfs_size': signature[5] + }, + } # ----> Do not edit below this line <----