// // sub_B9E24C from 0xb9e24c to 0xb9e5a0 (852 bytes) // // 2 xrefs: // > sub_B928E0 @ 0xb934fc // > sub_B9701C @ 0xb973f4 // // 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_B9E24C(__int64 *a1, __int64 a2, __int64 byte_count) { int v3; // w3 __int64 v6; // x21 __int64 v7; // x20 __int64 result; // x0 __int64 v9; // x0 __int64 v10; // x1 __int64 v11; // x0 _BYTE *v12; // x3 const char *v13; // x0 _BYTE *v14; // x0 void *v15; // x0 const char *v16; // x2 __int64 v17; // x0 const char *v18; // x2 __int64 v19; // x0 int v20; // w0 unsigned int v21; // w0 int v22; // w0 __int64 v23; // [xsp+48h] [xbp+48h] BYREF v3 = *(_DWORD *)(a2 + 212); v6 = byte_count; v7 = a2 + 216; switch ( v3 ) { case 0: *(_QWORD *)(a2 + 280) = sub_B9DE10; *(_QWORD *)(a2 + 288) = sub_B9DE38; *(_QWORD *)v7 = 0; *(_QWORD *)(a2 + 224) = 0; *(_QWORD *)(a2 + 232) = 0; *(_QWORD *)(a2 + 240) = 0; *(_QWORD *)(a2 + 248) = 0; *(_QWORD *)(a2 + 256) = 0; *(_QWORD *)(a2 + 264) = 0; *(_QWORD *)(a2 + 272) = 0; *(_QWORD *)(a2 + 296) = 0; *(_QWORD *)(a2 + 304) = 0; *(_QWORD *)(a2 + 312) = 0; *(_QWORD *)(a2 + 320) = 0; v13 = (const char *)zlibVersion(sub_B9DE38); if ( strcmp(v13, "1.2.0.4") < 0 ) { if ( !(unsigned int)inflateInit2_(v7, 4294967281LL, "1.2.8", 112) ) { *(_DWORD *)(a2 + 212) = 1; goto LABEL_19; } } else if ( !(unsigned int)inflateInit2_(v7, 47, "1.2.8", 112) ) { *(_DWORD *)(a2 + 212) = 4; goto LABEL_16; } v18 = *(const char **)(a2 + 264); v19 = *a1; if ( v18 ) sub_B7B690(v19, "Error while processing content unencoding: %s", v18); else sub_B7B690(v19, "Error while processing content unencoding: Unknown failure within decompression software."); return 61; case 4: LABEL_16: *(_QWORD *)(a2 + 216) = *(_QWORD *)(a2 + 128); *(_DWORD *)(v7 + 8) = v6; return sub_B9DF44(a1, a2); case 1: LABEL_19: v14 = *(_BYTE **)(a2 + 128); if ( v6 <= 9 ) goto LABEL_20; if ( *v14 == 31 && (unsigned __int8)v14[1] == 139 ) { v22 = sub_B9DE5C(v14, v6, &v23); if ( !v22 ) { LODWORD(byte_count) = v6 - v23; *(_QWORD *)(a2 + 216) = *(_QWORD *)(a2 + 128) + v23; *(_DWORD *)(v7 + 8) = byte_count; *(_DWORD *)(a2 + 212) = 3; LABEL_6: result = 0; if ( (_DWORD)byte_count ) return sub_B9DF44(a1, a2); return result; } if ( v22 == 2 ) { LABEL_20: *(_DWORD *)(v7 + 8) = v6; v15 = off_1231000((unsigned int)v6); *(_QWORD *)(a2 + 216) = v15; if ( v15 ) { memcpy(v15, *(const void **)(a2 + 128), *(unsigned int *)(v7 + 8)); *(_DWORD *)(a2 + 212) = 2; return 0; } else { inflateEnd(v7); *(_DWORD *)(a2 + 212) = 0; return 27; } } } goto LABEL_23; } if ( v3 != 2 ) { *(_QWORD *)(a2 + 216) = *(_QWORD *)(a2 + 128); *(_DWORD *)(a2 + 224) = byte_count; goto LABEL_6; } v9 = *(_QWORD *)(a2 + 216); v10 = (unsigned int)(*(_DWORD *)(a2 + 224) + byte_count); *(_DWORD *)(v7 + 8) = v10; v11 = sub_BA3184(v9, v10); *(_QWORD *)(a2 + 216) = v11; if ( !v11 ) { inflateEnd(v7); *(_DWORD *)(a2 + 212) = 0; return 27; } memcpy((void *)(v11 + *(unsigned int *)(v7 + 8) - v6), *(const void **)(a2 + 128), v6); result = 0; v12 = *(_BYTE **)(a2 + 216); if ( *(unsigned int *)(v7 + 8) > 9uLL ) { if ( *v12 == 31 && (unsigned __int8)v12[1] == 139 ) { v20 = sub_B9DE5C(*(_BYTE **)(a2 + 216), *(unsigned int *)(v7 + 8), &v23); if ( !v20 ) { off_1231008(*(void **)(a2 + 216)); v21 = *(_DWORD *)(v7 + 8); LODWORD(byte_count) = v23; *(_QWORD *)(a2 + 216) = *(_QWORD *)(a2 + 128) + v23 - v21 + v6; LODWORD(byte_count) = v21 - byte_count; *(_DWORD *)(v7 + 8) = byte_count; *(_DWORD *)(a2 + 212) = 3; goto LABEL_6; } if ( v20 == 2 ) return 0; v12 = *(_BYTE **)(a2 + 216); } off_1231008(v12); LABEL_23: v16 = *(const char **)(a2 + 264); v17 = *a1; if ( v16 ) sub_B7B690(v17, "Error while processing content unencoding: %s", v16); else sub_B7B690(v17, "Error while processing content unencoding: Unknown failure within decompression software."); inflateEnd(v7); *(_DWORD *)(a2 + 212) = 0; return 61; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source