// // png_set_tRNS from 0x660484 to 0x66053c (184 bytes) // // 2 xrefs: // > png_handle_tRNS @ 0x65d7f2 // > sub_661338 @ 0x661694 // // 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 // _DWORD *__fastcall png_set_tRNS(_DWORD *result, int a2, const void *a3, size_t a4, int a5) { bool v5; // zf int v7; // r3 _DWORD *v9; // r7 int v11; // r3 int v12; // r1 int v13; // r3 v5 = a2 == 0; if ( a2 ) v5 = result == nullptr; v7 = v5; if ( !v5 ) { v9 = result; if ( a3 ) { png_free_data((int)result, a2, 0x2000, v7); result = png_malloc(v9, 0x100u); *(_DWORD *)(a2 + 156) = result; v9[157] = result; if ( a4 - 1 <= 0xFF ) result = memcpy(result, a3, a4); } if ( a5 ) { v11 = 1 << *(_BYTE *)(a2 + 24); if ( *(_BYTE *)(a2 + 25) ) { if ( *(_BYTE *)(a2 + 25) != 2 || v11 >= *(unsigned __int16 *)(a5 + 2) && v11 >= *(unsigned __int16 *)(a5 + 4) && v11 >= *(unsigned __int16 *)(a5 + 6) ) { LABEL_13: result = *(_DWORD **)a5; v12 = *(_DWORD *)(a5 + 4); *(_DWORD *)(a2 + 160) = *(_DWORD *)a5; *(_DWORD *)(a2 + 164) = v12; *(_WORD *)(a2 + 168) = *(_WORD *)(a5 + 8); if ( !a4 ) LOWORD(a4) = 1; *(_WORD *)(a2 + 22) = a4; goto LABEL_16; } } else if ( v11 >= *(unsigned __int16 *)(a5 + 8) ) { goto LABEL_13; } png_warning((int)v9, "tRNS chunk has out-of-range samples for bit_depth"); goto LABEL_13; } *(_WORD *)(a2 + 22) = a4; if ( a4 ) { LABEL_16: v13 = *(_DWORD *)(a2 + 232); *(_DWORD *)(a2 + 8) |= 0x10u; *(_DWORD *)(a2 + 232) = v13 | 0x2000; } } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source