// // sub_180112F10 from 0x180112f10 to 0x18011305a (330 bytes) // // 3 xrefs: // > sub_1801125B0 @ 0x1801126b4 // > sub_180113070 @ 0x1801130cc // > @ 0x180201c94 // // 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 10:54:36 +0000 // __int64 __fastcall sub_180112F10(__int64 a1, int a2, char a3, __int64 a4) { __int64 result; // rax int v9; // edx struct _RTL_CRITICAL_SECTION *v10; // r15 int v11; // edi unsigned int v12; // esi int v13; // ecx int v14; // r8d int v15; // r9d int v16; // edx struct _RTL_CRITICAL_SECTION *v17; // rcx if ( *(_BYTE *)(a1 + 24) ) return 0; while ( 1 ) { result = FMOD_OS_CriticalSection_Enter(*(struct _RTL_CRITICAL_SECTION **)(a1 + 32)); if ( (_DWORD)result ) return result; if ( !*(_DWORD *)(a1 + 20) ) { v9 = *(_DWORD *)(a1 + 8); if ( v9 >= a2 ) { v13 = *(_DWORD *)(a1 + 12) & (v9 - 1); v14 = a2; v15 = v9 + *(_DWORD *)(a1 + 16) - *(_DWORD *)(a1 + 12); v16 = v9 - v13; *(_QWORD *)(a4 + 8) = *(_QWORD *)a1 + v13; *(_QWORD *)(a4 + 16) = 0; *(_DWORD *)(a4 + 24) = a2; *(_DWORD *)(a4 + 28) = 0; if ( v16 < a2 ) { *(_DWORD *)(a4 + 24) = v16; *(_QWORD *)(a4 + 16) = *(_QWORD *)a1; if ( a3 ) { v14 = v16 + a2; *(_DWORD *)(a4 + 28) = a2; } else { *(_DWORD *)(a4 + 28) = a2 - v16; } } if ( v15 >= v14 ) { *(_QWORD *)a4 = *(_QWORD *)(a1 + 32); return 0; } } else { v10 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 32); *(_DWORD *)(a1 + 20) = a2; FMOD_OS_CriticalSection_Enter(v10); v11 = 0; if ( *(int *)(a1 + 56) > 0 ) { while ( 1 ) { v12 = sub_1800C14F0(*(void **)(a1 + 40)); if ( v12 ) break; if ( ++v11 >= *(_DWORD *)(a1 + 56) ) goto LABEL_8; } FMOD_OS_CriticalSection_Leave(v10); return v12; } LABEL_8: *(_DWORD *)(a1 + 56) = 0; FMOD_OS_CriticalSection_Leave(v10); } } v17 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 32); ++*(_DWORD *)(a1 + 60); result = FMOD_OS_CriticalSection_Leave(v17); if ( (_DWORD)result ) return result; result = sub_1800C1520(*(void **)(a1 + 48)); if ( (_DWORD)result ) return result; if ( *(_BYTE *)(a1 + 24) ) return 0; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source