// // png_write_tRNS from 0xbec900 to 0xbecbd8 (728 bytes) // // 2 xrefs: // > png_write_info @ 0xbe6e7c // > @ 0x4da00 // // 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 // __int64 __fastcall png_write_tRNS(__int64 a1, __int64 a2, __int64 a3, int a4, int a5) { int v8; // w1 _BYTE v11[2]; // [xsp+58h] [xbp+58h] BYREF _BYTE v12[2]; // [xsp+5Ah] [xbp+5Ah] BYREF _BYTE v13[4]; // [xsp+5Ch] [xbp+5Ch] BYREF _BYTE v14[4]; // [xsp+60h] [xbp+60h] BYREF _BYTE v15[4]; // [xsp+64h] [xbp+64h] BYREF if ( a5 == 3 ) { if ( a4 > 0 && a4 <= *(unsigned __int16 *)(a1 + 672) ) { *(_DWORD *)(a1 + 1252) = 34; png_save_uint_32(v14, a4); png_save_uint_32(v15, 1951551059); png_write_data(a1); *(_DWORD *)(a1 + 592) = 1951551059; png_reset_crc(a1); png_calculate_crc((_DWORD *)a1, (__int64)v15, 4); *(_DWORD *)(a1 + 1252) = 66; png_write_chunk_data(a1, a2, a4); png_write_chunk_end(a1); } else { png_app_warning(a1, "Invalid number of transparent colors specified"); } } else if ( a5 ) { if ( a5 == 2 ) { png_save_uint_16(v11, *(_WORD *)(a3 + 2)); png_save_uint_16(v12, *(_WORD *)(a3 + 4)); png_save_uint_16(v13, *(_WORD *)(a3 + 6)); if ( *(_BYTE *)(a1 + 688) == 8 && (unsigned __int8)(v12[0] | v11[0]) | v13[0] ) { png_app_warning(a1, "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8"); } else { *(_DWORD *)(a1 + 1252) = 34; png_save_uint_32(v14, 6); png_save_uint_32(v15, 1951551059); png_write_data(a1); *(_DWORD *)(a1 + 592) = 1951551059; png_reset_crc(a1); png_calculate_crc((_DWORD *)a1, (__int64)v15, 4); *(_DWORD *)(a1 + 1252) = 66; png_write_chunk_data(a1, (__int64)v11, 6); png_write_chunk_end(a1); } } else { png_app_warning(a1, "Can't write tRNS with an alpha channel"); } } else { v8 = *(unsigned __int16 *)(a3 + 8); if ( v8 < 1 << *(_BYTE *)(a1 + 688) ) { png_save_uint_16(v11, v8); *(_DWORD *)(a1 + 1252) = 34; png_save_uint_32(v14, 2); png_save_uint_32(v15, 1951551059); png_write_data(a1); *(_DWORD *)(a1 + 592) = 1951551059; png_reset_crc(a1); png_calculate_crc((_DWORD *)a1, (__int64)v15, 4); *(_DWORD *)(a1 + 1252) = 66; png_write_chunk_data(a1, (__int64)v11, 2); png_write_chunk_end(a1); } else { png_app_warning(a1, "Ignoring attempt to write tRNS chunk out-of-range for bit_depth"); } } return _stack_chk_guard; }
GD Web Decomp Icon

GD Web Decomp

Raw Source