The UICC.exe
produces a binary description file from the source XAML, this binary is embedded in the generated RC resource file.
The format of the binary file is not documented. I will try to reverse-engineer its binary format.
- Byte, 8 bits
- WORD, 16 bits, little-endian
- DWORD, 32 bits, little-endian
- Header
- An Unknown String Section
- The
Application.Commands
Section - The String Section
- The Unnamed Section
- The Pointer Section
- 0x0000: Starts with
00 12 00 00 00 00 00 01 00 53 43 42 69 6E
(14 bytes, last 5 bytes in ASCII isSCBIN
), all binaries seem to share this same header. - 0x000e: DWORD, size of the binary file
Starting at 0x12, this seems to be a string section, with unknown purpose.
- BYTE, 0x02, stands for the type?
- DWORD, length of this section, in bytes.
- BYTE, 0x01, unknown
- BYTE, the number of strings.
Each string has the following format: 1 byte of fixed 0x01, 1 WORD of the length of the string and the string itself in ASCII, no '\0' termination.
These strings can always be found:Small MajorItems StandardItems
Almost identical to the XAML Application.Commands
tags. The length of the section header is 5 bytes. (Fixed)
- BYTE, 0x0F, stands for the type?
- DWORD, number of tags within this section
Each tag consists of multiple property -value pairs. The type is always 1 byte, however, the length of the data payload can vary. Up to now, the length can be 4 or 6, depending on the type byte.
- DWORD: ID, the higher WORD of this DWORD should always be 0, same rule applies to other DWORD IDs.
- Byte: Number of property-value pairs
- Byte: Tag type 1
- Variable-Length: Tag value 1
- Byte: Tag type 2
- Variable-Length: Tag value 2
- ....
static const struct ac_prop_data_item {
enum ub_ac_property_type type; // 1 byte
const int len; // length of the data
const char* name; // Friendly name
} ac_prop_data[] = {
{0x01, 4, "Command.LabelTitle"},
{0x02, 4, "Command.LabelDescription"},
{0x03, 6, "Command.SmallHighContrastImages"},
{0x04, 6, "Command.LargeHighContrastImages"},
{0x05, 6, "Command.SmallImages"},
{0x06, 6, "Command.LargeImages"},
{0x07, 4, "Command.Keytip"},
{0x08, 4, "Command.TooltipTitle"},
{0x09, 4, "Command.TooltipDescription"}
};
The first WORD of the payload points to a string or bitmap in the resource file. The second WORD is always 0 (As far as we know). The third WORD (if exists) is the DPI (0x03 to 0x06 only). The following XAML Attributes never appear in property value:
- Symbol: Sets the macro name of the resource in the generated .h file
- Id: Set the id of the resource manually, UICC.exe will generate one if not supplied.
- Content and Source: Their content are included in the resource file only.
- BYTE, 0x10, stands for the type?
- DWORD: length of this String Section in bytes, including this DWORD and previous byte
- DWORD: number of strings within this String Section
- WORD, ID
- WORD, 0x0000
- WORD, little-endian, object type
- WORD, 0x1000, little-endian, fixed. However, there is one exception (up to now, known): for type 0x0001, this WORD is 0x0000.
- WORD, length of this string
- WORDs, WideChar representation of the string.
Little-endian:
- 0x0600 Toggle Button
- 0x0700 Group
- 0x0F00 Button
- 0x1300 "File" Menu
- 0x1800 MenuGroup
- 0x1A00 Tab
- 0x2500 Quick Access Bar (Qat)
- BYTE, 0x0D
- WORD, 0x0003, little-endian, fixed
- DWORD, the absolute address of the pointer section
- The root tag
- DWORD, length of the supplementary block section
- supplementary block 1
- supplementary block 2
- supplementary block 3
- WORD, length of this supplementary block
- WORD, 0x0118, little-endian, fixed
- BYTE, unknown
- WORD, number of tags.
- tag 1
- tag 2
- tag n
- BYTE, 0x16
- WORD, object type
- WORD, 0x1000, little-endian, fixed
- WORD, length of this subsection, from the 0x16 byte to the end, including possible sub tags.
- BYTE, the sum of numbers of properties and possible sub tags
- Properties
- Sub tags header
- Possible sub tags1
- Possible sub tags2 ....
Properties seem to start with 4 bytes which represents its type and followed by the data. The length of data is variable, depending on the property type. The known properties are:
- 01 01 41 2B followed by a BYTE, MajorItems=1, StandardItems=2
- 01 01 00 03 followed by a WORD, which is the referring Id
- 01 01 0B 04 followed by a BYTE, purpose unknown
- 01 01 0B 09 followed by a BYTE, purpose unknown
- 3E followed by a DWORD, the DWORD points to a position within the file, purpose known. Only seen on 16 00 13 00 10.
A section(?) of sub tags starts with:
- 18 01, 2 bytes
- BYTE, can be 01,02,3E or more, meaning is still unknown.
- WORD, number of following
The first DWORD of this section is the length of this section, including the first DWORD. This section seems to store an array of pointers, each pointer points to the address of the first occurrence of its referring object. The purpose of this section is still not clear.