// // png_icc_check_header from 0xe3cc7c to 0xe3d0ac (1072 bytes) // // 3 xrefs: // > png_colorspace_set_ICC @ 0xe40514 // > png_handle_iCCP @ 0xe560e4 // > @ 0xdc780 // // This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 13:10:01 +0000 // __int64 __fastcall png_icc_check_header(__int64 a1, __int64 a2, __int64 a3, int a4, unsigned __int8 *a5, char a6) { __int64 v7; // x21 __int64 v8; // x22 __int64 v9; // x20 unsigned int v10; // w4 unsigned __int64 v11; // x3 int v12; // w0 char v13; // w5 unsigned int v14; // w3 const char *v16; // x4 char v17; // [xsp+38h] [xbp+38h] char v18; // [xsp+38h] [xbp+38h] v7 = a1; v8 = a2; v9 = a3; v10 = (a5[1] << 16) + (*a5 << 24) + a5[3] + (a5[2] << 8); if ( v10 != a4 ) { v11 = v10; v16 = "length does not match profile"; return sub_E3B438(a1, a2, a3, v11, (__int64)v16); } if ( a5[8] > 3u && (v10 & 3) != 0 ) { v11 = v10; v16 = "invalid length"; return sub_E3B438(a1, a2, a3, v11, (__int64)v16); } LODWORD(v11) = (a5[129] << 16) + (a5[128] << 24) + a5[131] + (a5[130] << 8); if ( (unsigned int)v11 > 0x1555554A || v10 < 12 * (int)v11 + 132 ) { v11 = (unsigned int)v11; v16 = "tag count too large"; return sub_E3B438(a1, a2, a3, v11, (__int64)v16); } LODWORD(v11) = (a5[65] << 16) + (a5[64] << 24) + a5[67] + (a5[66] << 8); if ( (unsigned int)v11 > 0xFFFE ) { v11 = (unsigned int)v11; v16 = "invalid rendering intent"; return sub_E3B438(a1, a2, a3, v11, (__int64)v16); } if ( (unsigned int)v11 > 3 ) { v18 = a6; sub_E3B438(a1, 0, a3, (unsigned int)v11, (__int64)"intent outside defined range"); a6 = v18; } LODWORD(v11) = (a5[37] << 16) + (a5[36] << 24) + a5[39] + (a5[38] << 8); if ( (_DWORD)v11 != 1633907568 ) { a1 = v7; a2 = v8; a3 = v9; v11 = (unsigned int)v11; v16 = "invalid signature"; return sub_E3B438(a1, a2, a3, v11, (__int64)v16); } v17 = a6; v12 = memcmp(a5 + 68, &unk_11BC420, 0xCu); v13 = v17; if ( v12 ) { sub_E3B438(v7, 0, v9, 0, (__int64)"PCS illuminant is not D50"); v13 = v17; } LODWORD(v11) = (a5[17] << 16) + (a5[16] << 24) + a5[19] + (a5[18] << 8); if ( (_DWORD)v11 == 1196573017 ) { if ( (v13 & 2) != 0 ) return sub_E3B438(v7, v8, v9, 0x47524159u, (__int64)"Gray color space not permitted on RGB PNG"); goto LABEL_15; } if ( (_DWORD)v11 != 1380401696 ) { a1 = v7; a2 = v8; a3 = v9; v11 = (unsigned int)v11; v16 = "invalid ICC profile color space"; return sub_E3B438(a1, a2, a3, v11, (__int64)v16); } if ( (v13 & 2) == 0 ) return sub_E3B438(v7, v8, v9, 0x52474220u, (__int64)"RGB color space not permitted on grayscale PNG"); LABEL_15: v14 = (a5[13] << 16) + (a5[12] << 24) + a5[15] + (a5[14] << 8); if ( v14 == 1852662636 ) { sub_E3B438(v7, 0, v9, 0x6E6D636Cu, (__int64)"unexpected NamedColor ICC profile class"); } else { if ( v14 > 0x6E6D636C ) { if ( v14 == 1935896178 || v14 == 1936744803 || v14 == 1886549106 ) goto LABEL_34; } else { switch ( v14 ) { case 0x6C696E6Bu: return sub_E3B438(v7, v8, v9, 0x6C696E6Bu, (__int64)"unexpected DeviceLink ICC profile class"); case 0x6D6E7472u: goto LABEL_34; case 0x61627374u: return sub_E3B438(v7, v8, v9, 0x61627374u, (__int64)"invalid embedded Abstract ICC profile"); } } sub_E3B438(v7, 0, v9, v14, (__int64)"unrecognized ICC profile class"); } LABEL_34: LODWORD(v11) = (a5[21] << 16) + (a5[20] << 24) + a5[23] + (a5[22] << 8); if ( (_DWORD)v11 != 1281450528 && (_DWORD)v11 != 1482250784 ) { a1 = v7; a2 = v8; a3 = v9; v11 = (unsigned int)v11; v16 = "unexpected ICC PCS encoding"; return sub_E3B438(a1, a2, a3, v11, (__int64)v16); } return 1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source