// // FMODAudioEngine::saveAudioState from 0x1003df9f0 to 0x1003dfdc5 (981 bytes) // // 1 xrefs: // > PlayLayer::createCheckpoint @ 0x1000bb30a // // 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 // void __fastcall FMODAudioEngine::saveAudioState(FMODAudioEngine *a1, FMODAudioState *a2) { std::__hash_node_base, void *> *>::__next_pointer next; // r14 unsigned __int64 value; // rdi std::unordered_map *p_m_soundStateForChannels; // r15 unsigned __int64 next_low; // rcx unsigned __int64 v7; // r9 __int64 v8; // rsi std::__hash_node_base, void *> *> *v9; // rax std::__hash_node_base, void *> *>::__next_pointer v10; // r8 unsigned __int64 v11; // rdi std::__hash_node_base, void *> *>::__next_pointer v12; // rax unsigned __int64 v13; // rax __int64 v14; // rax __int64 v15; // r13 FMOD::Channel *v16; // r12 _QWORD *p_m_interval; // r12 void **v18; // r15 __int64 v19; // rsi void **v20; // r14 int *v21; // [rsp+0h] [rbp-50h] BYREF FMODAudioState *v22; // [rsp+8h] [rbp-48h] __int64 v23; // [rsp+10h] [rbp-40h] FMOD::ChannelControl *v24; // [rsp+18h] [rbp-38h] int v25; // [rsp+20h] [rbp-30h] BYREF char v26[41]; // [rsp+27h] [rbp-29h] BYREF v22 = a2; FMOD_System_LockDSP(a1->m_system); next = a1->m_channelIDToChannel.__table_.__p1_.__value_.__next_; if ( !next ) goto LABEL_38; value = a1->m_audioState.m_soundStateForChannels.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_; if ( !value ) goto LABEL_38; p_m_soundStateForChannels = &a1->m_audioState.m_soundStateForChannels; next_low = SLODWORD(next[2].__next_); v25 = (int)next[2].__next_; LABEL_4: v7 = (0x101010101010101LL * ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL) + ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4)) & 0xF0F0F0F0F0F0F0FLL)) >> 56; if ( v7 > 1 ) { v8 = next_low; if ( value <= next_low ) { if ( !((value | next_low) >> 32) ) { v8 = (unsigned int)next_low % (unsigned int)value; v9 = p_m_soundStateForChannels->__table_.__bucket_list_.__ptr_.__value_[v8]; if ( !v9 ) goto LABEL_35; goto LABEL_11; } v8 = next_low % value; } v9 = p_m_soundStateForChannels->__table_.__bucket_list_.__ptr_.__value_[v8]; if ( !v9 ) goto LABEL_35; goto LABEL_11; } v8 = next_low & (value - 1); v9 = p_m_soundStateForChannels->__table_.__bucket_list_.__ptr_.__value_[v8]; if ( !v9 ) goto LABEL_35; LABEL_11: v10 = v9->__next_; if ( !v9->__next_ ) goto LABEL_35; if ( (unsigned int)v7 < 2 ) { v11 = value - 1; while ( 1 ) { v12 = v10[1].__next_; if ( v12 == (std::__hash_node_base, void *> *>::__next_pointer)next_low ) { if ( LODWORD(v10[2].__next_) == (_DWORD)next_low ) goto LABEL_29; } else if ( (v11 & (unsigned __int64)v12) != v8 ) { goto LABEL_35; } v10 = v10->__next_; if ( !v10 ) goto LABEL_35; } } while ( 1 ) { v13 = (unsigned __int64)v10[1].__next_; if ( v13 == next_low ) break; if ( v13 < value ) goto LABEL_25; if ( (value | v13) >> 32 ) { v13 %= value; LABEL_25: if ( v13 != v8 ) goto LABEL_35; goto LABEL_20; } if ( (unsigned int)v13 % (unsigned int)value != v8 ) goto LABEL_35; LABEL_20: v10 = v10->__next_; if ( !v10 ) goto LABEL_35; } if ( LODWORD(v10[2].__next_) != (_DWORD)next_low ) goto LABEL_20; LABEL_29: v21 = &v25; v14 = sub_1003EB830(&a1->m_audioState.m_soundStateForChannels, &v25, &unk_10081B0A2, &v21, v26); if ( !*(_BYTE *)(v14 + 196) ) { v15 = v14; v24 = FMODAudioEngine::channelForChannelID(a1, v25); if ( v24 ) { v23 = v15 + 72; v16 = (FMOD::Channel *)v24; FMOD::Channel::getLoopPoints( (FMOD::Channel *)v24, (unsigned int *)(v15 + 136), 1u, (unsigned int *)(v15 + 140), 1u); FMOD::ChannelControl::getDSPClock(v16, nullptr, (unsigned __int64 *)(v15 + 128)); FMOD::Channel::getPosition(v16, (unsigned int *)(v15 + 144), 1u); FMOD_Channel_GetFadePoints(v16, v23, 0, 0); if ( *(_DWORD *)(v15 + 72) ) FMOD_Channel_GetFadePoints(v24, v23, v15 + 96, v15 + 76); FMOD_Channel_GetDelay(v24, v15 + 152, v15 + 160, v15 + 168); } } LABEL_35: while ( 1 ) { next = next->__next_; if ( !next ) break; value = a1->m_audioState.m_soundStateForChannels.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_; next_low = SLODWORD(next[2].__next_); v25 = (int)next[2].__next_; if ( value ) goto LABEL_4; } LABEL_38: p_m_interval = (_QWORD *)&v22->m_interval; sub_1003DFFA0(v22, &a1->m_audioState); if ( p_m_interval[63] ) { v18 = (void **)p_m_interval[62]; if ( v18 ) { do { v20 = (void **)*v18; if ( ((_BYTE)v18[3] & 1) != 0 ) operator delete(v18[5]); operator delete(v18); v18 = v20; } while ( v20 ); } p_m_interval[62] = 0; v19 = p_m_interval[61]; if ( v19 ) __bzero(p_m_interval[60], 8 * v19); p_m_interval[63] = 0; } FMOD_System_UnlockDSP(a1->m_system); }