-
Garmin MobilePC Hacking
Hi all,
After looking at some of the Garmin MobilePC installation files, I noticed that the three ".gir" files are actually a sort of PNG image archive for what appear to be the icons and interface buttons, etc of the software.
To facilitate some re-skinning of the interface, I have documented what I know about the GIR file format. I have also written a file splitter which will split out all of the PNG files from the GIR file to help those who might want to have a look. The program will also recombine the PNG images into a GIR file using the log produced during the split.
The GIRSplit program is located here.
The file format documentation can be found here.
The splitter source code in C# is also included here for those interested.
GIRSplit requires .NET 2.0 and is a simple command-line application.
Drag and drop a GIR file onto GIRSplit.exe and it will be split out into a number of PNG files and a log file.
Drag and drop a LOG file onto GIRSplit.exe and it will recombine the PNG files and log file data into a GIR file.
I hope this helps someone get a start on re-skinning the MobilePC interface.
Edit 13-Sep-2008: Updated to v1.1
pb
-
Great find. Hope to download that GIR file merger soon.
-
Hi all,
The merge functionality is done.
I also discovered a couple of bugs in the splitter, as well as an odd issue with the GIR file format which caused me to change the format of the log file produced.
It seems that in some cases, the second field of each filename record defines the width and height of the PNG image, while in other cases it appears to affect the display position of the image.
I have changed the log file produced during the split operation to record both the image-dimension / display position and the unknown / possible alpha-bg color information.
GIRSplit will now split or merge the GIR file. To split a GIR file, feed it with a filename that ends with ".gir". To merge the PNG files, feed it with the log file produced during the split.
The links in my first post have been updated with the new files.
pb
-
Hi again,
All files have been updated from v1.0 to v1.1.
The log file has been changed again, as I discovered a bug in my code was causing me to make an error in my interpretation of the file format.
The header of the GIR file is almost certainly in the following format:
Code:
Beginning of file:
-------------------
67 69 72 00 00 00 00 00 01 00 00 00 XX XX XX XX ; gir
Where "XX XX XX XX" is a 32 bit integer defining the
number of PNGs stored in the file.
PNG Filename Records:
Offset Bytes Data
------- ------ -----------------
0x00 0x27 Filename
0x28 0x04 Width Height
0x2C 0x04 LA DD LB 00 [PNG Offset from centerpoint]
0x30 0x04 Start Offset from first PNG
0x34 0x04 File byte size
Where "LA" and "LB" specify the number of pixels to the left of
the center point that the PNG is displayed in the map, and
"DD" is the number of pixels down from the center. LA and LB
can be interchangeable, but if both are used, some formula
is applied that I don't yet know.
pb
-
I've made a skin overlay for GMPC for those that use RR:
http://www.mp3car.com/vbulletin/rr-s...-any-skin.html
I'm going to try your stuff to see if I can customize it even more... Thanks!
-
Where does your program drop the .png's and log file? I run the program which pulls up a DOS window, but it disappears before I can read it and then I have nothing.
Thanks....
Mark
-
It should create a folder in the same directory as the .gir file. In the folder are the .PNG's and log file. Once you're done editing the .PNG's, drag and drop the log file back over GIRsplit, and it creates the .gir in the folder with the .PNG's.
-
Got it! Thanks.
I had to move it off of our network drive and onto my C: drive to get it to work.
-
1 Attachment(s)
very interesting..
ive had a very quick play to see if i could get it to look like lsx
-
Now if we can figure out how to change the font, that would be nice...