// // EditorSFXManager::deserializeAll from 0x1008e14b0 to 0x1008e20f2 (3138 bytes) // // 3 xrefs: // > EditorSFXManager::ensureLoaded @ 0x1008e147b // > EditorSFXManager::encodeDataTo @ 0x1008ec405 // > EditorSFXManager::importFromString @ 0x1008ecf5f // // This function is hookable on this platform (idp: pc, 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 12:37:46 +0000 // __int64 __fastcall EditorSFXManager::deserializeAll(_QWORD *a1, const std::string *a2, int a3) { size_t v3; // rbx unsigned int v4; // eax std::string::size_type v5; // rax unsigned int v6; // eax size_t size; // rax std::string::pointer v8; // r15 char v9; // r15 char *v10; // r12 size_t v11; // r13 char v13; // al unsigned __int8 v14; // r14 std::string::pointer v15; // r12 char *v16; // r13 unsigned __int64 v17; // r15 std::string::size_type v18; // rbx std::string::size_type v19; // rbx std::string::size_type v20; // rax std::string::size_type v21; // r15 std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v22; // r14 char v23; // r13 const std::string::value_type *v24; // rbx const char *v25; // rdi int v26; // eax std::string::size_type v27; // rdx const std::string::value_type *v28; // rsi std::string::size_type v29; // rdx const char *v30; // rdi float v31; // xmm0_4 __int64 v32; // rax const char *v33; // rdi const char *v34; // rdi unsigned __int64 v35; // rsi unsigned __int64 v36; // r9 __int64 v37; // rcx __int64 **v38; // rax __int64 *v39; // r8 unsigned __int64 v40; // rsi unsigned __int64 v41; // rax __int64 v42; // rax bool v43; // r13 __int64 v44; // r15 float *v45; // rax std::string::size_type v46; // rbx std::string::size_type v47; // r13 void *v48; // rdi __int64 v49; // rax void *v50; // rdi size_t v51; // r14 size_t v52; // r15 __int64 *v53; // r15 __int64 v54; // rdi unsigned int i; // ebx unsigned int v56; // eax __int64 v57; // rdi __int64 v58; // [rsp+0h] [rbp-180h] BYREF _QWORD *v59; // [rsp+8h] [rbp-178h] _QWORD v60[2]; // [rsp+10h] [rbp-170h] BYREF __int64 v61; // [rsp+20h] [rbp-160h] __int64 *v62; // [rsp+28h] [rbp-158h] void *__p[2]; // [rsp+30h] [rbp-150h] BYREF void *v64[2]; // [rsp+40h] [rbp-140h] int v65; // [rsp+50h] [rbp-130h] char __dst[16]; // [rsp+60h] [rbp-120h] BYREF char *data; // [rsp+70h] [rbp-110h] std::string v68; // [rsp+80h] [rbp-100h] BYREF unsigned int v69; // [rsp+A0h] [rbp-E0h] BYREF int v70; // [rsp+A4h] [rbp-DCh] _QWORD *v71; // [rsp+A8h] [rbp-D8h] std::string v72; // [rsp+B0h] [rbp-D0h] BYREF std::string v73; // [rsp+D0h] [rbp-B0h] BYREF std::string v74; // [rsp+F0h] [rbp-90h] BYREF float v75; // [rsp+10Ch] [rbp-74h] std::string v76; // [rsp+110h] [rbp-70h] BYREF std::string __str; // [rsp+130h] [rbp-50h] BYREF unsigned int v78; // [rsp+150h] [rbp-30h] int v79; // [rsp+154h] [rbp-2Ch] v79 = a3; v71 = a1; v4 = (unsigned int)a2->__r_.__value_.__l.0; if ( (v4 & 1) != 0 ) { if ( !a2->__r_.__value_.__l.__size_ ) goto LABEL_21; } else if ( !(v4 >> 1) ) { goto LABEL_21; } v5 = std::string::find(a2, 59, 0); if ( v5 == -1 ) { if ( (*(_BYTE *)&a2->__r_.__value_.__s.0 & 1) == 0 ) { data = a2->__r_.__value_.__l.__data_; *(_OWORD *)__dst = *(_OWORD *)&a2->__r_.__value_.__l.0; v9 = __dst[0]; if ( (__dst[0] & 1) == 0 ) goto LABEL_18; goto LABEL_26; } sub_10001AD30(__dst, a2->__r_.__value_.__l.__data_, a2->__r_.__value_.__l.__size_); v9 = __dst[0]; if ( (__dst[0] & 1) != 0 ) goto LABEL_26; LABEL_18: if ( v9 ) { if ( (unsigned int)(atoi(&__dst[1]) - 3) >= 0xFFFFFFFE ) goto LABEL_31; LABEL_28: LODWORD(v3) = 0; if ( (v9 & 1) != 0 ) goto LABEL_29; return (unsigned int)v3; } LABEL_21: LODWORD(v3) = 0; return (unsigned int)v3; } v3 = v5; v6 = (unsigned int)a2->__r_.__value_.__l.0; if ( (v6 & 1) != 0 ) { size = a2->__r_.__value_.__l.__size_; v8 = a2->__r_.__value_.__l.__data_; } else { size = v6 >> 1; v8 = a2->__r_.__value_.__s.__data_; } if ( size < v3 ) v3 = size; if ( v3 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100003630(); if ( v3 >= 0x17 ) { v11 = 26; if ( (v3 | 7) != 0x17 ) v11 = (v3 | 7) + 1; v10 = (char *)operator new(v11); data = v10; *(_QWORD *)__dst = v11 + 1; *(_QWORD *)&__dst[8] = v3; LABEL_25: memmove(v10, v8, v3); v10[v3] = 0; v9 = __dst[0]; if ( (__dst[0] & 1) != 0 ) goto LABEL_26; goto LABEL_18; } __dst[0] = 2 * v3; v10 = &__dst[1]; if ( v3 ) goto LABEL_25; __dst[1] = 0; v9 = __dst[0]; if ( (__dst[0] & 1) == 0 ) goto LABEL_18; LABEL_26: if ( !*(_QWORD *)&__dst[8] || (unsigned int)(atoi(data) - 3) < 0xFFFFFFFE ) goto LABEL_28; LABEL_31: if ( (_BYTE)v79 ) EditorSFXManager::clearAll((__int64)v71); v58 = 0; v60[0] = &v58; v60[1] = a2; memset(&__str, 0, sizeof(__str)); v13 = sub_1008EB110(v60, &__str); v14 = v79; if ( !v13 ) goto LABEL_191; v62 = v71 + 10; v59 = v71 + 15; while ( 1 ) { while ( 1 ) { while ( 1 ) { LABEL_36: if ( !(unsigned __int8)sub_1008EB110(v60, &__str) ) { LOBYTE(v3) = 1; if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_192; goto LABEL_193; } LODWORD(v3) = __str.__r_.__value_.__l.0; if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) break; if ( __str.__r_.__value_.__s.0 ) { if ( __str.__r_.__value_.__s.__data_[0] != 77 ) goto LABEL_54; if ( __str.__r_.__value_.__l.0 != 2 ) { if ( __str.__r_.__value_.__s.__data_[1] != 124 ) goto LABEL_54; if ( *(_BYTE *)&__str.__r_.__value_.__s.0 > 4u ) { v3 = *(_BYTE *)&__str.__r_.__value_.__l.0 >> 1; v15 = __str.__r_.__value_.__s.__data_; goto LABEL_50; } } } } v3 = __str.__r_.__value_.__l.__size_; if ( __str.__r_.__value_.__l.__size_ ) { if ( *__str.__r_.__value_.__l.__data_ != 77 ) goto LABEL_54; if ( __str.__r_.__value_.__l.__size_ != 1 ) break; } } if ( *(_BYTE *)(__str.__r_.__value_.__r.__words[2] + 1) != 124 ) break; if ( __str.__r_.__value_.__l.__size_ > 2 ) { v15 = __str.__r_.__value_.__l.__data_; LABEL_50: v3 -= 2LL; if ( v3 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100003630(); if ( v3 >= 0x17 ) { v52 = (v3 | 7) + 1; if ( (v3 | 7) == 0x17 ) v52 = 26; v16 = (char *)operator new(v52); v64[0] = v16; __p[0] = (void *)(v52 | 1); __p[1] = (void *)v3; } else { LOBYTE(__p[0]) = 2 * v3; v16 = (char *)__p + 1; if ( !v3 ) goto LABEL_170; } memmove(v16, v15 + 2, v3); LABEL_170: v16[v3] = 0; sub_100653860((unsigned __int8 *)__p, (__int64)v59, 1); if ( ((__int64)__p[0] & 1) != 0 ) operator delete(v64[0]); } } LABEL_54: memset(&v68, 0, sizeof(v68)); memset(&v73, 0, sizeof(v73)); memset(&v76, 0, sizeof(v76)); v78 = -1; v17 = 0; v75 = 0.0; v61 = 0; v70 = 0; while ( 1 ) { do { while ( 1 ) { if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) { if ( v17 > __str.__r_.__value_.__l.__size_ ) goto LABEL_100; } else if ( v17 > *(_BYTE *)&__str.__r_.__value_.__l.0 >> 1 ) { goto LABEL_100; } v19 = std::string::find(&__str, 44, v17); if ( v19 == -1 ) { if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) v19 = __str.__r_.__value_.__l.__size_; else v19 = *(_BYTE *)&__str.__r_.__value_.__l.0 >> 1; } std::string::assign(&v73, &__str, v17, v19 - v17); if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) == 0 ) break; v18 = v19 + 1; v17 = v18; if ( v73.__r_.__value_.__l.__size_ ) goto LABEL_66; } v18 = v19 + 1; v17 = v18; } while ( !(*(_BYTE *)&v73.__r_.__value_.__l.0 >> 1) ); LABEL_66: v20 = (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ? __str.__r_.__value_.__l.__size_ : *(_BYTE *)&__str.__r_.__value_.__l.0 >> 1; if ( v18 > v20 ) break; v21 = std::string::find(&__str, 44, v18); if ( v21 == -1 ) { if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) v21 = __str.__r_.__value_.__l.__size_; else v21 = *(_BYTE *)&__str.__r_.__value_.__l.0 >> 1; } std::string::assign(&v76, &__str, v18, v21 - v18); v17 = v21 + 1; v22 = v73.__r_.__value_.__s.0; v23 = *(_BYTE *)&v73.__r_.__value_.__s.0 & 1; v24 = v73.__r_.__value_.__l.__data_; v25 = v73.__r_.__value_.__l.__data_; if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) == 0 ) v25 = v73.__r_.__value_.__s.__data_; v26 = atoi(v25); switch ( v26 ) { case 3: v30 = v76.__r_.__value_.__s.__data_; if ( (*(_BYTE *)&v76.__r_.__value_.__s.0 & 1) != 0 ) v30 = v76.__r_.__value_.__l.__data_; v31 = atof(v30); v75 = v31; LOBYTE(v32) = 1; v61 = v32; LABEL_96: v14 = v79; break; case 2: v34 = v76.__r_.__value_.__s.__data_; v14 = v79; if ( (*(_BYTE *)&v76.__r_.__value_.__s.0 & 1) != 0 ) v34 = v76.__r_.__value_.__l.__data_; v70 = atoi(v34); break; case 1: v33 = v76.__r_.__value_.__s.__data_; if ( (*(_BYTE *)&v76.__r_.__value_.__s.0 & 1) != 0 ) v33 = v76.__r_.__value_.__l.__data_; v78 = atoi(v33); goto LABEL_96; default: if ( (*(_BYTE *)&v68.__r_.__value_.__s.0 & 1) != 0 ) { if ( v68.__r_.__value_.__l.__size_ ) goto LABEL_81; } else if ( *(_BYTE *)&v68.__r_.__value_.__l.0 >> 1 ) { LABEL_81: std::string::push_back(&v68, 44); v22 = v73.__r_.__value_.__s.0; v24 = v73.__r_.__value_.__l.__data_; if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_82; goto LABEL_85; } if ( !v23 ) { LABEL_82: v27 = *(unsigned __int8 *)&v22 >> 1; v24 = v73.__r_.__value_.__s.__data_; goto LABEL_86; } LABEL_85: v27 = v73.__r_.__value_.__l.__size_; LABEL_86: v14 = v79; std::string::append(&v68, v24, v27); std::string::push_back(&v68, 44); if ( (*(_BYTE *)&v76.__r_.__value_.__s.0 & 1) != 0 ) { v28 = v76.__r_.__value_.__l.__data_; v29 = v76.__r_.__value_.__l.__size_; } else { v29 = *(_BYTE *)&v76.__r_.__value_.__l.0 >> 1; v28 = v76.__r_.__value_.__s.__data_; } std::string::append(&v68, v28, v29); break; } } LABEL_100: if ( (v78 & 0x80000000) != 0 ) goto LABEL_187; memset(&v74, 0, sizeof(v74)); if ( (unsigned __int8)sub_1008EB110(v60, &v74) ) { if ( v14 ) goto LABEL_126; v35 = v71[1]; if ( !v35 ) goto LABEL_126; v36 = (0x101010101010101LL * ((((v35 - ((v35 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((v35 - ((v35 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL) + ((((v35 - ((v35 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((v35 - ((v35 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4)) & 0xF0F0F0F0F0F0F0FLL)) >> 56; if ( v36 > 1 ) { v37 = v78; if ( v35 <= v78 ) v37 = v78 % (unsigned int)v35; } else { v37 = ((_DWORD)v35 + 0x7FFFFFFF) & v78; } v38 = *(__int64 ***)(*v71 + 8 * v37); if ( !v38 || (v39 = *v38) == nullptr ) { LABEL_126: *(_OWORD *)v64 = 0; *(_OWORD *)__p = 0; v65 = 1065353216; v43 = 1; goto LABEL_127; } if ( (unsigned int)v36 < 2 ) { v40 = v35 - 1; while ( 1 ) { v42 = v39[1]; if ( v42 == v78 ) { if ( *((_DWORD *)v39 + 4) == v78 ) goto LABEL_172; } else if ( (v40 & v42) != v37 ) { goto LABEL_126; } v39 = (__int64 *)*v39; if ( !v39 ) goto LABEL_126; } } while ( 2 ) { v41 = v39[1]; if ( v41 != v78 ) { if ( v41 < v35 ) { LABEL_118: if ( v41 != v37 ) goto LABEL_126; } else { if ( (v35 | v41) >> 32 ) { v41 %= v35; goto LABEL_118; } if ( (unsigned int)v41 % (unsigned int)v35 != v37 ) goto LABEL_126; } LABEL_113: v39 = (__int64 *)*v39; if ( !v39 ) goto LABEL_126; continue; } break; } if ( *((_DWORD *)v39 + 4) != v78 ) goto LABEL_113; LABEL_172: v53 = (__int64 *)v39[3]; *(_OWORD *)v64 = 0; *(_OWORD *)__p = 0; v65 = 1065353216; v43 = 1; if ( v53 ) { v54 = *v53; if ( *v53 ) { for ( i = 0; ; ++i ) { v56 = sub_1007FEF90(v54); v57 = *v53; if ( i >= v56 ) break; sub_1007FEFE0(v57, i); sub_1008E9C40(&v72); sub_1004930B0((float *)__p, (unsigned __int8 *)&v72, (__int64)&v72); if ( (*(_BYTE *)&v72.__r_.__value_.__s.0 & 1) != 0 ) operator delete(v72.__r_.__value_.__l.__data_); v54 = *v53; } if ( v57 ) v43 = (unsigned int)sub_1007FEF90(v57) == 0; } } LABEL_127: v44 = sub_1008E2390(v71, v78); if ( ((v14 | v43) & 1) != 0 ) { *(_DWORD *)(v44 + 8) = v70; std::string::operator=((std::string *)(v44 + 16), &v68); if ( (v61 & 1) != 0 ) { v69 = v78; if ( v75 <= 0.0 ) { sub_10001C120(v62, (int *)&v69); } else { v72.__r_.__value_.__r.__words[0] = (std::string::size_type)&v69; v45 = (float *)sub_100153AA0((float *)v62, (int *)&v69, (__m128)0LL, (__int64)&unk_100A13924, &v72); v45[5] = v75; } } } memset(&v72, 0, sizeof(v72)); v46 = 0; while ( 2 ) { while ( 2 ) { v47 = std::string::find(&v74, 58, v46); if ( v47 == -1 ) { if ( (*(_BYTE *)&v74.__r_.__value_.__s.0 & 1) != 0 ) v47 = v74.__r_.__value_.__l.__size_; else v47 = *(_BYTE *)&v74.__r_.__value_.__l.0 >> 1; } v48 = &v72; std::string::assign(&v72, &v74, v46, v47 - v46); if ( (*(_BYTE *)&v72.__r_.__value_.__s.0 & 1) != 0 ) { if ( !v72.__r_.__value_.__l.__size_ ) goto LABEL_147; } else if ( !(*(_BYTE *)&v72.__r_.__value_.__l.0 >> 1) ) { goto LABEL_147; } if ( v14 || (v48 = __p, !sub_1003D9FD0(__p, (unsigned __int8 *)&v72)) ) { v49 = EditorSFXManager::decodeSound(v48, &v72); if ( v49 ) { sub_1007FEBF0(*(_QWORD *)v44, v49); if ( !v14 ) sub_10066C6A0(__p, (unsigned __int8 *)&v72, (__int64)&v72); } } LABEL_147: if ( (*(_BYTE *)&v74.__r_.__value_.__s.0 & 1) != 0 ) { v46 = v47 + 1; if ( v47 + 1 > v74.__r_.__value_.__l.__size_ ) goto LABEL_149; continue; } break; } v46 = v47 + 1; if ( v47 + 1 <= *(_BYTE *)&v74.__r_.__value_.__l.0 >> 1 ) continue; break; } LABEL_149: if ( (*(_BYTE *)&v72.__r_.__value_.__s.0 & 1) != 0 ) operator delete(v72.__r_.__value_.__l.__data_); v3 = (size_t)v64[0]; if ( v64[0] ) { do { v51 = *(_QWORD *)v3; if ( (*(_BYTE *)(v3 + 16) & 1) != 0 ) operator delete(*(void **)(v3 + 32)); operator delete((void *)v3); v3 = v51; } while ( v51 ); } v50 = __p[0]; __p[0] = nullptr; if ( v50 ) operator delete(v50); if ( (*(_BYTE *)&v74.__r_.__value_.__s.0 & 1) != 0 ) { operator delete(v74.__r_.__value_.__l.__data_); if ( (*(_BYTE *)&v76.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_163; LABEL_156: v14 = v79; if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_157; LABEL_164: operator delete(v73.__r_.__value_.__l.__data_); if ( (*(_BYTE *)&v68.__r_.__value_.__s.0 & 1) != 0 ) LABEL_35: operator delete(v68.__r_.__value_.__l.__data_); } else { if ( (*(_BYTE *)&v76.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_156; LABEL_163: operator delete(v76.__r_.__value_.__l.__data_); v14 = v79; if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_164; LABEL_157: if ( (*(_BYTE *)&v68.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_35; } goto LABEL_36; } if ( (*(_BYTE *)&v74.__r_.__value_.__s.0 & 1) != 0 ) operator delete(v74.__r_.__value_.__l.__data_); LABEL_187: if ( (*(_BYTE *)&v76.__r_.__value_.__s.0 & 1) != 0 ) { operator delete(v76.__r_.__value_.__l.__data_); if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_189; } else if ( (*(_BYTE *)&v73.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_189: if ( (*(_BYTE *)&v68.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_191; goto LABEL_190; } operator delete(v73.__r_.__value_.__l.__data_); if ( (*(_BYTE *)&v68.__r_.__value_.__s.0 & 1) != 0 ) LABEL_190: operator delete(v68.__r_.__value_.__l.__data_); LABEL_191: LODWORD(v3) = 0; if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) LABEL_192: operator delete(__str.__r_.__value_.__l.__data_); LABEL_193: if ( (__dst[0] & 1) != 0 ) LABEL_29: operator delete(data); return (unsigned int)v3; }