开发者

Reading a hard drive low level byte by byte

I could read the bytes of a file by opening it for binary and then using the "Get" statement. does anyone know of any such method to do the same fo开发者_C百科r reading of a whole drive?


fopen("/dev/sda","r")

A little trickier on windows

// note need share write for NTFS even for read only`
HANDLE hRaw = CreateFile("\\\\.\\C:",GENERIC_READ,
                    FILE_SHARE_READ | FILE_SHARE_WRITE,
                    NULL,OPEN_EXISTING,FILE_FLAG_NO_BUFFERING, NULL);        

But since it isn't going to do you any good without some serious knowledge of NTFS internals that doesn't really matter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜