Releases: jivanpal/drat
Drat 0.1.3
Functional changes
-
Linux support added (tested under Ubuntu 20.04.3). From this version onwards, binaries for Linux on x86-64 will also be provided for versioned releases. Some more general code portability provisions have also been made.
-
drat inspectnow automatically detects the APFS block size, based on the block size value provided by the container superblock found at block 0. -
Extended fields (xfields) are now supported.
-
drat recovernow gets the actual file size and thus outputs files of the correct size rather than a multiple of the APFS block size. The tools in/supplemental-toolshave thus been removed. (Issue #2). -
UUIDs are now printed in standard format.
-
Fixed bug in
get_nx_incompatible_features_string()andget_nx_flags_string()that caused these functions to analyse thenx_featuresfield instead. -
drat versionnow outputs legal info (copyright notice, warranty, and licence).
Other changes
-
Refactored libraries:
-
/includehas been added to the compilation include path to avoid use of relative paths. -
/src/apfs/structhas moved to/include/apfs, and can thus be included as<apfs>. This library contains headers that define all data structures detailed in Apple's APFS specfication. -
The remainder of
/src/apfshas moved to/include/drat, and can thus be included as<drat>. This library contains functionality specific to Drat:-
Headers in
<drat/func>define functions that facilitate common operations on data strctures provided by<apfs>; -
Headers in
<drat/string>define functions that produce human-readable strings/output detailing the data contained in data structures provided by<apfs>; and -
Headers in
<drat>define miscellaneous functions.
-
-
-
Refactored code:
-
String generation functions that operate on enum fields have had their shared code factored into
<drat/string/common.h>asget_single_enum_string()andget_flags_enum_string(). -
Use of
ctime()for printing timestamps has been factored intoget_apfs_timestamp_string().
-
-
Documentation for v0.2.x has been drafted in
/docsusing Sphinx.
Drat 0.1.2
-
Renamed
src/apfs/struct/const.htosrc/apfs/struct/jconst.h -
Updated symbol/struct definitions in
src/apfs/structto align with the latest APFS spec revision (2020-06-22). This included adding a new filesealed.hwith the definitions contained in the new chapter of the spec, §16 Sealed Volumes. A detailed list of changes follows:-
§3 Objects —
object.h-
§3.1 Object Types
OBJECT_TYPE_ER_RECOVERY_BLOCKOBJECT_TYPE_SNAP_META_EXTOBJECT_TYPE_INTEGRITY_METAOBJECT_TYPE_FEXT_TREEOBJECT_TYPE_RESERVED_20OBJECT_TYPE_MEDIA_KEYBAG
-
-
§5 Container —
nx.h-
§5.2
nx_superblock_tnx_newest_mounted_versionnx_mkb_locker
-
-
§6 Object Maps —
omap.h-
§6.7 Object Map Flags
OMAP_VALID_FLAGS
-
-
§7 Volumes —
fs.h-
§7.1
apfs_superblock_tapfs_cloneinfo_id_epochapfs_cloneinfo_xidapfs_snap_meta_ext_oidapfs_volume_group_idapfs_integrity_meta_oidapfs_fext_tree_oidapfs_fext_tree_typereserved_typereserved_oid
-
§7.3 Volume Flags
APFS_FS_RESERVED_80APFS_FS_RESERVED_100APFS_FS_FLAGS_VALID_MASK(name corrected from erroneousAPFS_FS_FALGS_VALID_MASK)
-
§7.4 Volume Roles
APFS_VOL_ROLE_UPDATEAPFS_VOL_ROLE_XARTAPFS_VOL_ROLE_HARDWAREAPFS_VOL_ROLE_BACKUPAPFS_VOL_ROLE_RESERVED_7APFS_VOL_ROLE_RESERVED_8(name changed fromAPFS_VOL_ROLE_RESERVED_200)APFS_VOL_ROLE_ENTERPRISEAPFS_VOL_ROLE_RESERVED_10APFS_VOL_ROLE_PRELOGIN
-
§7.5 Optional Volume Feature Flags
APFS_FEATURE_STRICTATIMEAPFS_FEATURE_VOLGRP_SYSTEM_INO_SPACE
-
§7.7 Incompatible Volume Feature Flags
APFS_INCOMPAT_INCOMPLETE_RESTOREAPFS_INCOMPAT_SEALED_VOLUME
-
-
§8 File-System Objects —
j.h-
§8.1
j_key_tSYSTEM_OBJ_ID_MARK
-
§8.3
j_inode_val_tuncompressed_size
-
-
§9 File-System Constants —
jconst.h-
§9.1
j_obj_typesAPFS_TYPE_FILE_INFO
-
§9.3
j_inode_flagsINODE_FAST_PROMOTEINODE_HAS_UNCOMPRESSED_SIZEINODE_IS_PURGEABLEINODE_WANTS_TO_BE_PURGEABLEINODE_IS_SYNC_ROOTINODE_SNAPSHOT_COW_EXEMPTION
-
§9.6 Inode Numbers
PURGEABLE_DIR_INO_NUMUNIFIED_ID_SPACE_MARK
-
§9.7 Extended Attributes Constants
FIRMLINK_EA_NAMEAPFS_COW_EXEMPT_COUNT_NAME
-
-
§11 Extended Fields —
xf.h-
§11.3 Extended-Field Types
INO_EXT_TYPE_PURGEABLE_FLAGSINO_EXT_TYPE_ORIG_SYNC_ROOT_ID
-
-
§13 Snapshot Metadata —
snap.h- New datatype: §13.6
snap_meta_ext_obj_phys_t - New datatype: §13.7
snap_meta_ext_t
- New datatype: §13.6
-
§14 B-Trees —
btree.h-
New datatype: §14.4
btn_index_node_val_t -
§14.8 B-Tree Flags
BTREE_HASHEDBTREE_NOHEADER
-
§14.10 B-Tree Node Flags
BTNODE_HASHEDBTNODE_NOHEADER
-
-
§15 Encryption —
crypto.h-
§15.7 Protection Classes
PROTECTION_CLASS_M
-
§15.8 Encryption Identifiers
APFS_UNASSIGNED_CRYPTO_ID
-
§15.12 Keybag Tags
KB_TAG_WRAPPING_M_KEYKB_TAG_VOLUME_M_KEY
-
-
New chapter: §16 Sealed Volumes —
sealed.h-
New datatype: §16.1
integrity_meta_phys_t -
§16.2 Integrity Metadata Version Constants
INTEGRITY_META_VERSION_INVALIDINTEGRITY_META_VERSION_1INTEGRITY_META_VERSION_2INTEGRITY_META_VERSION_HIGHEST
-
§16.3 Integrity Metadata Flags
APFS_SEAL_BROKEN
-
§16.4
apfs_hash_type_tAPFS_HASH_INVALIDAPFS_HASH_SHA256APFS_HASH_SHA512_256APFS_HASH_SHA384APFS_HASH_SHA512APFS_HASH_MINAPFS_HASH_MAXAPFS_HASH_DEFAULT
-
New datatype: §16.5
fext_tree_key_t -
New datatype: §16.6
fext_tree_val_t -
New datatype: §16.7
j_file_info_key_tJ_FILE_INFO_LBA_MASKJ_FILE_INFO_TYPE_MASKJ_FILE_INFO_TYPE_SHIFT
-
New datatype: §16.8
j_file_info_val_t -
§16.9
j_obj_file_info_typeAPFS_FILE_INFO_DATA_HASH
-
New datatype: §16.10
j_file_data_hash_val_t
-
-
§17 Space Manager —
spaceman.h- New datatype: §17.4
spaceman_free_queue_entry_t
- New datatype: §17.4
-
-
Updated existing functions in
src/apfs/stringto handle new symbols:-
In
btree.c:get_btn_flags_string()get_bt_info_flags_string()
-
In
fs.c:get_apfs_features_string()get_apfs_incompatible_features_string()get_apfs_fs_flags_string()get_apfs_role_string()print_apfs_superblock()
-
In
j.cget_j_inode_internal_flags()print_j_inode_val()
-
In
nx.c:get_nx_flags_string()print_nx_superblock()
-
In
object.c:get_o_type_string()get_o_subtype_string()
-
Drat 0.1.1
-
Fixed bug in
get_o_type_string()where the "Unknown type" output did not correctly display the hex value of the type field (o_type & OBJECT_TYPE_MASK). -
Re-implemented (and hopefully fixed all bugs in) the B-tree routines in
src/apfs/func/btree.c. Of particular note:-
get_btree_phys_omap_val()is deprecated and replaced withget_btree_phys_omap_entry(), which allows the caller to see the XID of the returned entry. -
get_fs_records()is now more efficient, as it no longer makes multiple descents from the root node just to access multiple records in the same leaf node. Instead, we now just walk along the leaf node, making new descents only when we need to access a different node.
-
Drat 0.1.0
Initial release, basically the same as the prior apfs-tools commands, but packaged into a single drat command. Recognised commands and their functionality are highly subject to change for now. The current list of commands is:
List of commands:
explore-fs-tree Explore filesystem B-tree
explore-omap-tree Explore object map B-tree
inspect Inspect APFS partition
list-raw List directory contents or file info based on its filesystem OID
list List directory contents or file info based on its filepath
read Read a block and display information about it
recover-raw Recover a file based on its filesystem OID
recover Recover a file bsaed on its filepath
resolver Check if given Virtual OIDs resolve to given Physical OIDs
search-last-btree-node Search the partition for B-tree nodes, reporting the Physical OID of the last one discovered
search Search the partition for blocks with certain features/properties
version Display Drat's version info