d523d3213b
Taken from a posting by Wolfgang S. Rupprecht to netbsd-users on April 26th. Fatback is a forensic tool for undeleting files from FAT file systems. Fatback is different from other undelete tools in that it does the following: * Runs under UNIX environments * Can undelete files automatically * Supports Long File Names * Supports FAT12, FAT16, and FAT32 * Powerful interactive mode * Recursively undeletes deleted directories * Recovers lost cluster chains * Works with single partitions or whole disks
23 lines
768 B
Text
23 lines
768 B
Text
$NetBSD: patch-ab,v 1.1.1.1 2005/05/25 10:29:01 agc Exp $
|
|
|
|
--- recovery.c 2005/05/25 10:11:56 1.1
|
|
+++ recovery.c 2005/05/25 10:13:54
|
|
@@ -85,10 +85,18 @@
|
|
fname);
|
|
|
|
chainlen = chain_length(clusts, cluster);
|
|
+#if 0
|
|
reqd_clusts = size / bytes_per_clust;
|
|
reqd_clusts += !!(size % bytes_per_clust);
|
|
+#else
|
|
+ /* this doesn't assume !! returns 0 or 1 */
|
|
+ reqd_clusts = (size + bytes_per_clust - 1) / bytes_per_clust;
|
|
+#endif
|
|
if (chainlen < reqd_clusts) {
|
|
display(VERBOSE, log_carve, fname);
|
|
+ display(VERBOSE, "Need: %d got: %d Missing: %d bytes\n",
|
|
+ size, chainlen * bytes_per_clust,
|
|
+ size - (chainlen * bytes_per_clust));
|
|
carve_file(clusts, cluster, size, bytes_per_clust, file);
|
|
return 0;
|
|
}
|