Skip to content

Using attribute length instead of allocated size for nonresident $DATA runlist? #92

@crotron

Description

@crotron

In the definition of attr_nonresident_fmt, I notice that the runlist is specified to depend on the runlist_offset and the allocated_size. Is there any reason, at least in theory, why it shouldn't also be possible to use the attribute's length (defined in attr_header_fmt) for this as an alternative?

The reason I ask is because for some very large files, I have MFT records that look like this:

image

After the start of the record, there's a $DATA attribute that starts at an offset of 0x38. The length of it is specified to be 0xF0, or 240 (15 rows). Counting down 15 rows from the start of the attribute, you end up at the MFT record terminator at the end of the runlist. So it appears to me that it could potentially be used, at least in this specific scenario.

One other thing that can be noted is that the last 3 8-byte words before the start of the runlists are all zeros (corresponding to allocated_size, real_size, and initialized_size). I can't explain why this is the case - I doubt it is random disk corruption since I see this specific thing happening in several other MFT records that otherwise look perfectly normal. Maybe it could be a software bug, or maybe it is just supposed to be this way due to the unusual circumstances that I find this occurring in (namely, inside a MFT record that is being provided by a nonresident $ATTRIBUTE_LIST from another MFT record). In any case, it seems like RecuperaBit looks at one or more of those sizes when parsing the format, decides the runlist is of length 0 based on those size values, and stops without having processed any of the runlist. As a result, when it is time to reconstruct the file, there are some missing sections of data, which can cause the output file to become corrupted and/or blank (ERROR:root:Cannot restore $DATA attribute(s) for File(...)).

I think, if it were to use the attribute length instead (assuming that is even a valid thing to do) it may be possible to reconstruct the file in situations where you cannot rely on the sizes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions