Skip to content

Instantly share code, notes, and snippets.

@JonathonReinhart
Created July 19, 2022 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathonReinhart/ef92046fb9ff51168699247f1227a3fc to your computer and use it in GitHub Desktop.
Save JonathonReinhart/ef92046fb9ff51168699247f1227a3fc to your computer and use it in GitHub Desktop.
Magic file for partclone image format
# This is a magic(5) description for partclone(8) output files.
# References:
# https://github.com/Thomas-Tsai/partclone/blob/master/src/partclone.h
# Structure: `image_head_v2`
# magic (16)
0 string partclone-image Partclone image
################################################################################
# Version 1
# version (Image's version)
>30 string 0001 \b (version 1)
################################################################################
# Version 2
# version (Image's version)
>30 string 0002 \b (version 2)
# ptc_version (14)
>>16 string/T >\0 \b, from partclone v%s
# Structure `file_system_info_v2` follows `image_head_v2` (?)
### Little-endian
# endianness
>>34 leshort 0xC0DE \b, little-endian
# fs (File system type)
>>>36 string/T >\0 \b, fs: "%s"
# device_size
>>>52 lequad x \b, device size: %lld
# totalblock
>>>60 lequad x \b, total blocks: %lld
# usedblocks
>>>68 lequad x \b, used blocks: %lld
# used_bitmap
>>>76 lequad x \b, used bitmap: %lld
# block_size
>>>84 lelong x \b, block size: %d
### Big-endian
# endianness
>>34 beshort 0xC0DE \b, big-endian
# fs (File system type)
>>>36 string/T >\0 \b, fs: "%s"
# device_size
>>>52 bequad x \b, device size: %lld
# totalblock
>>>60 bequad x \b, total blocks: %lld
# usedblocks
>>>68 bequad x \b, used blocks: %lld
# used_bitmap
>>>76 bequad x \b, used bitmap: %lld
# block_size
>>>84 belong x \b, block size: %d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment