// Read the bits per pixel of Windows cursors & icons from the image.

// nOffset: position of the header.
function getCurIcoBPP(nOffset) {
    var nBPP = 0;
    nOffset = Binary.readDword(nOffset + 12);
    if (Binary.readDword(nOffset) == 0x28) {
        nBPP = Binary.readWord(nOffset + 14);
    } else if (Binary.compare("89'PNG\r\n'1A0A", nOffset)) {
        // Just assume a PNG is going to be 8-bit RGBA.
        nBPP = 32;
    }
    return nBPP;
}