Scan a file for partition tables and print those found. Treats files as collections of 512-byte sectors and treats any 'sector' that has the magic bytes 0x55,0xAA at offset 0x1FE (510) as a valid partition table. Cannot be used with device files because it uses mmap() to map file contents into memory. Example output: Base: decimal File: 512 z-part-table.1.sector0.bin Searching... Done. Signature found. sector: 0 offset: 0 0 A 77 0 0 0 0 0 0 1 1000 (next 1001) 1 69 0 0 0 0 0 0 1001 128 (next 1129) 2 70 0 0 0 0 0 0 1129 9000 (next 10129) 3 5 0 0 0 0 0 0 10129 4544622 (next 4554751) Usage: part-list [-d] -f version 1.0.0 Copyright 2010 TJ Licensed under the terms of the GNU GPL v3 -d print values in decimal not hexadecimal -f path to the file containing the partition table (it is scanned for sectors containing the signature) Information messages are written to stderr and only partition tables are written to stdout. This allows the output to be piped through other filters. = Build = make make clean = Cross-build for ARM = Assuming the Code Sourcery G++ ARM cross-tools are installed in the path, the program can be built and statically linked to be a self-contained executable to run on ARM-base devices such as Android smart-phones. make LDFLAGS=-static CC=arm-none-linux-gnueabi-gcc make clean