Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Fact:NTFS/struct/Attribute header

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:NTFS"
claim"An NTFS attribute header is 0x10 bytes (type, length, non-resident flag, name length/offset, flags, id) followed by a resident part (size, offset, indexed flag; 0x18 total) or a non-resident part (VCN range, run offset 0x20, sizes; 0x40 total, or 0x48 with total_size for the first segment of a compressed or sparse attribute)."
scope
level"format"
applies_to"Format:NTFS"
observed_in
Empty array
data
name"ATTRIB"
size_min"0x18"
endianness"little"
fields
offset"0x00"
size4
type"uint32_t"
name"type"
offset"0x04"
size4
type"uint32_t"
name"size"
offset"0x08"
size1
type"uint8_t"
name"non_res"
offset"0x09"
size1
type"uint8_t"
name"name_len"
offset"0x0A"
size2
type"uint16_t"
name"name_off"
offset"0x0C"
size2
type"uint16_t"
name"flags"
bits"0 compressed, 14 encrypted, 15 sparse"
offset"0x0E"
size2
type"uint16_t"
name"id"
offset"0x10"
size4
type"uint32_t"
name"res.data_size"
condition"resident"
offset"0x14"
size2
type"uint16_t"
name"res.data_off"
condition"resident"
offset"0x16"
size1
type"uint8_t"
name"res.flags"
condition"resident"
notes"1 = indexed"
offset"0x10"
size8
type"uint64_t"
name"nres.svcn"
condition"non-resident"
offset"0x18"
size8
type"uint64_t"
name"nres.evcn"
condition"non-resident"
offset"0x20"
size2
type"uint16_t"
name"nres.run_off"
condition"non-resident"
offset"0x22"
size1
type"uint8_t"
name"nres.c_unit"
condition"non-resident"
offset"0x28"
size8
type"uint64_t"
name"nres.alloc_size"
condition"non-resident"
offset"0x30"
size8
type"uint64_t"
name"nres.data_size"
condition"non-resident"
offset"0x38"
size8
type"uint64_t"
name"nres.valid_size"
condition"non-resident"
offset"0x40"
size8
type"uint64_t"
name"nres.total_size"
condition"non-resident, first segment (svcn 0) of a compressed or sparse attribute"
size_max"0x48"
evidence
type"source"
detail"ATTR_RESIDENT, ATTR_NONRESIDENT, ATTRIB, SIZEOF_RESIDENT 0x18, SIZEOF_NONRESIDENT 0x40 / _EX 0x48; ATTR_FLAG 0x0001/0x4000/0x8000 at 368-371"
repo"torvalds/linux"
commit"c03c1a14507dfaf8b856c2608f9ac216021fc222"
path"fs/ntfs3/ntfs.h"
lines"332-395"
type"source"
detail"struct ATTR_NONRESIDENT comment 'sizeof()=0x40 or 0x48 (if compressed)', total_size at 0x40; struct ATTR_RESIDENT flags at 0x16"
repo"torvalds/linux"
commit"c03c1a14507dfaf8b856c2608f9ac216021fc222"
path"fs/ntfs3/ntfs.h"
lines"332-371"
confidence"high"
related
Empty array
key"Attribute header"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-19T06:24:41.720Z"
verifications
operator"PatientStepper99"
date"2026-10-19T08:49:52.384Z"
result"confirmed"
method"Read fs/ntfs3/ntfs.h lines 330-400 at the cited commit: ATTRIB (type, size, non_res, name_len, name_off, flags, id) 0x10 bytes, ATTR_RESIDENT (data_size, data_off, flags, res) = 0x18, ATTR_NONRESIDENT (svcn, evcn, run_off 0x20, c_unit 0x22, alloc 0x28, data 0x30, valid 0x38, total_size 0x40 for the first segment of compressed attributes) = 0x40/0x48; flag values 0x0001, 0x4000, 0x8000. Matches."
revisions
by"PatientStepper99"
date"2026-10-19T08:05:14.829Z"
summary"non-resident header is 0x48 bytes, not always 0x40, when the stream is compressed/sparse (total_size at 0x40, first segment only); resident flags byte at 0x16 was missing"
changed
"claim"
"data"
"evidence"