如果有人能帮我弄清楚为什么这个功能不起作用,我将不胜感激.提前致谢.
以下是该函数API的链接:TSK_FS_OPEN_IMG()
这是我的代码:
using namespace std;#include <tsk3/libtsk.h>#include <iostream>#include <string.h>int main (int argc,const char * argv[]){TSK_img_TYPE_ENUM imgtype = TSK_img_TYPE_DETECT;TSK_img_INFO *img;TSK_FS_TYPE_ENUM fstype = TSK_FS_TYPE_fat32;TSK_FS_INFO *fs;TSK_DADDR_T imgOffset = 0x00000000;TSK_OFF_T fsstartBlock = 0x00000063;TSK_VS_INFO *vs;TSK_VS_TYPE_ENUM vstype = TSK_VS_TYPE_DETECT;const TSK_VS_PART_INFO *part;TSK_PNUM_T partLocation = part -> addr;TSK_TCHAR *drivename;TSK_DADDR_T startAddress = 0x00000000;TSK_DADDR_T numBlocksToRead = 0x00000001;TSK_FS_BLKCAT_FLAG_ENUM flags = TSK_FS_BLKCAT_ASCII;int numOfdrives = 1;uint sectorSize = 0;uint8_t blockBytes = 0;if (argc < 1) { printf("You must enter a drive name.\n"); exit(EXIT_FAILURE);}drivename = (TSK_TCHAR*) argv[1];cout << "\nopening Drive\n\n";if((img = tsk_img_open(numOfdrives,&drivename,imgtype,sectorSize)) == NulL) { tsk_error_print(stderr); exit(EXIT_FAILURE);}cout << "Drive opened successfuly.\n\n";cout << "opening file System\n\n";if((fs = tsk_fs_open_img(img,fsstartBlock,fstype)) == NulL) { tsk_error_print(stderr); if (tsk_errno == TSK_ERR_FS_UNSUPTYPE) tsk_fs_type_print(stderr); img -> close(img); exit(EXIT_FAILURE);}cout << "file system opened successfuly.\n\n";blockBytes = tsk_fs_blkcat(fs,flags,startAddress,numBlocksToRead);fs -> close(fs);img -> close(img);return 0;}解决方法 tsk_fs_open_img的偏移量参数以字节为单位,而不是扇区.因此,您需要将fsstartBlock乘以img-> sector_size. 总结
以上是内存溢出为你收集整理的c – 使用Sleuth Kit函数tsk_fs_open_img()返回FS不是FAT FS的错误全部内容,希望文章能够帮你解决c – 使用Sleuth Kit函数tsk_fs_open_img()返回FS不是FAT FS的错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)