A program that allows you to read raw chunks of a disk or a file.
DiskRead aims to replace
xxd or
hexdump present on Linux, but for Windows. Furthermore, the low-level WinAPI functions enable DiskRead to access any file, including boot sectors and disks, both for reading and writing. By operating at the sector level, it allows developers and system administrators to inspect raw data structures, perform low-level backups, and analyze filesystem corruption directly from the command line without interference from the operating system's standard file locks.
diskread <drive | file> [-b <bytes per line>] [-e <export file>] [-h] [-o <offset>] [-s <read size>] [-u] [-x] [-y]
-
-b, --bytes <bytecount>
Change the number of bytes per line displayed
-
-e, --export <file>
Export to a file
-
-h, --hideoffset
Hide the offset display
-
-o, --offset <offset>
Set a custom starting offset for the file
-
-s, --size <read size>
Read a specific amount of bytes from the file. 512 bytes are read by default
-
-u, --uppercase
Display hexadecimal values in uppercase
-
-x, --hexadecimal
Only display the hexadecimal representation
-
-y, --yes
Do not prompt for confirmation when exporting to a device file
-
diskread \\.\PhysicalDrive0 -s 512 -o 0 -e bootsect.bak
Reads the first 512 bytes from physical drive 0 and writes them to bootsect.bak (a boot sector backup). The boot sector can be restored if needed using diskread bootsect.bak -s 512 -o 0 -e \\.\PhysicalDrive0.
-
diskread file.txt -s 40 -o 10 -h
Prints 40 bytes from file.txt, starting to read at the 10th byte without displaying the offset.
-
diskread image.png -x -u -b 12
Prints only 512 bytes of image.png in uppercase hexadecimal, displaying 12 bytes per line.
DiskRead is a tiny and fast program, yet powerful, portable, and easy to use. It's the perfect tool for backing up the boot sector, viewing the raw data of files and disks, or using it as a hexadecimal dumping tool for Windows. Unlike graphical hex editors that may struggle with massive drives or require installation, DiskRead operates seamlessly in constrained environments and batch scripts. It bridges the gap for users who need a robust, native WinAPI solution for inspecting system internals or recovering overwritten sector data.
DiskRead is highly compatible across Windows environments, ranging from the old Windows XP to the latest version, Windows 11.
If you want to dive deeper into the history and technical details of the project, some time ago I wrote an article on
Batch-Man explaining an older version of DiskRead in-depth.
Read the
article here.
If you found a bug or want to add a new feature, don't hesitate to create a
pull request
or an
issue!
Contributions are greatly appreciated.