I'm not sure if I use correctly the hexadecimal notation to verify if there is a .jpeg signature in the beginning of my BLOCK of 512 bytes. My program compile well but no photograph is revealed. May be someone can help me with that? Here a part of my code. Great thanks for your time.
int main(int argc, char* argv[])
{
typedef uint8_t BYTE;
typedef uint32_t SIGN;
SIGN buffer[BLOCK];
int count = 0;
FILE* pic;
char picname[8];
// open file
FILE* inptr = fopen("card.raw", "r");
char* name = "card.raw";
if (inptr == NULL)
{
printf("Could not open %s.\n", name);
return 1;
}
// until end of data is reached
while (fread(&buffer, BLOCK, 1, inptr) == 1)
{
// read 512 bytes
// fread(&buffer, BLOCK, 1, inptr);
printf("%0x\n", buffer[0]);
printf("%0x\n", 0xffd8ffe0);
if (buffer[0] == 0xffd8ffe0 || buffer[0] == 0xffd8ffe1)
{
if (count > 0)
{