// // sub_CFC0D8 from 0xcfc0d8 to 0xcfc3ac (724 bytes) // // 2 xrefs: // > @ 0x111ea48 // > @ 0x111ea88 // // 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 *__usercall sub_CFC0D8@(int a1@, const wchar_t *a2@, const wchar_t *a3@, __int64 *a4@) { __int64 v7; // x20 size_t v8; // x19 __int64 v9; // x0 __int64 v10; // x21 wchar_t *v11; // x28 __int64 v12; // x25 size_t v13; // x20 char *v14; // x25 size_t v15; // x0 wchar_t *v16; // x21 wchar_t *v17; // x19 unsigned __int64 v18; // x2 size_t v19; // x0 wchar_t *v20; // x0 __int64 v21; // x1 __int64 *v22; // x2 __int64 v23; // x0 unsigned __int64 v24; // x23 wchar_t *v25; // x19 unsigned int *v27; // x28 unsigned int v28; // w26 int v29; // w0 *a4 = (__int64)&unk_124B6E8; if ( a2 == a3 ) { v11 = (wchar_t *)&unk_124B6E8; v13 = 0; v14 = (char *)&unk_124B6E8 + 4 * qword_124B6D0; LABEL_22: v15 = 4 * v13; goto LABEL_10; } if ( !a2 && a3 ) sub_D138D8("basic_string::_S_construct null not valid"); v7 = (char *)a3 - (char *)a2; v8 = a3 - a2; v9 = sub_D1B424(v8, 0); v10 = v9; v11 = (wchar_t *)(v9 + 24); if ( v8 == 1 ) *(_DWORD *)(v9 + 24) = *a2; else wmemcpy((wchar_t *)(v9 + 24), a2, v8); if ( (__int64 *)v10 == &qword_124B6D0 ) { v12 = *(_QWORD *)v10; } else { *(_DWORD *)(v10 + 16) = 0; *(_QWORD *)v10 = v8; v12 = v8; *(_DWORD *)(v10 + v7 + 24) = 0; } v13 = v7 >> 1; v14 = (char *)&v11[v12]; v15 = -1; if ( v13 <= 0x1FC0000000000000LL ) goto LABEL_22; LABEL_10: v16 = (wchar_t *)operator new[](v15); v17 = v11; while ( 1 ) { v18 = sub_D1FFD4(a1, v16, v17, v13); if ( v13 <= v18 ) { v13 = v18 + 1; operator delete[](v16); v19 = 4 * v13; if ( v13 > 0x1FC0000000000000LL ) v19 = -1; v16 = (wchar_t *)operator new[](v19); v18 = sub_D1FFD4(a1, v16, v17, v13); } sub_D1D5E0(a4, v16, v18); v20 = &v17[wcslen(v17)]; if ( v20 == (wchar_t *)v14 ) break; v21 = *a4; v17 = v20 + 1; v22 = (__int64 *)(*a4 - 24); v23 = *v22; v24 = *v22 + 1; if ( v24 > *(_QWORD *)(*a4 - 16) || *(int *)(v21 - 8) > 0 ) { sub_D1D184(a4, v24); v21 = *a4; v22 = (__int64 *)(*a4 - 24); v23 = *v22; } *(_DWORD *)(v21 + 4 * v23) = 0; if ( v22 != &qword_124B6D0 ) { *(_DWORD *)(v21 - 8) = 0; *v22 = v24; *(_DWORD *)(v21 + 4 * v24) = 0; } } v25 = v11 - 6; operator delete[](v16); if ( v11 - 6 != (wchar_t *)&qword_124B6D0 ) { if ( &pthread_create ) { v27 = (unsigned int *)(v11 - 2); do v28 = __ldaxr(v27); while ( __stlxr(v28 - 1, v27) ); v29 = v28; } else { v29 = *(v11 - 2); *(v11 - 2) = v29 - 1; } if ( v29 <= 0 ) operator delete(v25); } return a4; }
GD Web Decomp Icon

GD Web Decomp

Raw Source