// // sub_663EF0 from 0x663ef0 to 0x66406a (378 bytes) // // 3 xrefs: // > png_write_iCCP @ 0x664a8a // > png_write_zTXt @ 0x665414 // > png_write_iTXt @ 0x6656ca // // 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 sub_663EF0(_DWORD *a1, int a2, int a3) { int v6; // r2 int v7; // r3 _DWORD **v8; // r7 int v9; // r6 int v10; // r3 int v11; // r0 int v12; // r5 _DWORD *v13; // r0 int v14; // r3 int result; // r0 bool v16; // zf unsigned int v17; // r2 unsigned int v18; // r3 unsigned int v19; // r3 unsigned int v20; // r1 int v21; // r3 unsigned int v22; // r1 int v23; // [sp+4h] [bp-8h] v6 = *(_DWORD *)(a2 + 4); v7 = 1024; v8 = (_DWORD **)(a1 + 95); v9 = 1024; a1[81] = *(_DWORD *)a2; a1[84] = a2 + 12; for ( a1[85] = 1024; ; v7 = a1[85] ) { a1[82] = v6; if ( !v7 ) break; LABEL_3: v11 = deflate(a1 + 81, 4); v6 = a1[82]; a1[82] = 0; v12 = v11; if ( v11 ) { v7 = a1[85]; goto LABEL_11; } } if ( v9 + a3 < 0 ) { v6 = 0; v12 = -4; goto LABEL_11; } v13 = *v8; if ( *v8 ) { LABEL_2: v10 = a1[96]; v8 = (_DWORD **)v13; a1[84] = v13 + 1; v9 += v10; a1[85] = v10; goto LABEL_3; } v13 = png_malloc_base((int)a1, a1[96] + 4); if ( v13 ) { *v13 = 0; *v8 = v13; goto LABEL_2; } v6 = 0; v7 = a1[85]; v12 = -4; LABEL_11: v14 = v9 - v7; a1[85] = 0; *(_DWORD *)(a2 + 8) = v14; if ( (unsigned int)(a3 + v14) <= 0x7FFFFFFE ) { v23 = v6; png_zstream_error((int)a1, v12); a1[80] = 0; v16 = v23 == 0; if ( !v23 ) v16 = v12 == 1; if ( v16 ) { v17 = *(_DWORD *)(a2 + 4); if ( v17 <= 0x4000 && (v18 = *(unsigned __int8 *)(a2 + 12), (v18 & 0xF) == 8) && (v18 & 0xF0) <= 0x70 && (v19 = v18 >> 4, v20 = 1 << (v19 + 7), v17 <= v20) ) { do { --v19; v20 >>= 1; result = v17 <= v20 && v19 != 0; } while ( result ); v21 = (16 * v19) | 8; v22 = (*(_BYTE *)(a2 + 13) & 0xE0) + (v21 << 8); *(_BYTE *)(a2 + 12) = v21; *(_BYTE *)(a2 + 13) = 31 - -31 * (v22 / 0x1F); } else { return 0; } } else { return v12; } } else { a1[80] = 0; a1[87] = "compressed data too long"; return -4; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source