// // TIFFNumberOfDirectories from 0xea8a98 to 0xea8e98 (1024 bytes) // // 1 xrefs: // > @ 0xc85d8 // // 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:11 +0000 // __int64 __fastcall TIFFNumberOfDirectories(__int64 a1) { int v1; // w2 int v2; // w3 __int64 v3; // x1 unsigned int v5; // w20 __int64 v6; // x25 __int64 v8; // x0 __int64 v9; // x25 __int64 v10; // x0 __int64 v11; // x1 __int64 v12; // x0 __int64 v13; // x0 __int64 v14; // x0 __int64 v15; // x1 __int64 v16; // x0 unsigned __int16 v17; // [xsp+5Eh] [xbp+5Eh] BYREF __int64 v18; // [xsp+60h] [xbp+60h] BYREF unsigned __int64 v19; // [xsp+68h] [xbp+68h] BYREF v1 = *(_DWORD *)(a1 + 16); v2 = v1 & 0x80000; if ( (v1 & 0x80000) != 0 ) v3 = *(_QWORD *)(a1 + 624); else v3 = *(unsigned int *)(a1 + 620); v18 = v3; if ( !v3 ) return 0; v5 = 0; while ( (v1 & 0x800) == 0 ) { if ( !v2 ) { v8 = (*(__int64 (__fastcall **)(_QWORD))(a1 + 976))(*(_QWORD *)(a1 + 952)); if ( v8 != v18 || (*(__int64 (__fastcall **)(_QWORD, unsigned __int16 *, __int64))(a1 + 960))(*(_QWORD *)(a1 + 952), &v17, 2) != 2 ) { goto LABEL_14; } if ( (*(_DWORD *)(a1 + 16) & 0x80) != 0 ) TIFFSwabShort(&v17); (*(void (__fastcall **)(_QWORD, _QWORD, __int64))(a1 + 976))(*(_QWORD *)(a1 + 952), 12 * v17, 1); if ( (*(__int64 (__fastcall **)(_QWORD, unsigned __int64 *, __int64))(a1 + 960))(*(_QWORD *)(a1 + 952), &v19, 4) != 4 ) { LABEL_41: TIFFErrorExt( *(_QWORD *)(a1 + 952), "TIFFAdvanceDirectory", "%s: Error fetching directory link", *(const char **)a1); return v5; } if ( (*(_DWORD *)(a1 + 16) & 0x80) == 0 ) goto LABEL_52; goto LABEL_57; } v13 = (*(__int64 (__fastcall **)(_QWORD))(a1 + 976))(*(_QWORD *)(a1 + 952)); if ( v13 != v18 || (*(__int64 (__fastcall **)(_QWORD, unsigned __int64 *, __int64))(a1 + 960))(*(_QWORD *)(a1 + 952), &v19, 8) != 8 ) { LABEL_14: TIFFErrorExt( *(_QWORD *)(a1 + 952), "TIFFAdvanceDirectory", "%s: Error fetching directory count", *(const char **)a1); return v5; } if ( (*(_DWORD *)(a1 + 16) & 0x80) != 0 ) TIFFSwabLong8(&v19); if ( v19 > 0xFFFF ) { LABEL_10: TIFFErrorExt(*(_QWORD *)(a1 + 952), "TIFFAdvanceDirectory", "Error fetching directory count"); return v5; } (*(void (__fastcall **)(_QWORD, _QWORD, __int64))(a1 + 976))(*(_QWORD *)(a1 + 952), 20 * (int)v19, 1); if ( (*(__int64 (__fastcall **)(_QWORD, __int64 *, __int64))(a1 + 960))(*(_QWORD *)(a1 + 952), &v18, 8) != 8 ) goto LABEL_41; if ( (*(_DWORD *)(a1 + 16) & 0x80) != 0 ) goto LABEL_27; v3 = v18; LABEL_53: v5 = (unsigned __int16)(v5 + 1); if ( !v3 ) return v5; v1 = *(_DWORD *)(a1 + 16); v2 = v1 & 0x80000; } if ( !v2 ) { v6 = v3 + 2; if ( __OFSUB__(v3, v3 + 2) || v6 <= 1 || v6 > *(_QWORD *)(a1 + 928) ) goto LABEL_10; TIFFmemcpy(&v17, (const void *)(*(_QWORD *)(a1 + 920) + v3), 2u); if ( (*(_DWORD *)(a1 + 16) & 0x80) != 0 ) TIFFSwabShort(&v17); v14 = 12 * v17; v15 = v6 + v14; if ( v6 > v6 + v14 || v14 > v15 || (v16 = v15 + 4, v15 + 4 <= 3) || v15 > v16 || v16 > *(_QWORD *)(a1 + 928) ) { LABEL_50: TIFFErrorExt(*(_QWORD *)(a1 + 952), "TIFFAdvanceDirectory", "Error fetching directory link"); return v5; } TIFFmemcpy(&v19, (const void *)(*(_QWORD *)(a1 + 920) + v15), 4u); if ( (*(_DWORD *)(a1 + 16) & 0x80) == 0 ) goto LABEL_52; LABEL_57: TIFFSwabLong(&v19); LABEL_52: v3 = (unsigned int)v19; v18 = (unsigned int)v19; goto LABEL_53; } v9 = v3 + 8; if ( __OFSUB__(v3, v3 + 8) || v9 <= 7 || v9 > *(_QWORD *)(a1 + 928) ) goto LABEL_10; TIFFmemcpy(&v19, (const void *)(*(_QWORD *)(a1 + 920) + v3), 8u); if ( (*(_DWORD *)(a1 + 16) & 0x80) != 0 ) TIFFSwabLong8(&v19); if ( v19 <= 0xFFFF ) { v10 = 20 * (int)v19; v11 = v9 + v10; if ( v9 > v9 + v10 ) goto LABEL_50; if ( v10 > v11 ) goto LABEL_50; v12 = v11 + 8; if ( v11 + 8 <= 7 || v11 > v12 || v12 > *(_QWORD *)(a1 + 928) ) goto LABEL_50; TIFFmemcpy(&v18, (const void *)(*(_QWORD *)(a1 + 920) + v11), 8u); if ( (*(_DWORD *)(a1 + 16) & 0x80) != 0 ) LABEL_27: TIFFSwabLong8(&v18); v3 = v18; goto LABEL_53; } TIFFErrorExt(*(_QWORD *)(a1 + 952), "TIFFAdvanceDirectory", "Sanity check on directory count failed"); return v5; }
GD Web Decomp Icon

GD Web Decomp

Raw Source