IMG (DOSIMG)
Dan Tobias (Talk | contribs) (→Format description) |
(software) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 6: | Line 6: | ||
==Overview== | ==Overview== | ||
− | '''IMG''' is an RLE-compressed sector-based disk image format probably used by the DOS program HD-Copy and/or others. It should not be confused with raw image files (sector dumps). | + | '''IMG''' is an RLE-compressed sector-based disk image format probably used by the DOS program HD-Copy and/or others. It should not be confused with [[raw disk image|raw image files]] (sector dumps). |
− | There is a Pascal program floating around the internet which includes source code and can convert these IMG files to raw sector dumps. It is called '''DOSIMG''' and can be found mainly on various Chinese websites<ref>http://download.pchome.net/system/disk/down-13054-1.html</ref><ref>http://roy.orz.hm/soft/DOSIMG.zip</ref> | + | There is a Pascal program floating around the internet which includes source code and can convert these IMG files to raw sector dumps. It is called '''DOSIMG''' and can be found mainly on various Chinese websites<ref>http://download.pchome.net/system/disk/down-13054-1.html</ref><ref>http://roy.orz.hm/soft/DOSIMG.zip</ref><ref>https://bitbucket.org/snippets/tifan/EeLAay/python-script-to-extract-compressed-img</ref> |
+ | |||
+ | ''[Ed. note: This article needs a better title. We've named it "IMG (DOSIMG)" because the only thing we know for sure about this format is that it is supported by the DOSIMG utility.]'' | ||
==Format description== | ==Format description== | ||
Line 36: | Line 38: | ||
Each byte is copied 1:1 to the output buffer, except when the escape-byte is encountered. Then, the next 2 bytes specify a byte-value and a count-value. To uncompress, copy the first byte after the escape-byte as many times as the second byte implies to the output buffer. | Each byte is copied 1:1 to the output buffer, except when the escape-byte is encountered. Then, the next 2 bytes specify a byte-value and a count-value. To uncompress, copy the first byte after the escape-byte as many times as the second byte implies to the output buffer. | ||
|} | |} | ||
+ | |||
+ | == Software == | ||
+ | * [https://github.com/aaru-dps/Aaru Aaru] | ||
+ | |||
+ | == Sample files == | ||
+ | * {{DexvertSamples|archive/dosimg}} | ||
==References== | ==References== | ||
<references/> | <references/> |
Latest revision as of 13:50, 12 May 2024
Contents |
[edit] Overview
IMG is an RLE-compressed sector-based disk image format probably used by the DOS program HD-Copy and/or others. It should not be confused with raw image files (sector dumps).
There is a Pascal program floating around the internet which includes source code and can convert these IMG files to raw sector dumps. It is called DOSIMG and can be found mainly on various Chinese websites[1][2][3]
[Ed. note: This article needs a better title. We've named it "IMG (DOSIMG)" because the only thing we know for sure about this format is that it is supported by the DOSIMG utility.]
[edit] Format description
byte | description |
---|---|
0 | last track on the original disk (either 39 or 79) |
1 | number of sectors per track |
2-166 | one byte for each track, 0x01 if the track is included in the file, 0x00 otherwise (empty/unformatted) |
For each track: | |
2 bytes | compressed size of this track, little-endian, not including this size field but including the next byte |
1 byte | the escape-byte for the RLE coding |
n-1 bytes | The actual sector data, RLE compressed. Should uncompress to at most num_sectors * 512 bytes, rest is filled with zero.
Each byte is copied 1:1 to the output buffer, except when the escape-byte is encountered. Then, the next 2 bytes specify a byte-value and a count-value. To uncompress, copy the first byte after the escape-byte as many times as the second byte implies to the output buffer. |