Imagens forenses E01 e Ex01: leitura (deflate, bzip2, padrão, multi-segmento) e gravação de E01
Validado contra o libewf (ewfverify) e imagens de referência geradas por ele. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c3b5f79009
commit
627eae1b8b
10 files changed
+1031
-1
No files matched your search
@@ -272,7 +272,14 @@ pub fn open_path(path: &Path) -> io::Result<Arc<dyn Source>> {
|
||||
return Ok(Arc::new(open_windows_device(path)?));
|
||||
}
|
||||
}
|
||||
Ok(Arc::new(FileSource::open(path)?))
|
||||
let file = FileSource::open(path)?;
|
||||
// Imagens forenses EWF (E01/Ex01) são abertas como o disco que contêm.
|
||||
let mut head = [0u8; 8];
|
||||
if file.read_at(0, &mut head).unwrap_or(0) == 8 && crate::ewf::is_ewf_header(&head) {
|
||||
let e = crate::ewf::EwfSource::open(path).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e.to_string()))?;
|
||||
return Ok(Arc::new(e));
|
||||
}
|
||||
Ok(Arc::new(file))
|
||||
}
|
||||
|
||||
/// Identidade do conteúdo de um disco: SHA-256 do tamanho + primeiro e último MiB
|
||||
|
||||
Reference in new issue
Block a user