// // png_write_PLTE from 0x664494 to 0x664588 (244 bytes) // // 1 xrefs: // > png_write_info @ 0x661c18 // // 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_write_PLTE(int a1, int a2, unsigned int a3) { _BOOL4 v5; // r3 int v6; // r6 int v8; // r4 int v9; // r8 char v10; // r7 char v11; // r6 char v12; // r3 int result; // r0 _BYTE v14[4]; // [sp+0h] [bp-8h] BYREF _BYTE v15[4]; // [sp+4h] [bp-4h] BYREF v5 = (*(_DWORD *)(a1 + 808) & 1 | a3) == 0; if ( a3 > 0x100 ) v5 = 1; if ( v5 ) { if ( *(_BYTE *)(a1 + 535) == 3 ) png_error(a1, "Invalid number of colors in palette"); return png_warning(a1, "Invalid number of colors in palette"); } else if ( (*(_BYTE *)(a1 + 535) & 2) != 0 ) { v6 = 3 * a3; *(_WORD *)(a1 + 520) = a3; *(_DWORD *)(a1 + 900) = 34; png_save_uint_32(v14, 3 * a3); png_save_uint_32(v15, 1347179589); png_write_data(a1); *(_DWORD *)(a1 + 476) = 1347179589; png_reset_crc(a1); png_calculate_crc((_DWORD *)a1, (int)v15, 4); *(_DWORD *)(a1 + 900) = 66; if ( a3 ) { v8 = a2 + 3; v9 = v6 + 3 + a2; do { v10 = *(_BYTE *)(v8 - 3); v11 = *(_BYTE *)(v8 - 2); v12 = *(_BYTE *)(v8 - 1); v8 += 3; v14[0] = v10; v14[1] = v11; v14[2] = v12; png_write_chunk_data((_DWORD *)a1, (int)v14, 3); } while ( v8 != v9 ); } result = png_write_chunk_end(a1); *(_DWORD *)(a1 + 308) |= 2u; } else { return png_warning(a1, "Ignoring request to write a PLTE chunk in grayscale PNG"); } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source