Windows ce binary image data format
This format is the output of the Microsoft WinCE Platform Builder. This is a binary (non\[hy]text) file format. File names in this format typically (ambiguously) use the W.bin suffix.
Files in this format start with a header record.
Then comes the data itself, organized into records.
The file finishes with an execution start address record. This is mandatory.
Data in this format start with an optional header containing the magic \[lq]B000FF\n\[rq], followed by the image start (four bytes, little endian) address and the span of the image (highest address - lowest address + 1) (four bytes, little endian). The file header does not have a checksum; it is therefore possible that a corrupt file header will go undetected.
|Magic \[lq]B000FF\ n\[rq] (7 bytes)||Least Address (4 bytes)||Greatest Address (4 bytes)|
There is no provision for a file comment of any kind.
Each record consists of a record start address (four bytes, little endian), a record length (four bytes, little endian), a record checksum (four bytes, little endian), followed by the record data. The data part of each record is raw byte values, no encoding.
|Start address (4 bytes)||Length (4 bytes)||Checksum (4 bytes)||Data|
The checksum is calculated by a simple sum of unsigned bytes into a 32\[hy]bit accumulator.
The 12 record header bytes are not included in the record checksums; it is therefore possible that a corrupt record header will go undetected.
It is not possible to place data at address zero with this format. Address zero is reserved for use by the execution start address record.
There is effectively no limit on the length of a record (2^32-1). It is not uncommon for a MsBin file to contain records with sizes in the tens of megabytes.
Last comes a special record with the record address set to zero and record length set to the image execution start address. According to specification the record describing the execution start address must be always present, and must always be the last record in the file.
|Zero (4 bytes)||Start Address (4 bytes)||Checksum = 0 (4 bytes)|
The MsBin files produced by SRecord are valid and can be successfully parsed by the command line utilities Wviewbin and Wcvrtbin (part of Windows CE platform).
For a MsBin file to be usable in Microsoft WinCE Platform Builder it has to contain a TOC meta\[hy]structure. This is data embedded in the file by Microsoft WinCE Platform Builder itself.
The opposite conversion - from MsBin - comes in handy when analyzing a MsBin file (i.e. a WinCE image).
In general, binary data will expand in sized by approximately 1.0 times (approaching asymptotically from above) when represented with this format, as the 15\[hy]byte file header is averaged over the data content. Holes in the data will also increase the size.
\*(n) version \*(v)
Copyright \*(Y) Peter Miller
The \*(n) program comes with ABSOLUTELY NO WARRANTY; for details use the '\*(n) -VERSion License' command. This is free software and you are welcome to redistribute it under certain conditions; for details use the '\*(n) -VERSion License' command.
|Peter Miller||E\[hy]Mail:||[email protected]|