i have a FAT16 image and i would like to copy the data stored at a specific memory location in this image in C.
If opening the myfat16.img file with hexedit gives
0000A320 44 54 FC 0C 19 85 13 E9 F6 D5 20 7F 56 24 EB A7 DC 2F 54 7A 20 10 9F 80 54 45 BB AE E9 C2 6E 08 08 4F 01 11 16 EF 1B A7 1E 00 00 01 05 3B F0 A8 DT........ .V$.../Tz ...TE....n..O...........;..
how can I access say 0xA322?
Is the only way to open it with open() and then count the bytes until this address?
Thank you
Using the C standard library open with
fopenand go straight to the address of your interest usingfseek, and thenfreador whatever reading function is most convenient to you.If you instead have to use the POSIX syscalls directly you can use respectively
open,lseekandread.