// // sub_740D94 from 0x740d94 to 0x740ec8 (308 bytes) // // 2 xrefs: // > sub_740ED8 @ 0x740f50 // > gzread @ 0x740fe0 // // 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_740D94(_DWORD *a1) { unsigned __int8 **v2; // r7 int v3; // r8 int v4; // r0 int v5; // r1 int result; // r0 int v7; // r3 bool v8; // zf unsigned int v9; // r4 int v10; // r10 unsigned int v11; // r6 ssize_t v12; // r0 int v13; // r2 unsigned int v14; // r4 int v15; // r2 int v16; // r3 const char *v17; // r2 int v18; // r3 int v19; // r3 int v20; // r0 int *v21; // r0 char *v22; // r0 v2 = (unsigned __int8 **)(a1 + 21); v3 = a1[25]; while ( 1 ) { if ( !a1[22] ) { v7 = a1[19]; v8 = v7 == 0; if ( v7 ) v8 = v7 == -5; if ( !v8 ) return -1; v9 = a1[13]; if ( v9 ) goto LABEL_20; v10 = a1[8]; v11 = a1[6]; while ( 1 ) { v12 = read(a1[4], (void *)(v10 + v9), v11 - v9); if ( v12 <= 0 ) break; v9 += v12; if ( v11 <= v9 ) goto LABEL_19; } if ( v12 ) { v21 = (int *)_errno(); v22 = strerror(*v21); sub_740B68(a1, -1, v22); return -1; } a1[13] = 1; LABEL_19: v13 = a1[8]; v14 = v9 + a1[22]; a1[22] = v14; a1[21] = v13; if ( !v14 ) { LABEL_20: sub_740B68(a1, -5, "unexpected end of file"); v15 = a1[24]; v16 = v3 - a1[25]; *a1 = v16; a1[1] = v15 - v16; return 0; } } v4 = inflate(v2, 0); v5 = v4; if ( ((v4 + 2) & 0xFFFFFFFB) == 0 ) { sub_740B68(a1, -2, "internal error: inflate stream corrupt"); return -1; } if ( v4 == -4 ) { sub_740B68(a1, -4, "out of memory"); return -1; } if ( v4 == -3 ) break; result = a1[25]; if ( !result ) { v18 = a1[24]; *a1 = v3; a1[1] = v18 - v3; if ( v5 != 1 ) return result; goto LABEL_29; } if ( v5 == 1 ) { v19 = a1[24]; v20 = v3 - result; *a1 = v20; a1[1] = v19 - v20; LABEL_29: a1[11] = 0; return 0; } } v17 = (const char *)a1[27]; if ( !v17 ) v17 = "compressed data error"; sub_740B68(a1, -3, v17); return -1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source