// // sub_1800C9FF0 from 0x1800c9ff0 to 0x1800ca42e (1086 bytes) // // 4 xrefs: // > @ 0x18016c680 // > @ 0x18018b2b4 // > @ 0x18018b2c4 // > @ 0x1801fe43c // // 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_1800C9FF0(__int64 a1, unsigned int a2, unsigned int a3, char a4) { unsigned int v8; // ebp int v9; // r15d __int64 result; // rax __int64 v11; // rdi __int64 v12; // rax unsigned int v13; // r14d __int64 *v14; // rcx unsigned int v15; // edi __int64 v16; // rax __int64 v17; // rcx __int64 v18; // rdx __int64 *v19; // rcx __int64 v20; // rax __int64 v21; // rcx __int64 v22; // rdx __int64 v23; // rcx _QWORD *v24; // rbx struct _RTL_CRITICAL_SECTION *v25; // r14 __int64 v26; // rcx _QWORD *v27; // r8 void *v28; // rcx __int64 v29; // rdx __int64 v30; // rcx __int64 v31; // rcx __int64 v32; // rcx unsigned __int64 v33; // [rsp+60h] [rbp+8h] BYREF v8 = 0; v9 = 0; if ( *(char *)(a1 + 60) < 0 ) return 30; v11 = *(_QWORD *)(a1 + 40); if ( !v11 ) return 31; if ( *(_DWORD *)(v11 + 272) == 7 && !a4 ) return 46; sub_1801021C0(*(_QWORD *)(a1 + 8), 8); v12 = *(_QWORD *)(a1 + 24); if ( v12 ) v9 = *(_DWORD *)(v12 + 72); sub_180102300(*(_QWORD *)(a1 + 8), 8); if ( !*(_QWORD *)(a1 + 24) ) return 0; if ( (v9 & 0x40000) != 0 && (v9 & 0x200000) == 0 && a2 && a3 == 2 ) { v13 = *(_DWORD *)(v11 + 64) - *(_DWORD *)(*(_QWORD *)(v11 + 384) + 68LL); if ( a2 >= v13 && a2 < v13 + *(_DWORD *)(v11 + 396) ) { sub_1801021C0(*(_QWORD *)(a1 + 8), 8); v14 = *(__int64 **)(a1 + 192); v15 = a2 - v13; if ( v14 ) { v16 = *v14; v33 = __PAIR64__(v15, 0); (*(void (__fastcall **)(__int64 *, unsigned __int64))(v16 + 120))(v14, __PAIR64__(v15, 0)); } sub_180102300(*(_QWORD *)(a1 + 8), 8); *(_DWORD *)(a1 + 148) = v15; *(_DWORD *)(a1 + 144) = 0; *(_DWORD *)(a1 + 76) = a2; *(_DWORD *)(a1 + 72) = 0; return 0; } } else if ( a3 == 16 ) { sub_1801021C0(*(_QWORD *)(a1 + 8), 8); v17 = *(_QWORD *)(a1 + 192); if ( v17 ) (*(void (__fastcall **)(__int64, _QWORD, __int64, _QWORD))(*(_QWORD *)v17 + 208LL))(v17, a2, 16, 0); v18 = 8; goto LABEL_57; } if ( (*(_DWORD *)(v11 + 88) & 0x80u) == 0 ) { if ( a3 == 2 && *(_DWORD *)(v11 + 192) == *(_DWORD *)(*(_QWORD *)(v11 + 96) + 284LL) && (*(_DWORD *)(v11 + 88) & 0x10) == 0 && ((*(_BYTE *)(a1 + 60) & 0x40) == 0 || (v9 & 0x10000) != 0) ) { return v8; } if ( (*(_DWORD *)(v11 + 44) & 0x10000) != 0 && !a4 ) { sub_1801021C0(*(_QWORD *)(a1 + 8), 8); v21 = *(_QWORD *)(a1 + 8); *(_DWORD *)(a1 + 60) |= 0x4000u; sub_180102300(v21, 8); v23 = *(_QWORD *)(a1 + 192); if ( v23 ) { LOBYTE(v22) = 1; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v23 + 80LL))(v23, v22); } sub_1800DE780(*(_QWORD *)(v11 + 384), 0, *(unsigned int *)(*(_QWORD *)(v11 + 384) + 68LL)); v24 = *(_QWORD **)(*(_QWORD *)(v11 + 264) + 16LL); v25 = (struct _RTL_CRITICAL_SECTION *)v24[45]; FMOD_OS_CriticalSection_Enter(v25); _InterlockedExchange((volatile __int32 *)(v11 + 272), 7); v26 = *(_QWORD *)(v11 + 184); if ( v26 ) _InterlockedExchange((volatile __int32 *)(v26 + 272), 7); *(_DWORD *)(*(_QWORD *)(v11 + 264) + 284LL) = a2; *(_DWORD *)(*(_QWORD *)(v11 + 264) + 288LL) = a3; *(_QWORD *)(*(_QWORD *)(v11 + 264) + 40LL) = v11; v27 = (_QWORD *)(*(_QWORD *)(v11 + 264) + 24LL); v27[1] = v24[43]; *v27 = v24 + 42; v24[43] = v27; *(_QWORD *)v27[1] = v27; FMOD_OS_CriticalSection_Leave(v25); v28 = (void *)v24[37]; if ( v28 ) sub_1800C14F0(v28); return v8; } LOBYTE(v33) = 0; if ( !a4 ) { sub_1801021C0(*(_QWORD *)(a1 + 8), 9); v8 = (*(__int64 (__fastcall **)(_QWORD, unsigned __int64 *))(**(_QWORD **)(a1 + 192) + 88LL))( *(_QWORD *)(a1 + 192), &v33); if ( v8 ) { LABEL_56: v18 = 9; LABEL_57: sub_180102300(*(_QWORD *)(a1 + 8), v18); return v8; } v30 = *(_QWORD *)(a1 + 192); if ( v30 ) { LOBYTE(v29) = 1; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v30 + 80LL))(v30, v29); } } v8 = sub_1800DD7C0(v11, a2, a3); if ( !v8 ) { sub_1801021C0(*(_QWORD *)(a1 + 8), 8); v31 = *(_QWORD *)(a1 + 192); if ( v31 ) (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v31 + 120LL))(v31, 0); sub_180102300(*(_QWORD *)(a1 + 8), 8); *(_QWORD *)(a1 + 144) = 0; *(_QWORD *)(a1 + 152) = 0; *(_DWORD *)(a1 + 160) = 0; if ( a3 == 2 ) *(_DWORD *)(a1 + 76) = a2; else sub_180012510(*(_QWORD *)(v11 + 96), (_DWORD *)(a1 + 76), 2); v8 = sub_1800DD5E0(v11); } if ( a4 ) return v8; v32 = *(_QWORD *)(a1 + 192); if ( v32 ) (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v32 + 80LL))(v32, (unsigned __int8)v33); goto LABEL_56; } v19 = *(__int64 **)(a1 + 192); if ( !v19 || (v20 = *v19, v33 = __PAIR64__(a2, 0), result = (*(__int64 (__fastcall **)(__int64 *, unsigned __int64))(v20 + 120))(v19, __PAIR64__(a2, 0)), (v8 = result) == 0) ) { *(_DWORD *)(a1 + 76) = a2; *(_DWORD *)(a1 + 148) = a2; *(_DWORD *)(a1 + 72) = 0; *(_DWORD *)(a1 + 144) = 0; *(_QWORD *)(a1 + 152) = 0; *(_DWORD *)(a1 + 160) = 0; return v8; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source