Icons.bni is a file downloaded by Blizzard's games during their handshake with Battle.net and is used to display client icons in chat, including icons like tournament trophies and number of wins.
Icons.bni File Format:
(UINT32) Size of BNI header (always 16) (UINT16) BNI Version* (UINT16) Alignment Padding (Unused) (UINT32) Number of Icons (UINT32) Data Offset**
* This document only covers version
0x01 of the format.
** Value will equal the length of the BNI file header plus the starting position for the data structures below.
For each icon:
(UINT32) Flags* (UINT32) X Size (UINT32) Y Size (UINT32) Icon Code** (VOID) Image in Targa format
* The user's flags must match this value after a bitwise-and of the two for this icon to be valid.
** This array is empty if the flags field is non-zero, but it's always terminated with a null
UINT32. The array has an upper bound limit of 32 items.
** For applicable clients, the
Icon Code string sent by the server in a Chat Statstring is used to search for a matching icon in the loaded icons file.
If you plan on adding support for icons.bni to your client, you may find this document, written by Kane, useful. This document, which has more details on the Targa format, may also be helpful.
Developers should be aware that Warcraft III's icons file is not actually a BNI file, but is an MPQ file with a .bni extension.