91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-16
  • 語言: C/C++
  • 標簽: C++扇區??

資源簡介

可從指定編號的扇區開始讀取指定個字節的數據,支持硬盤、U盤和SD卡的數據讀取。

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?se.h>


//以下是讀取硬盤扇區函數
int?ReadPhysicalSector(unsigned?long?SectorStart?unsigned?long?SectorCount?unsigned?char?*p)
{
????unsigned?long?BytesPerSector?=?512;
????unsigned?long?nBytes;
????char?Drive[]?=?“\\\\.\\PHYSICALDRIVE0“;
????int?result?=?0;
????HANDLE?hDeviceHandle?=?CreateFile(DriveGENERIC_READFILE_SHARE_READNULLOPEN_EXISTING00);
????if(hDeviceHandle)
????{
????????long?pointer;
????????long?phigh;
????????pointer?=?SectorStart;
????????pointer?=?pointer*BytesPerSector;
????????phigh?=?pointer>>32;
????????SetFilePointer(hDeviceHandle(unsigned?long)pointer&phighFILE_BEGIN);
????????if(ReadFile(hDeviceHandlepSectorCount*BytesPerSector&nBytesNULL))
????????????result?=?1;
????????CloseHandle(hDeviceHandle);
????}
????return?result;
}

//主函數調用
int?main(int?argc?char*?argv[])
{
????unsigned?long?SectorStart?=?0; //比如我要讀的是編號為的那個扇區開始的數據這里寫
????????????????????????????????????//如果讀的是從第扇區開始后的數據這里就寫
????unsigned?long?SectorCount?=?1;??//讀多少個扇區這里是個
????unsigned?char?p[512]; ????//一個扇區數據量是字節呀
int?i;
????ReadPhysicalSector(SectorStartSectorCountp);
//輸出的
????for(i=0;i<512;i++)
????{
????????printf(“%02X?“p[i]);
????????if(i%26?==?0)
{
????????????printf(“?“);
}
????}
????return?0;
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-09-23?09:42??ReadHddSector\
?????目錄???????????0??2008-04-08?17:03??ReadHddSector\Debug\
?????文件????????1456??2008-04-08?14:40??ReadHddSector\ReadSector.c
?????文件????????3447??2008-04-08?14:02??ReadHddSector\ReadSector.dsp
?????文件?????????543??2008-04-08?14:36??ReadHddSector\ReadSector.dsw
?????文件???????33792??2008-04-08?14:49??ReadHddSector\ReadSector.ncb
?????文件???????48640??2008-04-08?14:49??ReadHddSector\ReadSector.opt
?????文件?????????754??2008-04-08?14:35??ReadHddSector\ReadSector.plg

評論

共有 條評論

相關資源