// // TIFFRewriteDirectory from 0xeb7ca0 to 0xeb803c (924 bytes) // // 2 xrefs: // > TIFFFlush @ 0xebf494 // > @ 0x1020a0 // // This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 13:11:27 +0000 // __int64 __fastcall TIFFRewriteDirectory(__int64 a1) { __int64 v1; // x1 __int64 v2; // x19 unsigned int v3; // w21 __int64 v4; // x20 __int64 v5; // x20 __int64 v6; // x21 __int64 v7; // x21 void (__fastcall *v8)(__int64, __int64, _QWORD); // x3 __int64 v9; // x0 void (__fastcall *v11)(__int64, _QWORD, _QWORD); // x3 __int64 v12; // x0 void (__fastcall *v13)(__int64, __int64, _QWORD); // x3 __int64 v14; // x0 void (__fastcall *v15)(__int64, __int64, _QWORD); // x3 __int64 v16; // x0 unsigned __int64 v17; // [xsp+48h] [xbp+48h] BYREF __int64 v18; // [xsp+50h] [xbp+50h] BYREF __int64 v19; // [xsp+58h] [xbp+58h] BYREF v1 = *(_QWORD *)(a1 + 24); v2 = a1; if ( !v1 ) return TIFFWriteDirectory(a1); if ( (*(_DWORD *)(a1 + 16) & 0x80000) != 0 ) { v5 = *(_QWORD *)(a1 + 624); if ( v1 != v5 ) { while ( 1 ) { v7 = (*(__int64 (__fastcall **)(_QWORD, __int64, _QWORD))(v2 + 976))(*(_QWORD *)(v2 + 952), v5, 0); if ( v7 != v5 || (*(__int64 (__fastcall **)(_QWORD, unsigned __int64 *, __int64))(v2 + 960))(*(_QWORD *)(v2 + 952), &v17, 8) != 8 ) { goto LABEL_29; } if ( (*(_DWORD *)(v2 + 16) & 0x80) != 0 ) TIFFSwabLong8(&v17); if ( v17 > 0xFFFF ) { TIFFErrorExt( *(_QWORD *)(v2 + 952), "TIFFRewriteDirectory", "Sanity check on tag count failed, likely corrupt TIFF"); return 0; } v6 = 20 * (int)v17 + 8LL + v7; (*(void (__fastcall **)(_QWORD, __int64, _QWORD))(v2 + 976))(*(_QWORD *)(v2 + 952), v6, 0); if ( (*(__int64 (__fastcall **)(_QWORD, __int64 *, __int64))(v2 + 960))(*(_QWORD *)(v2 + 952), &v18, 8) != 8 ) { LABEL_30: TIFFErrorExt(*(_QWORD *)(v2 + 952), "TIFFRewriteDirectory", "Error fetching directory link"); return 0; } if ( (*(_DWORD *)(v2 + 16) & 0x80) != 0 ) TIFFSwabLong8(&v18); v5 = v18; if ( *(_QWORD *)(v2 + 24) == v18 ) { v8 = *(void (__fastcall **)(__int64, __int64, _QWORD))(v2 + 976); v9 = *(_QWORD *)(v2 + 952); v19 = 0; v8(v9, v6, 0); if ( (*(__int64 (__fastcall **)(_QWORD, __int64 *, __int64))(v2 + 968))(*(_QWORD *)(v2 + 952), &v19, 8) == 8 ) { LABEL_26: *(_QWORD *)(v2 + 24) = 0; goto LABEL_27; } LABEL_32: TIFFErrorExt(*(_QWORD *)(v2 + 952), "TIFFRewriteDirectory", "Error writing directory link"); return 0; } } } v13 = *(void (__fastcall **)(__int64, __int64, _QWORD))(a1 + 976); v14 = *(_QWORD *)(a1 + 952); *(_QWORD *)(v2 + 624) = 0; *(_QWORD *)(v2 + 24) = 0; v13(v14, 8, 0); if ( (*(__int64 (__fastcall **)(_QWORD, __int64, __int64))(v2 + 968))(*(_QWORD *)(v2 + 952), v2 + 624, 8) == 8 ) { LABEL_27: a1 = v2; return TIFFWriteDirectory(a1); } } else { v3 = *(_DWORD *)(a1 + 620); v4 = v3; if ( v1 != v3 ) { while ( v4 == (*(__int64 (__fastcall **)(_QWORD, __int64, _QWORD))(v2 + 976))(*(_QWORD *)(v2 + 952), v4, 0) && (*(__int64 (__fastcall **)(_QWORD, unsigned __int64 *, __int64))(v2 + 960))( *(_QWORD *)(v2 + 952), &v17, 2) == 2 ) { if ( (*(_DWORD *)(v2 + 16) & 0x80) != 0 ) TIFFSwabShort(&v17); (*(void (__fastcall **)(_QWORD, _QWORD, _QWORD))(v2 + 976))( *(_QWORD *)(v2 + 952), 12 * (unsigned __int16)v17 + 2 + v3, 0); if ( (*(__int64 (__fastcall **)(_QWORD, __int64 *, __int64))(v2 + 960))(*(_QWORD *)(v2 + 952), &v18, 4) != 4 ) goto LABEL_30; if ( (*(_DWORD *)(v2 + 16) & 0x80) != 0 ) TIFFSwabLong(&v18); v4 = (unsigned int)v18; if ( (unsigned int)v18 == *(_QWORD *)(v2 + 24) ) { v11 = *(void (__fastcall **)(__int64, _QWORD, _QWORD))(v2 + 976); v12 = *(_QWORD *)(v2 + 952); LODWORD(v19) = 0; v11(v12, 12 * (unsigned __int16)v17 + 2 + v3, 0); if ( (*(__int64 (__fastcall **)(_QWORD, __int64 *, __int64))(v2 + 968))(*(_QWORD *)(v2 + 952), &v19, 4) == 4 ) goto LABEL_26; goto LABEL_32; } v3 = v18; } LABEL_29: TIFFErrorExt(*(_QWORD *)(v2 + 952), "TIFFRewriteDirectory", "Error fetching directory count"); return 0; } v15 = *(void (__fastcall **)(__int64, __int64, _QWORD))(a1 + 976); v16 = *(_QWORD *)(a1 + 952); *(_DWORD *)(v2 + 620) = 0; *(_QWORD *)(v2 + 24) = 0; v15(v16, 4, 0); if ( (*(__int64 (__fastcall **)(_QWORD, __int64, __int64))(v2 + 968))(*(_QWORD *)(v2 + 952), v2 + 620, 4) == 4 ) { a1 = v2; return TIFFWriteDirectory(a1); } } TIFFErrorExt(*(_QWORD *)(v2 + 952), *(_QWORD *)v2, "Error updating TIFF header"); return 0; }
GD Web Decomp Icon

GD Web Decomp

Raw Source