作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
您好,我正在尝试在原始文件中查找 jpeg
有人告诉我每个 jpeg 的开头都以
- 0xff 0xd8 0xff 0xe0
- 0xff 0xd8 0xff 0xe1
所以我这样做:
// open input file
FILE* inptr = fopen("card.raw", "r");
// create an array to hold info read from the memory card
char buffer[512];
int counter=0;
int counter2=0;
while ((fread(buffer, sizeof(char), 512, inptr)!=0))
{
if(buffer[0]==0xff)
{
counter++;
printf("%2d - Found a jpeg!\n", counter);
}
else
{
//Just to test
counter2++;
printf("%2d - Nothing Found!\n", counter2);
}
}
但是即使我确信那里有一些图像,程序也没有找到任何东西。预先感谢您的建议。
最佳答案
找到答案了!!,我需要像这样将缓冲区声明为无符号字符:
unsigned char buffer[512];
关于c - 尝试在使用 C 从存储卡中获取的原始文件中查找 jpeg 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12961531/
我是智能卡编程新手,所以请耐心等待.. 我正在尝试使用 WinSCard API 以语法方式访问 SLE4442 存储卡。从此处使用 pcscdiag.exe 工具访问卡时: http://scm-s
一些背景信息: 为了读取/写入 SLE4442 存储卡,我的应用目前正在使用 Omnikey Cardman 3021 USB 读卡器,一个能够包装 CT-API 调用(定向到 omnikey 的 d
我是一名优秀的程序员,十分优秀!