File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ pub mod gif;
158
158
pub mod gpg;
159
159
pub mod gzip;
160
160
pub mod inflate;
161
+ pub mod iso9660;
161
162
pub mod jboot;
162
163
pub mod jffs2;
163
164
pub mod jpeg;
Original file line number Diff line number Diff line change
1
+ use crate :: extractors;
2
+ use crate :: extractors:: sevenzip:: sevenzip_extractor;
3
+
4
+ /// Describes how to run the 7z utility to extract ISO images
5
+ ///
6
+ /// ```
7
+ /// use std::io::ErrorKind;
8
+ /// use std::process::Command;
9
+ /// use binwalk::extractors::common::ExtractorType;
10
+ /// use binwalk::extractors::iso9660::iso9660_extractor;
11
+ ///
12
+ /// match iso9660_extractor().utility {
13
+ /// ExtractorType::None => panic!("Invalid extractor type of None"),
14
+ /// ExtractorType::Internal(func) => println!("Internal extractor OK: {:?}", func),
15
+ /// ExtractorType::External(cmd) => {
16
+ /// if let Err(e) = Command::new(&cmd).output() {
17
+ /// if e.kind() == ErrorKind::NotFound {
18
+ /// panic!("External extractor '{}' not found", cmd);
19
+ /// } else {
20
+ /// panic!("Failed to execute external extractor '{}': {}", cmd, e);
21
+ /// }
22
+ /// }
23
+ /// }
24
+ /// }
25
+ /// ```
26
+ pub fn iso9660_extractor ( ) -> extractors:: common:: Extractor {
27
+ // Same as the normal 7z extractor, but give the carved file an ISO file extension.
28
+ // The file extension matters, and 7z doesn't handle some ISO sub-formats correctly if the file extension is not '.iso'.
29
+ let mut extractor = sevenzip_extractor ( ) ;
30
+ extractor. extension = "iso" . to_string ( ) ;
31
+ extractor
32
+ }
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ pub fn patterns() -> Vec<signatures::common::Signature> {
168
168
magic: signatures:: iso9660:: iso_magic( ) ,
169
169
parser: signatures:: iso9660:: iso_parser,
170
170
description: signatures:: iso9660:: DESCRIPTION . to_string( ) ,
171
- extractor: Some ( extractors:: tsk :: tsk_extractor ( ) ) ,
171
+ extractor: Some ( extractors:: iso9660 :: iso9660_extractor ( ) ) ,
172
172
} ,
173
173
// linux kernel
174
174
signatures:: common:: Signature {
You can’t perform that action at this time.
0 commit comments