Skip to content

alternate data streams, print data #19

Answered by ColinFinck
theflakes asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! The NtfsAttributeValue object you got via attribute.value(fs)? implements the NtfsReadSeek trait to read the actual attribute value or move the read cursor inside the data stream.
The ntfs-shell example uses it here:

let mut buf = [0u8; 4096];
loop {
let bytes_read = data_value.read(&mut info.fs, &mut buf)?;
if bytes_read == 0 {
break;
}
output_file.write(&buf[..bytes_read])?;
}

In fact, NtfsReadSeek is also implemented for the more specific attribute value structures (such as NtfsResidentAttributeValue).

BONUS: If you need an object that implements the std::io-c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@theflakes
Comment options

Answer selected by theflakes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants