Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading offset 1

Status
Not open for further replies.

JFRobishow

Technical User
Jun 18, 2003
87
CA
Hi everyone,

I have a small base of C/C++ and know the basis of opening file and outputing to another. I never got real deep in it and I'm wondering if I could code something that would help me do what I need here.

I have a few thousands JPEG all with "file info" from Photoshop in them...using a HEX editor I've been able to find that the offset where the data is stored is always : 140[0x0000008C] and it end at 190 after that it's other stuff like timestamp, etc.

Any ressource somewhere online that would help me code something that would get the file info and then output it in a txt.

Thanks in advance! I appreciate it.
 
Ok started that myself with trial and error mostly.

I created a pointer opened the jpeg for reading and looped through until EOF printing each char with fgetc() and printing with putchar().

Tried opening the file in binary with "rb" and the info I need is printed at the beginning along with everything else though and a bunch of system beep.

I stopped looping until the EOF and specified value myself this time. I see the information I need printed on the screen, but there's also everything that came before it as well and a few chars until I reached the end of the loop.

I'm trying to get information from x to y bytes but can't seem to find any good information on how to do that online at least. Any help is appreciated.

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top