find length of file depend on end marker

Posted on 2011-10-31
Last Modified: 2012-05-12

after i run this command to search about end marker of jpeg file:

xxd image.raw | grep -i "ffd9" | head -n 7 ===>

0082560 2903 9068 ffd9 4bb1 f6d2 c69c 1a4c 7195      (..h[.K......nq

how i can calculate length of jpeg file include footer depend on output ?

Question by:ang3lus
    LVL 9

    Expert Comment

    Search for FFD8 which is the start of image and FFD9 which is the end of image, you'll then get the image size. Refer to detail JPG format here for more information.

    Author Comment


    there is no possible to find length of file depend only on output.

    cause the
    the solution of above question is from output :

    ffd9 end at 0082565 and the length of file is 0082566.

    I am not understand how 0082565 has been calculated and how length become 0082566( 0082565 +1)

    LVL 9

    Accepted Solution

    As the dump starts from byte 0 of the file, as shown in the output 29 is the 82560'th byte, d9 is the 82565'th byte, adding byte 0 will get the total file length of 82566.

    Author Closing Comment

    many Thanks

    you are helping me alot

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    The foremost challenge encountered by an investigator at the very beginning of a forensics investigation is, accessing a file/data to read/view its contents. Owing to the fact, a platform is necessary for both; opening as well as examining any file.…
    In this era, as you know, cybercrime and other sorts of frauds using the internet has increased day by day. We should protect our information assets and confidential information from getting exploiting by the attacker or intruders. Most of the fraud…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now