Difference between revisions of "IMG4 File Format"

From The iPhone Wiki
Jump to: navigation, search
Line 1: Line 1:
There is an '''img4''' file (sep-firmware.img4) found in /user/standalone/firmware on [[iOS]] 7.0.4 for the [[iPhone 5s]]. The IPSWFILE/Firmware/all_flash/all_flash.DEVICEIDENTIFIER.production for any [[A7]] (64 bit) device containts an IM4P version of the same file. It has a IMG4 header, but also refers to [[IM4P File Format]].
+
There is an '''img4''' file (sep-firmware.img4) found in /user/standalone/firmware on [[iOS]] 7.0.4 for the [[iPhone 5s]]. The IPSWFILE/Firmware/all_flash/all_flash.DEVICEIDENTIFIER.production for any [[A7]] (64 bit) device containts an IM4P version of the same file. The file is an [http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One#Example_encoded_in_DER DER encoded ASN.1 object] and structured as follows:
   
 
==Header==
 
==Header==
   
 
<pre>
 
<pre>
  +
30 - type tag indicating SEQUENCE
uint8_t ??; //0x30
 
  +
8 - ?
uint8_t lengthOfSize; //0x83 = 3byte, 0x84 = 4byte
 
  +
3 - 2,3,4 length in octets of value that follows (length of next value; size of file)
3,4 byte sizeFromHere; //Size of Image
 
  +
x octets - size of file from here
uint32_t delimiter; //0x1604
 
  +
16 - indicating an [http://en.wikipedia.org/wiki/IA5String IA5String] to follow
uint32_t magic; //IMG4
 
  +
04 - length in octets of IA5String that follows
  +
49 4D 47 34 - IA5String, the magic "IMG4"
  +
... - sequential data
 
</pre>
 
</pre>
   

Revision as of 04:14, 27 December 2013

There is an img4 file (sep-firmware.img4) found in /user/standalone/firmware on iOS 7.0.4 for the iPhone 5s. The IPSWFILE/Firmware/all_flash/all_flash.DEVICEIDENTIFIER.production for any A7 (64 bit) device containts an IM4P version of the same file. The file is an DER encoded ASN.1 object and structured as follows:

Header

30 - type tag indicating SEQUENCE
8  - ?
3  - 2,3,4 length in octets of value that follows (length of next value; size of file)
x octets - size of file from here
16 - indicating an [http://en.wikipedia.org/wiki/IA5String IA5String] to follow
04 - length in octets of IA5String that follows
49 4D 47 34 - IA5String, the magic "IMG4"
... - sequential data


Tango Media-cdrom.png This software article is a "stub", an incomplete page. Please add more content to this article and remove this tag.