开发者

Reading a hard drive low level byte by byte

开发者 https://www.devze.com 2023-02-17 21:44 出处:网络
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

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

精彩评论

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