// // png_set_PLTE from 0x65ff3c to 0x65fff6 (186 bytes) // // 4 xrefs: // > cocos2d::CCImage::_saveImageToPNG @ 0x5e20f6 // > png_handle_PLTE @ 0x65ca7c // > sub_661338 @ 0x661682 // > sub_661338 @ 0x6617e8 // // 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_PLTE(_DWORD *result, int a2, const void *a3, unsigned int a4) { bool v4; // zf void *v8; // r6 _BOOL4 v9; // r2 _DWORD *v10; // r12 int v11; // r3 int v12; // r2 void *v13; // r0 v4 = a2 == 0; if ( a2 ) v4 = result == nullptr; if ( !v4 ) { if ( a4 <= 0x100 ) { v8 = result; v9 = (int)a4 > 0; if ( a3 ) v9 = 0; if ( !v9 ) { if ( a4 ) { png_free_data((int)result, a2, 4096, 0); v13 = png_calloc(v8, 0x300u); *((_DWORD *)v8 + 129) = v13; result = memcpy(v13, a3, 3 * a4); v10 = result; goto LABEL_11; } if ( (result[202] & 1) != 0 ) { png_free_data((int)result, a2, 4096, 0); result = png_calloc(v8, 0x300u); v10 = result; *((_DWORD *)v8 + 129) = result; LABEL_11: v11 = *(_DWORD *)(a2 + 8); v12 = *(_DWORD *)(a2 + 232) | 0x1000; *((_WORD *)v8 + 260) = a4; *(_WORD *)(a2 + 20) = a4; *(_DWORD *)(a2 + 16) = v10; *(_DWORD *)(a2 + 232) = v12; *(_DWORD *)(a2 + 8) = v11 | 8; return result; } } png_error((int)result, "Invalid palette"); } if ( *(_BYTE *)(a2 + 25) == 3 ) png_error((int)result, "Invalid palette length"); return (_DWORD *)png_warning((int)result, "Invalid palette length"); } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source