rope
-
Content Count
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Gallery
Posts posted by rope
-
-
This is the complete file format spec, as far as i understood it:
Image File Format
* ----------+----------------------------+----------- * Position | Field | Size * ----------+----------------------------+----------- * 0 | Header Record (F1 only) | 40 bytes * 0 | Header Record (F2 only) | 48 bytes * ----------+----------------------------+----------- * variable | GZH Record (Gzip Header) | 12 bytes * variable | GZH Record (Gzip Header) | 12 bytes * variable | GZH Record (Gzip Header) | 12 bytes * ... | ... | ... * ----------+----------------------------+----------- * variable | GZF Record (Gzip File) | variable * variable | GZF Record (Gzip File) | variable * variable | GZF Record (Gzip File) | variable * ... | ... | ... * ----------+----------------------------+----------- * variable | Directory Record | variable * variable | Directory Record | variable * variable | Directory Record | variable * ... | ... | ... * ----------+----------------------------+-----------
Header Record
* ----------+----------------------------+-----------+------------------------ * Position | Field | Size | Example Value * ----------+----------------------------+-----------+------------------------ * 0 | Magic Bytes (F1 only) | 4 bytes | F1 F1 F1 F1 * 0 | Magic Bytes(F2 only) | 4 bytes | F2 F2 F2 F2 * ----------+----------------------------+-----------+------------------------ * 4 | Number of files | 4 bytes | 74 0C 00 00 * ----------+----------------------------+-----------+------------------------ * 8 | Header Size (F1 only) | 4 bytes | 28 00 00 00 * 8 | Header Size (F2 only) | 4 bytes | 30 00 00 00 * ----------+----------------------------+-----------+------------------------ * 12 | ? Unknown ? | 4 bytes | 00 00 00 00 * 16 | ? Unknown ? (F2 only) | 4 bytes | 30 00 00 00 * 20 | ? Unknown ? (F2 only) | 4 bytes | 00 00 00 00 * ----------+----------------------------+-----------+------------------------ * var | GZH Block Offset | 4 bytes | 30 00 00 00 * var | GZH Block Size | 4 bytes | 70 95 00 00 * ----------+----------------------------+-----------+------------------------ * var | GZF Block Offset | 4 bytes | A0 95 00 00 * var | GZF Block Size | 4 bytes | 62 E6 83 00 * ----------+----------------------------+-----------+------------------------ * var | Directory Block Offset | 4 bytes | 02 C7 84 00 * var | Directory Block Size | 4 bytes | E5 5D 01 00 * ----------+----------------------------+-----------+------------------------
Gzip Header Record
* ----------+----------------------------+-----------+--------------- * Position | Field | Size | Example Value * ----------+----------------------------+-----------+--------------- * 0 | GZF Record Offset | 4 bytes | 80 68 00 00 * 4 | GZip Filesize | 4 bytes | 75 00 00 00 * 8 | Unzipped BMP Filesize | 4 bytes | 84 02 00 00 * ----------+----------------------------+-----------+---------------
GZIP File Record
* ----------+----------------------------+-----------+----------- * Position | Field | Size | Value * ----------+----------------------------+-----------+----------- * 0 | Magic Bytes (gzip) | 3 bytes | 1F 8B 08 * 3 | Rest of gzip data | variable | */
Directory Record
* ----------+----------------------------+-----------+---------+--------------------------- * Position | Field | Size | Style | Example Value(s) * ----------+----------------------------+-----------+---------+--------------------------- * 0 | Type1 | variable | ASCII | "pOver", "vi", "" * var | Delimiter | 1 byte | HEX | 5C * var | Type2 | 2 bytes | ASCII | "2M", "32K", "GZ" * var | Delimiter | 1 byte | HEX | 5C * var | Filename | variable | ASCII | "007_2M_OM-151.bmp" * var | Delimiter | 1 byte | HEX | 00 * ----------+----------------------------+-----------+---------+---------------------------
-
Based on information in this thread, i have been able to reverse engineer the file format. I wrote a little tool for extracting all bmps:
Download: http://avic411.com/i...ckage-imageimg/
-
I developed a little java program which is able to extract all bmp files from my image.img located in the firmware folder AVICZ110\APL\MENU\.
Usage:
java -jar xtractor.jar
It generates a folder/file structure like this:
OutputFolder | |- 2M | |- 007_2M_AV-001.bmp | |- 007_2M_AV-001.bmp | |- 007_2M_AV-002.bmp | |- ... |- 32k | |- 007_32K_AV-001.bmp | |- 007_32K_AV-002.bmp | |- 007_32K_AV-003.bmp | |- ... |- pOver | |- 2M | | |- 007_2M_OM-001.bmp | | |- 007_2M_OM-002.bmp | | |- 007_2M_OM-003.bmp | | |- ... | |- 32K | |- GZ
Tested with Image.img from this firmware for my F9220BT:
Product : AVICZ110 Release File : APL Release Version : 3.001000 Release Machine : BUILDL09
Only extracting is supported in this version. I'll implement repackaging of modified bmp's in the next version
and release the source code when all stuff is finished.
Would be great if somebody could test it with other firmwares/devices and let me know if it worked.
Extract and Repackage Image.img
in Hacks/Mods
Posted
I implemented repacking and tried to recreate the image file from the extracted bitmaps. It works so far. But the generated gzip data is different:
Original GZip Data Bytes:
Recreated Gzip Data Bytes:
I tried various libraries and compression levels but the filesize or the resulting binaries have always been different from the original ones. Maybe the pioneer firmware doesn't complain about this, but i would prefer generating the files as close as possible to the original.
So i'll keep trying ...