// // sub_1005368F0 from 0x1005368f0 to 0x100536dac (1212 bytes) // // 5 xrefs: // > @ 0x10085b740 // > @ 0x10085b7c8 // > @ 0x10085b850 // > @ 0x10085b950 // > @ 0x10085b9d8 // // 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 // __int64 __fastcall sub_1005368F0(__int64 a1, int a2) { __int64 v4; // x0 _QWORD *v5; // x22 __int64 v6; // x24 __int64 v7; // x21 __int64 v8; // x0 __int64 v9; // x23 __int64 v10; // x8 __int64 v11; // x0 __int64 v12; // x0 unsigned __int64 v13; // x25 signed int v14; // w24 int v15; // w8 char v16; // w9 __int64 v17; // x11 int v18; // w12 int v19; // w26 __int64 result; // x0 __int64 v21; // x8 __int64 v22; // x9 __int64 v23; // x8 __int64 v31; // x9 _WORD *v32; // x10 _WORD *v33; // x9 int v34; // w8 int v35; // w0 int v36; // w25 __int64 v37; // x0 __int64 v38; // x0 int v39; // w3 unsigned __int64 v40; // [xsp+18h] [xbp-68h] BYREF char v41; // [xsp+20h] [xbp-60h] char v42; // [xsp+21h] [xbp-5Fh] char v43; // [xsp+22h] [xbp-5Eh] char v44; // [xsp+23h] [xbp-5Dh] char v45; // [xsp+24h] [xbp-5Ch] if ( !a2 ) { if ( sub_1005EB2E8(*(_QWORD *)(a1 + 216)) ) { v12 = sub_1005EB2E8(*(_QWORD *)(a1 + 216)); if ( (sub_1005EB2A8(v12) & 0x80000000) != 0 ) sub_1005884E4((char)"t1_enc.c"); } v5 = *(_QWORD **)(a1 + 208); v7 = *(_QWORD *)(a1 + 128) + 288LL; if ( v5 ) { v9 = sub_1005EB270(*(_QWORD *)(a1 + 208)); goto LABEL_17; } LABEL_16: v9 = 0; v5 = nullptr; goto LABEL_17; } if ( sub_1005EB2E8(*(_QWORD *)(a1 + 240)) ) { v4 = sub_1005EB2E8(*(_QWORD *)(a1 + 240)); if ( (sub_1005EB2A8(v4) & 0x80000000) != 0 ) sub_1005884E4((char)"t1_enc.c"); } v5 = *(_QWORD **)(a1 + 232); v6 = *(_QWORD *)(a1 + 128); v7 = v6 + 344; if ( !v5 ) goto LABEL_16; v8 = sub_1005EB270(*(_QWORD *)(a1 + 232)); v9 = v8; if ( (*(_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 200LL) + 112LL) & 1) != 0 && (sub_1005EB278(v8) & 0xF0007) == 2 ) { v10 = sub_1005EB280(v9); if ( (int)v10 >= 2 ) { v11 = *(_QWORD *)(v6 + 360); if ( v11 == *(_QWORD *)(v6 + 368) ) { if ( (int)sub_1005E01C8(v11, v10) < 1 ) return 0xFFFFFFFFLL; } else { fprintf(__stderrp, "%s:%d: rec->data != rec->input\n", "t1_enc.c", 785); } } } LABEL_17: if ( !v9 || !v5 || !*(_QWORD *)(a1 + 304) ) { memmove(*(void **)(v7 + 16), *(const void **)(v7 + 24), *(unsigned int *)(v7 + 4)); *(_QWORD *)(v7 + 24) = *(_QWORD *)(v7 + 16); return 1; } v13 = *(unsigned int *)(v7 + 4); v14 = sub_1005EB24C(*v5); if ( (sub_1005EB278(*v5) & 0x200000) != 0 ) { v21 = *(_QWORD *)(a1 + 128); v22 = v21 + 88; v23 = v21 + 12; if ( a2 ) v23 = v22; if ( (*(_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 200LL) + 112LL) & 8) != 0 ) { v31 = *(_QWORD *)(a1 + 136); v32 = (_WORD *)(v31 + 522); v33 = (_WORD *)(v31 + 520); if ( a2 ) v33 = v32; v40 = (unsigned __int16)((unsigned __int8)HIBYTE(*v33) | ((unsigned __int8)*v33 << 8)) | ((*(unsigned int *)(v23 + 2) | ((unsigned __int64)*(unsigned __int16 *)(v23 + 6) << 32)) << 16); } else { v40 = *(_QWORD *)v23; if ( !++*(_BYTE *)(v23 + 7) && !++*(_BYTE *)(v23 + 6) && !++*(_BYTE *)(v23 + 5) && !++*(_BYTE *)(v23 + 4) && !++*(_BYTE *)(v23 + 3) && !++*(_BYTE *)(v23 + 2) && !++*(_BYTE *)(v23 + 1) ) { ++*(_BYTE *)v23; } } v41 = *(_DWORD *)v7; v34 = *(_DWORD *)a1; v42 = BYTE1(*(_DWORD *)a1); v43 = v34; v44 = BYTE1(*(_DWORD *)(v7 + 4)); v45 = *(_DWORD *)(v7 + 4); v35 = sub_1005E3A9C(v5, 22, 13, &v40); v19 = v35; if ( v35 < 1 ) return 0xFFFFFFFFLL; if ( !a2 ) goto LABEL_51; v13 += v35; *(_DWORD *)(v7 + 4) += v35; } else { if ( a2 && v14 != 1 ) { v15 = v14 - (int)v13 % v14; v16 = v15 - 1; if ( (*(_BYTE *)(a1 + 425) & 2) != 0 && (**(_BYTE **)(a1 + 128) & 8) != 0 ) v16 = v14 - (int)v13 % v14; if ( (int)v13 < (int)v13 + v15 ) { v17 = (int)v13; v18 = v14 - (int)v13 % v14; do { *(_BYTE *)(*(_QWORD *)(v7 + 24) + v17++) = v16; --v18; } while ( v18 ); } *(_DWORD *)(v7 + 4) += v15; v13 += v15; } v19 = 0; if ( !a2 ) { LABEL_51: if ( !v13 ) return 0; if ( v13 % v14 ) return 0; } } v36 = sub_1005EB260(v5, *(_QWORD *)(v7 + 16), *(_QWORD *)(v7 + 24), v13); if ( (sub_1005EB278(*v5) & 0x100000) != 0 ) { if ( v36 < 0 ) return 0xFFFFFFFFLL; } else if ( !v36 ) { return 0xFFFFFFFFLL; } v37 = sub_1005EB278(v9); if ( !a2 && (v37 & 0xF0007) == 6 ) { *(int64x2_t *)(v7 + 16) = vaddq_s64(*(int64x2_t *)(v7 + 16), vdupq_n_s64(8u)); *(_DWORD *)(v7 + 4) -= 8; } if ( sub_1005EB2E8(*(_QWORD *)(a1 + 216)) ) { v38 = sub_1005EB2E8(*(_QWORD *)(a1 + 216)); v39 = sub_1005EB2A8(v38); } else { v39 = 0; } result = 1; if ( !a2 && v14 != 1 ) result = sub_10052D214(a1, v7, v14, v39); if ( !a2 ) { if ( v19 ) *(_DWORD *)(v7 + 4) -= v19; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source