demize / grim-old

newt-based GUI for ewfacquire
MIT License
0 stars 0 forks source link

Create imaging system #2

Open demize opened 6 years ago

demize commented 6 years ago

We need an imaging system that reads data in (in a way we can keep track of how much progress is made) and pipe that data out to ewfacquirestream. This system can also be used for verification so long as we write it correctly (that is, have the read function able to read from an arbitrary file and write to an arbitrary pipe).

demize commented 6 years ago

libewf appears to use mmap/memcpy to read files. That's not the approach I'm going to use here; we don't need random reads, so I will use fopen/pread.

This will make error granularity a bit easier as well; if we get the physical block size using ioctl (see this StackOverflow answer for more details) then we can fill just one sector with zeroes and read from the next one. ioctl will also be useful for other things here, since it can provide the size of the drive, and we can use it to ensure we read whole sectors at once rather than breaking sectors apart.