NOTE: This is a work in progress. CVS sources may or may not function properly (or even compile) at any given point in time. About imgdecode --------------- This program is designed to aid in the decoding of Garmin IMG files. It hexdumps the IMG file side-by-side with plain-text descriptions of what the particular bytes in the file represent. Unknown data blocks are either unlabeled or labeled with a ???. Files are created in a directory named after the IMG file, with separate files for each subfile & section. Naming convention is: offsetbegin-offsetend.subfile.section For example: 00130348/ 00000001-000018bf.DSKIMG.header 00001a00-00001a1c.RGN.header 00001a7d-00002449.RGN.level.02 00002548-00003d99.RGN.level.01 00003ee2-0003a972.RGN.level.00 0003d200-0003d2bb.TRE.header 0003d2bc-0003d30f.TRE.mapinfo 0003d310-0003d315.TRE.copyright 0003d316-0003e0a1.TRE.subdivs 0003e0a2-0003e0b1.TRE.levels 0003e0b2-0003e0cc.TRE.polylines 0003e0cd-0003e0f3.TRE.polygons 0003e0f4-0003e1a4.TRE.points 0003e1a5-0003e298.TRE.unknown1 0003e299-0003e29d.TRE.unknown2 0003e400-0003e515.LBL.header 0003e516-0003e51e.LBL.sort 0003e51f-00047ddd.LBL.labels 00047dde-00047de0.LBL.countries 00047de1-00047de5.LBL.regions 00047de6-00047e30.LBL.cities 00047e31-00047e60.LBL.zipcodes 00047e61-00048d50.LBL.unknown1 00048d51-0004c930.LBL.poi_properties 0004c931-0004c94c.LBL.unknown2 As you can see, it generates a LOT of output. Be prepared. Note that I am not doing detailed bitstream parsing for polylines and polygons at the moment. Mostly this is to get past those things that are already known and on to sections (like NET and NOD) that are unknown. I calculate the number of points in the -line or -gon but probably will NOT add the coords themselves in order to keep the output to manageable levels (it's currently at 20x the IMG file). What you also see is the beginning of a general-purpose library for interacting with IMG files (including the "combined" map files generated by MapSource and MapSend when uploading a map set to the GPS or a card writer). Because the decoder needs raw access to the IMG data, many of the functions that would normally be methods in the various subfile objects (tre, lbl, rgn, etc.) are implemented in the decoder itself, but as the library develops this code will get duplicated into the objects. What isn't working ------------------ NOD section "unknown2" is not correct. There are offsets into this file from NET and I know where they are, but don't understand the algorithm for getting to them, so parsing NOD is pretty much impossible for now. Much of NET is still unknown. This still blows up on some IMG files and I'm not sure why. If you are running against a CityNav or City Select NA product, I can look into it if you send me the file name (and product version).