#include<stdio.h>
main()
{
 FILE *fp = fopen("test.jpg","rb");
 int c;
 while((c = fgetc(fp)) != EOF)
  printf("%02x",c);
 fclose(fp);
}