// // png_handle_hIST from 0x65d9dc to 0x65daa6 (202 bytes) // // 3 xrefs: // > png_push_read_chunk @ 0x652ae6 // > png_read_info @ 0x6558a6 // > png_read_end @ 0x6573b6 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // int __fastcall png_handle_hIST(int a1, int a2, unsigned int a3) { int result; // r0 unsigned int v6; // r3 bool v7; // zf char *v8; // r5 char *v9; // r7 _BYTE v10[2]; // [sp+4h] [bp-204h] BYREF char v11; // [sp+6h] [bp-202h] BYREF _BYTE var200[536]; // [sp+8h] [bp-200h] BYREF if ( (*(_DWORD *)(a1 + 308) & 1) == 0 ) png_chunk_error(a1, "missing IHDR"); if ( (*(_DWORD *)(a1 + 308) & 6) == 2 ) { if ( a2 && (*(_DWORD *)(a2 + 8) & 0x40) != 0 ) { png_crc_finish((_DWORD *)a1, a3); return png_chunk_benign_error(a1, "duplicate"); } else { v6 = a3 >> 1; v7 = a3 >> 1 == 256; if ( a3 >> 1 <= 0x100 ) v7 = v6 == *(unsigned __int16 *)(a1 + 520); if ( v7 ) { if ( v6 ) { v8 = &v11; v9 = &var200[2 * v6 - 2]; do { png_crc_read((_DWORD *)a1, (int)v10, 2); *((_WORD *)v8 + 1) = v10[1] + (v10[0] << 8); v8 += 2; } while ( v8 != v9 ); } result = png_crc_finish((_DWORD *)a1, 0); if ( !result ) return png_set_hIST(a1, a2, var200); } else { png_crc_finish((_DWORD *)a1, a3); return png_chunk_benign_error(a1, "invalid"); } } } else { png_crc_finish((_DWORD *)a1, a3); return png_chunk_benign_error(a1, "out of place"); } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source