Thank you for your reply. Actually what I am trying to do is to carve JPEG images from a dataset (like CSI). This dataset is an imaged from a corrupted hard disk, which all files in the hard disk will be mirrored as one single file in hex values. These images, mixed with different files and their own,can be viewed using hex editor.
There are many types of file such as word, pdf, bmp, png and so on, all in hex values. My interest is only on JPEG files. Some JPEG can carve directly because it is complete and not fragmented, but some JPEG files are fragmented, either with other types or its own. To be noted, the dataset is missing of its FAT, so we cannot allocate the files using cluster address. So, I need to recognize where the fragmentation point as I explain before. Thank you