Detect-It-Easy/db/CurIcoBPP
2024-04-06 18:32:56 +03:00

14 lines
No EOL
468 B
Text
Executable file

// 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;
}