diff options
| -rw-r--r-- | libmat/archive.py | 2 | ||||
| -rwxr-xr-x | mat | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/libmat/archive.py b/libmat/archive.py index 426dcf9..703ee66 100644 --- a/libmat/archive.py +++ b/libmat/archive.py | |||
| @@ -81,6 +81,8 @@ class ZipStripper(GenericArchiveStripper): | |||
| 81 | When list_unsupported is True, the method returns a list | 81 | When list_unsupported is True, the method returns a list |
| 82 | of all non-supported/archives files contained in the | 82 | of all non-supported/archives files contained in the |
| 83 | archive. | 83 | archive. |
| 84 | |||
| 85 | :param bool list_unsupported: Should the list of unsupported files be returned | ||
| 84 | """ | 86 | """ |
| 85 | ret_list = [] | 87 | ret_list = [] |
| 86 | zipin = zipfile.ZipFile(self.filename, 'r') | 88 | zipin = zipfile.ZipFile(self.filename, 'r') |
| @@ -41,7 +41,11 @@ def parse(): | |||
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | def list_meta(class_file, filename, add2archive): | 43 | def list_meta(class_file, filename, add2archive): |
| 44 | """ Print all the metadata of 'filename' on stdout | 44 | """ Print all the metadata of $filename on stdout |
| 45 | |||
| 46 | :param parser.GenericParser class_file: The class file representing $filename | ||
| 47 | :param str filename: File to parse | ||
| 48 | :param bool add2archive: Unused parameter, check the `main` function for more information | ||
| 45 | """ | 49 | """ |
| 46 | print('[+] File %s :' % filename) | 50 | print('[+] File %s :' % filename) |
| 47 | if class_file.is_clean(): | 51 | if class_file.is_clean(): |
| @@ -56,7 +60,12 @@ def list_meta(class_file, filename, add2archive): | |||
| 56 | 60 | ||
| 57 | 61 | ||
| 58 | def is_clean(class_file, filename, add2archive): | 62 | def is_clean(class_file, filename, add2archive): |
| 59 | """ Tell if 'filename' is clean or not """ | 63 | """ Tell if 'filename' is clean or not |
| 64 | |||
| 65 | :param parser.GenericParser class_file: The class file representing $filename | ||
| 66 | :param str filename: File to parse | ||
| 67 | :param bool add2archive: Unused parameter, check the `main` function for more information | ||
| 68 | """ | ||
| 60 | if class_file.is_clean(): | 69 | if class_file.is_clean(): |
| 61 | print('[+] %s is clean' % filename) | 70 | print('[+] %s is clean' % filename) |
| 62 | else: | 71 | else: |
| @@ -65,7 +74,12 @@ def is_clean(class_file, filename, add2archive): | |||
| 65 | 74 | ||
| 66 | 75 | ||
| 67 | def clean_meta(class_file, filename, add2archive): | 76 | def clean_meta(class_file, filename, add2archive): |
| 68 | """ Clean the file 'filename' """ | 77 | """ Clean the file 'filename' |
| 78 | |||
| 79 | :param parser.GenericParser class_file: The class file representing $filename | ||
| 80 | :param str filename: File to parse | ||
| 81 | :param bool add2archive: Unused parameter, check the `main` function for more information | ||
| 82 | """ | ||
| 69 | if not class_file.is_writable: | 83 | if not class_file.is_writable: |
| 70 | print('[-] %s is not writable' % filename) | 84 | print('[-] %s is not writable' % filename) |
| 71 | return 1 | 85 | return 1 |
