// // sub_1004D41B4 from 0x1004d41b4 to 0x1004d4698 (1252 bytes) // // 7 xrefs: // > sub_100442E2C @ 0x100443004 // > sub_1004CF54C @ 0x1004cf564 // > sub_1004D4698 @ 0x1004d46b4 // > sub_1004D46E4 @ 0x1004d471c // > sub_1004D47F4 @ 0x1004d481c // > sub_1004D4978 @ 0x1004d4994 // > sub_1004D4A00 @ 0x1004d4a1c // // 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_1004D41B4(__int64 a1) { __int64 result; // x0 int v3; // w9 __int64 v4; // x8 __int64 v5; // x0 __int64 v6; // x8 __int64 v7; // x9 __int64 v8; // x10 unsigned int *v9; // x11 __int64 v10; // x12 unsigned int v11; // w14 _DWORD *v12; // x9 __int64 v13; // x8 __int64 v14; // x20 __int64 v15; // x9 void (__fastcall *v16)(__int64, __int64, _OWORD *, __int64, __int128 *, char *, __int64 *, int *); // x8 int v17; // w8 int v18; // w8 __int64 v19; // x8 __int64 v20; // x10 __int64 v21; // x9 __int64 v22; // x27 int v23; // w8 _DWORD *v24; // x0 _DWORD *v25; // x8 _OWORD *v26; // x9 __int64 v27; // x9 _BYTE *v28; // x0 int v29; // w8 int v30; // w8 int v31; // w8 int v32; // [xsp+Ch] [xbp-1A4h] BYREF __int64 v33; // [xsp+10h] [xbp-1A0h] BYREF _QWORD v34[3]; // [xsp+18h] [xbp-198h] BYREF __int128 v35; // [xsp+30h] [xbp-180h] BYREF _OWORD v36[16]; // [xsp+40h] [xbp-170h] BYREF if ( !*(_BYTE *)(a1 + 8) ) return 67; if ( *(_BYTE *)(a1 + 69984) ) return 80; v34[0] = 0; if ( !*(_QWORD *)(*(_QWORD *)(a1 + 1648) + 984LL) ) { LABEL_14: if ( HIDWORD(v34[0]) == *(_DWORD *)(a1 + 1688) ) return 0; LABEL_16: v6 = *(unsigned int *)(a1 + 1684); if ( (int)v6 >= 1 ) { v7 = *(_QWORD *)(a1 + 1696); if ( (_DWORD)v6 == 1 ) { v8 = 0; } else { v8 = (unsigned int)v6 & 0xFFFFFFFE; v9 = (unsigned int *)(v7 + 80); v10 = v8; do { v11 = *v9 & 0xFFFFFFFE; *(v9 - 14) &= ~1u; *v9 = v11; v9 += 28; v10 -= 2; } while ( v10 ); if ( v8 == v6 ) goto LABEL_24; } v12 = (_DWORD *)(v7 + 56 * v8 + 24); v13 = v6 - v8; do { *v12 &= ~1u; v12 += 14; --v13; } while ( v13 ); } LABEL_24: *(_DWORD *)(a1 + 1688) = 0; if ( SHIDWORD(v34[0]) < 1 ) { LABEL_68: *(_BYTE *)(a1 + 1704) = 1; return 0; } v14 = 0; while ( 1 ) { memset(v36, 0, sizeof(v36)); v35 = 0u; v33 = 0; v32 = 0; v15 = *(_QWORD *)(a1 + 1648); v16 = *(void (__fastcall **)(__int64, __int64, _OWORD *, __int64, __int128 *, char *, __int64 *, int *))(v15 + 992); if ( !v16 ) return 66; v16(v15 + 8, v14, v36, 256, &v35, (char *)&v33 + 4, &v33, &v32); v34[1] = 0; v34[2] = 0; if ( v35 == 0 ) return 28; v17 = 2; switch ( v32 ) { case 0: v18 = 1; switch ( (int)v33 ) { case 0: LODWORD(v33) = 2; v18 = 1; goto LABEL_66; case 1: goto LABEL_62; case 2: goto LABEL_66; case 3: goto LABEL_61; case 4: case 5: case 6: v18 = v33; goto LABEL_66; case 7: v18 = 8; goto LABEL_66; case 8: v18 = 12; goto LABEL_66; default: if ( (_DWORD)v33 == 1000 ) LABEL_61: v18 = 2; else LABEL_62: v18 = 0; LABEL_66: v32 = v18; if ( !HIDWORD(v33) ) goto LABEL_38; goto LABEL_39; } case 1: goto LABEL_37; case 2: v17 = 3; goto LABEL_37; case 4: case 5: case 6: LODWORD(v33) = v32; if ( !HIDWORD(v33) ) goto LABEL_38; goto LABEL_39; case 8: v17 = 7; goto LABEL_37; case 12: v17 = 8; goto LABEL_37; default: v17 = 1; LABEL_37: LODWORD(v33) = v17; if ( !HIDWORD(v33) ) LABEL_38: HIDWORD(v33) = 48000; LABEL_39: v19 = *(unsigned int *)(a1 + 1684); if ( (int)v19 < 1 ) goto LABEL_45; v20 = 0; v21 = *(_QWORD *)(a1 + 1696); break; } while ( 1 ) { v22 = v21 + v20; if ( *(_OWORD *)(v21 + v20 + 28) == v35 ) break; v20 += 56; if ( 56 * v19 == v20 ) goto LABEL_45; } if ( !v21 ) { LABEL_45: if ( (_DWORD)v19 == *(_DWORD *)(a1 + 1692) ) { sub_100442B5C(a1, 0x11u); v23 = *(_DWORD *)(a1 + 1692) + 8; *(_DWORD *)(a1 + 1692) = v23; v24 = sub_1004B152C( *((_QWORD *)off_1008524C8 + 54), *(_DWORD **)(a1 + 1696), 56 * v23, (char)"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_systemi.cpp", 5317, 0); *(_QWORD *)(a1 + 1696) = v24; if ( !v24 ) { sub_100442B7C(a1, 0x11u); return 38; } v25 = &v24[14 * *(int *)(a1 + 1692)]; v26 = v25 - 112; *((_OWORD *)v25 - 2) = 0u; *((_OWORD *)v25 - 1) = 0u; *((_OWORD *)v25 - 4) = 0u; *((_OWORD *)v25 - 3) = 0u; *((_OWORD *)v25 - 6) = 0u; *((_OWORD *)v25 - 5) = 0u; *((_OWORD *)v25 - 8) = 0u; *((_OWORD *)v25 - 7) = 0u; *((_OWORD *)v25 - 10) = 0u; *((_OWORD *)v25 - 9) = 0u; *((_OWORD *)v25 - 12) = 0u; *((_OWORD *)v25 - 11) = 0u; *((_OWORD *)v25 - 14) = 0u; *((_OWORD *)v25 - 13) = 0u; *((_OWORD *)v25 - 16) = 0u; *((_OWORD *)v25 - 15) = 0u; v26[10] = 0u; v26[11] = 0u; v26[8] = 0u; v26[9] = 0u; v26[6] = 0u; v26[7] = 0u; v26[4] = 0u; v26[5] = 0u; v26[2] = 0u; v26[3] = 0u; *v26 = 0u; v26[1] = 0u; sub_100442B7C(a1, 0x11u); LODWORD(v19) = *(_DWORD *)(a1 + 1684); } v27 = *(_QWORD *)(a1 + 1696); *(_DWORD *)(a1 + 1684) = v19 + 1; v22 = v27 + 56LL * (int)v19; } if ( !*(_QWORD *)v22 ) goto LABEL_52; if ( (unsigned int)sub_1004C6FC4(*(unsigned __int8 **)v22, (unsigned __int8 *)v36) ) break; if ( !*(_QWORD *)v22 ) goto LABEL_52; LABEL_53: *(_OWORD *)(v22 + 28) = v35; v29 = HIDWORD(v33); *(_DWORD *)(v22 + 8) = v14; *(_DWORD *)(v22 + 12) = v29; v30 = v33; *(_DWORD *)(v22 + 16) = v32; *(_DWORD *)(v22 + 20) = v30; if ( (_DWORD)v14 ) v31 = 1; else v31 = 3; *(_DWORD *)(v22 + 24) = v31; ++*(_DWORD *)(a1 + 1688); v14 = (unsigned int)(v14 + 1); if ( (int)v14 >= SHIDWORD(v34[0]) ) goto LABEL_68; } sub_1004B1970(*((_QWORD *)off_1008524C8 + 54), *(int **)v22); *(_QWORD *)v22 = 0; LABEL_52: v28 = sub_1004C71E4((char *)v36); *(_QWORD *)v22 = v28; if ( !v28 ) return 38; goto LABEL_53; } LODWORD(v36[0]) = 0; sub_1004B5828(v36); v3 = *(_DWORD *)(a1 + 1708); HIDWORD(v34[0]) = *(_DWORD *)(a1 + 1688); if ( v3 && (unsigned int)(LODWORD(v36[0]) - v3) < 0x3E8 || ((*(_DWORD *)(a1 + 1708) = v36[0], (v4 = *(_QWORD *)(a1 + 1648)) != 0) ? (v5 = v4 + 8) : (v5 = 0), result = (*(__int64 (__fastcall **)(__int64, char *, _QWORD *))(v4 + 984))(v5, (char *)v34 + 4, v34), !(_DWORD)result) ) { if ( LODWORD(v34[0]) ) goto LABEL_16; goto LABEL_14; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source