aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdump_sector.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/dump_sector.sh b/dump_sector.sh
new file mode 100755
index 0000000..fdcf2d0
--- /dev/null
+++ b/dump_sector.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# dump a sector(s) from a raw dump (2352 byte sectors) or 'cooked' data
+# track (2048 byte sectors).
+
+if [ "$1" = "" -o "$1" = "--help" ]; then
+ cat <<EOF
+Usage: $( basename $0 ) [-i] filename sector [sector_count]
+-i is "ISO mode", 2048 byte sectors.
+EOF
+ exit 0
+fi
+
+secsize=2352
+if [ "$1" = "-i" ]; then
+ secsize=2048
+ shift
+fi
+
+filename="$1"
+
+sector="$2"
+count="${3:-1}"
+
+dd if="$filename" bs="$secsize" skip="$sector" count="$count" | xxd | less