PDA

View Full Version : Reading directly from a partition in C



MikeBenza
December 31st, 2007, 12:56 AM
I'm trying to read directly from a partition, /dev/sda1. When I try to read though, I get different data than I see at the beginning of the partition in hexedit. Any clues on how to read byte for byte from a partition?

- Mike

yabbadabbadont
December 31st, 2007, 01:02 AM
Look at the source code for hexedit and see how they do it. ;)

You should probably post the code that you are using to open the device and read from it.

MikeBenza
December 31st, 2007, 09:13 AM
The problem I was having was that I wasn't running the resulting application with sudo, so it was reading (I suppose) the first user-accessible part of the partition, rather than the first super-user accessible part.