{"type": "func", "start": 6443584464, "end": 6443584965, "name": "sub_180114BD0", "pseudocode": "// \n// sub_180114BD0 from 0x180114bd0 to 0x180114dc5 (501 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x18016f588\n// > <???> @ 0x180201ed4\n// > <???> @ 0x180201ee0\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall sub_180114BD0(__int64 a1, __int64 a2, __int64 a3)\n{\n  char v3; // al\n  __int64 result; // rax\n  struct _RTL_CRITICAL_SECTION *v7; // rsi\n  int v8; // eax\n  int v9; // r8d\n  int v10; // edx\n  __int64 v11; // rcx\n  __int64 v12; // rcx\n  void *v13; // rcx\n  int v14; // eax\n  int v15; // r8d\n  int v16; // edx\n  __int64 v17; // rcx\n  __int64 v18; // rbx\n  unsigned int v19; // eax\n  int v20; // eax\n\n  v3 = *(_BYTE *)(a2 + 9);\n  switch ( v3 )\n  {\n    case 0:\n      result = sub_180114370(a1, a2, a3);\n      if ( (_DWORD)result )\n        return result;\n      return 0;\n    case 1:\n      v7 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 56);\n      FMOD_OS_CriticalSection_Enter(v7);\n      if ( !*(_DWORD *)(a1 + 116) )\n        goto LABEL_11;\n      v8 = *(_DWORD *)(a1 + 88);\n      if ( !v8 )\n        goto LABEL_11;\n      v9 = *(_DWORD *)(a2 + 12);\n      v10 = *(_DWORD *)(*(_QWORD *)(a1 + 80) + 4LL * (v9 & (v8 - 1)));\n      if ( v10 == -1 )\n        goto LABEL_11;\n      v11 = *(_QWORD *)(a1 + 96);\n      while ( *(_DWORD *)(v11 + 16LL * v10) != v9 )\n      {\n        v10 = *(_DWORD *)(v11 + 16LL * v10 + 4);\n        if ( v10 == -1 )\n          goto LABEL_11;\n      }\n      v12 = *(_QWORD *)(v11 + 16LL * v10 + 8);\n      if ( !v12 )\n        goto LABEL_11;\n      *(_DWORD *)(v12 + 24) = *(_DWORD *)(a2 + 16);\n      *(_DWORD *)(v12 + 20) = *(_DWORD *)(a2 + 20);\n      v13 = *(void **)(v12 + 8);\nLABEL_14:\n      sub_1800C14F0(v13);\nLABEL_11:\n      FMOD_OS_CriticalSection_Leave(v7);\n      return 0;\n    case 2:\n      result = sub_1801146F0(a1, (_DWORD *)a2, a3);\n      if ( !(_DWORD)result )\n        return 0;\n      break;\n    case 3:\n      v7 = *(struct _RTL_CRITICAL_SECTION **)(a1 + 56);\n      FMOD_OS_CriticalSection_Enter(v7);\n      if ( !*(_DWORD *)(a1 + 116) )\n        goto LABEL_11;\n      v14 = *(_DWORD *)(a1 + 88);\n      if ( !v14 )\n        goto LABEL_11;\n      v15 = *(_DWORD *)(a2 + 12);\n      v16 = *(_DWORD *)(*(_QWORD *)(a1 + 80) + 4LL * (v15 & (v14 - 1)));\n      if ( v16 == -1 )\n        goto LABEL_11;\n      v17 = *(_QWORD *)(a1 + 96);\n      while ( *(_DWORD *)(v17 + 16LL * v16) != v15 )\n      {\n        v16 = *(_DWORD *)(v17 + 16LL * v16 + 4);\n        if ( v16 == -1 )\n          goto LABEL_11;\n      }\n      v18 = *(_QWORD *)(v17 + 16LL * v16 + 8);\n      if ( !v18 )\n        goto LABEL_11;\n      v19 = *(_DWORD *)(v18 + 40);\n      if ( *(_DWORD *)(a2 + 24) != v19 || *(_DWORD *)(a2 + 28) > v19 )\n      {\n        FMOD_OS_CriticalSection_Leave(v7);\n        return 28;\n      }\n      v20 = *(_DWORD *)(a2 + 16);\n      if ( v20 )\n      {\n        v13 = *(void **)(v18 + 8);\n        *(_DWORD *)(v18 + 48) = v20;\n      }\n      else\n      {\n        memmove(*(void **)(v18 + 32), (const void *)(a2 + 32), *(unsigned int *)(a2 + 28));\n        v13 = *(void **)(v18 + 8);\n        *(_DWORD *)(v18 + 44) = *(_DWORD *)(a2 + 28);\n      }\n      goto LABEL_14;\n    case 4:\n      result = sub_180113F70(a1, a2);\n      if ( !(_DWORD)result )\n        return 0;\n      break;\n    default:\n      return 0;\n  }\n  return result;\n}", "assembly": "; \n; sub_180114BD0 from 0x180114bd0 to 0x180114dc5 (501 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x18016f588\n; > <???> @ 0x180201ed4\n; > <???> @ 0x180201ee0\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x180114bd0\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x180114bd5\npush    rdi                                                            ; +0xa, 0x180114bda\nsub     rsp, 20h                                                       ; +0xb, 0x180114bdb\nmovzx   eax, byte ptr [rdx+9]                                          ; +0xf, 0x180114bdf\nmov     rdi, rdx                                                       ; +0x13, 0x180114be3\nmov     rbx, rcx                                                       ; +0x16, 0x180114be6\ntest    al, al                                                         ; +0x19, 0x180114be9\njnz     short loc_180114C0A                                            ; +0x1b, 0x180114beb\ncall    sub_180114370                                                  ; +0x1d, 0x180114bed\ntest    eax, eax                                                       ; +0x22, 0x180114bf2\njz      loc_180114DB3                                                  ; +0x24, 0x180114bf4\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x2a, 0x180114bfa\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x2f, 0x180114bff\nadd     rsp, 20h                                                       ; +0x34, 0x180114c04\npop     rdi                                                            ; +0x38, 0x180114c08\nretn                                                                   ; +0x39, 0x180114c09\ncmp     al, 1                                                          ; +0x3a, 0x180114c0a\njnz     loc_180114CB8                                                  ; +0x3c, 0x180114c0c\nmov     rsi, [rcx+38h]                                                 ; +0x42, 0x180114c12\nmov     rcx, rsi                                                       ; +0x46, 0x180114c16\ncall    FMOD_OS_CriticalSection_Enter                                  ; +0x49, 0x180114c19\ncmp     dword ptr [rbx+74h], 0                                         ; +0x4e, 0x180114c1e\njz      short loc_180114C9E                                            ; +0x52, 0x180114c22\nmov     eax, [rbx+58h]                                                 ; +0x54, 0x180114c24\ntest    eax, eax                                                       ; +0x57, 0x180114c27\njz      short loc_180114C9E                                            ; +0x59, 0x180114c29\nmov     r8d, [rdi+0Ch]                                                 ; +0x5b, 0x180114c2b\ndec     eax                                                            ; +0x5f, 0x180114c2f\nand     eax, r8d                                                       ; +0x61, 0x180114c31\nmovsxd  rcx, eax                                                       ; +0x64, 0x180114c34\nmov     rax, [rbx+50h]                                                 ; +0x67, 0x180114c37\nmov     edx, [rax+rcx*4]                                               ; +0x6b, 0x180114c3b\ncmp     edx, 0FFFFFFFFh                                                ; +0x6e, 0x180114c3e\njz      short loc_180114C9E                                            ; +0x71, 0x180114c41\nmov     rcx, [rbx+60h]                                                 ; +0x73, 0x180114c43\nnop     word ptr [rax+rax+00000000h]                                   ; +0x77, 0x180114c47\nmovsxd  rax, edx                                                       ; +0x80, 0x180114c50\nadd     rax, rax                                                       ; +0x83, 0x180114c53\ncmp     [rcx+rax*8], r8d                                               ; +0x86, 0x180114c56\njz      short loc_180114C7F                                            ; +0x8a, 0x180114c5a\nmov     edx, [rcx+rax*8+4]                                             ; +0x8c, 0x180114c5c\ncmp     edx, 0FFFFFFFFh                                                ; +0x90, 0x180114c60\njnz     short loc_180114C50                                            ; +0x93, 0x180114c63\nmov     rcx, rsi                                                       ; +0x95, 0x180114c65\ncall    FMOD_OS_CriticalSection_Leave                                  ; +0x98, 0x180114c68\nxor     eax, eax                                                       ; +0x9d, 0x180114c6d\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x9f, 0x180114c6f\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xa4, 0x180114c74\nadd     rsp, 20h                                                       ; +0xa9, 0x180114c79\npop     rdi                                                            ; +0xad, 0x180114c7d\nretn                                                                   ; +0xae, 0x180114c7e\nmov     rcx, [rcx+rax*8+8]                                             ; +0xaf, 0x180114c7f\ntest    rcx, rcx                                                       ; +0xb4, 0x180114c84\njz      short loc_180114C9E                                            ; +0xb7, 0x180114c87\nmov     eax, [rdi+10h]                                                 ; +0xb9, 0x180114c89\nmov     [rcx+18h], eax                                                 ; +0xbc, 0x180114c8c\nmov     eax, [rdi+14h]                                                 ; +0xbf, 0x180114c8f\nmov     [rcx+14h], eax                                                 ; +0xc2, 0x180114c92\nmov     rcx, [rcx+8]                                                   ; +0xc5, 0x180114c95\ncall    sub_1800C14F0                                                  ; +0xc9, 0x180114c99\nmov     rcx, rsi                                                       ; +0xce, 0x180114c9e\ncall    FMOD_OS_CriticalSection_Leave                                  ; +0xd1, 0x180114ca1\nxor     eax, eax                                                       ; +0xd6, 0x180114ca6\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xd8, 0x180114ca8\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xdd, 0x180114cad\nadd     rsp, 20h                                                       ; +0xe2, 0x180114cb2\npop     rdi                                                            ; +0xe6, 0x180114cb6\nretn                                                                   ; +0xe7, 0x180114cb7\ncmp     al, 2                                                          ; +0xe8, 0x180114cb8\njnz     short loc_180114CD9                                            ; +0xea, 0x180114cba\ncall    sub_1801146F0                                                  ; +0xec, 0x180114cbc\ntest    eax, eax                                                       ; +0xf1, 0x180114cc1\njz      loc_180114DB3                                                  ; +0xf3, 0x180114cc3\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xf9, 0x180114cc9\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xfe, 0x180114cce\nadd     rsp, 20h                                                       ; +0x103, 0x180114cd3\npop     rdi                                                            ; +0x107, 0x180114cd7\nretn                                                                   ; +0x108, 0x180114cd8\ncmp     al, 3                                                          ; +0x109, 0x180114cd9\njnz     loc_180114DA6                                                  ; +0x10b, 0x180114cdb\nmov     rsi, [rcx+38h]                                                 ; +0x111, 0x180114ce1\nmov     rcx, rsi                                                       ; +0x115, 0x180114ce5\ncall    FMOD_OS_CriticalSection_Enter                                  ; +0x118, 0x180114ce8\ncmp     dword ptr [rbx+74h], 0                                         ; +0x11d, 0x180114ced\njz      short loc_180114C9E                                            ; +0x121, 0x180114cf1\nmov     eax, [rbx+58h]                                                 ; +0x123, 0x180114cf3\ntest    eax, eax                                                       ; +0x126, 0x180114cf6\njz      short loc_180114C9E                                            ; +0x128, 0x180114cf8\nmov     r8d, [rdi+0Ch]                                                 ; +0x12a, 0x180114cfa\ndec     eax                                                            ; +0x12e, 0x180114cfe\nand     eax, r8d                                                       ; +0x130, 0x180114d00\nmovsxd  rcx, eax                                                       ; +0x133, 0x180114d03\nmov     rax, [rbx+50h]                                                 ; +0x136, 0x180114d06\nmov     edx, [rax+rcx*4]                                               ; +0x13a, 0x180114d0a\ncmp     edx, 0FFFFFFFFh                                                ; +0x13d, 0x180114d0d\njz      short loc_180114C9E                                            ; +0x140, 0x180114d10\nmov     rcx, [rbx+60h]                                                 ; +0x142, 0x180114d12\nnop     word ptr [rax+rax+00000000h]                                   ; +0x146, 0x180114d16\nmovsxd  rax, edx                                                       ; +0x150, 0x180114d20\nadd     rax, rax                                                       ; +0x153, 0x180114d23\ncmp     [rcx+rax*8], r8d                                               ; +0x156, 0x180114d26\njz      short loc_180114D3A                                            ; +0x15a, 0x180114d2a\nmov     edx, [rcx+rax*8+4]                                             ; +0x15c, 0x180114d2c\ncmp     edx, 0FFFFFFFFh                                                ; +0x160, 0x180114d30\njnz     short loc_180114D20                                            ; +0x163, 0x180114d33\njmp     loc_180114C9E                                                  ; +0x165, 0x180114d35\nmov     rbx, [rcx+rax*8+8]                                             ; +0x16a, 0x180114d3a\ntest    rbx, rbx                                                       ; +0x16f, 0x180114d3f\njz      loc_180114C9E                                                  ; +0x172, 0x180114d42\nmov     eax, [rbx+28h]                                                 ; +0x178, 0x180114d48\ncmp     [rdi+18h], eax                                                 ; +0x17b, 0x180114d4b\njnz     short loc_180114D89                                            ; +0x17e, 0x180114d4e\nmov     ecx, [rdi+1Ch]                                                 ; +0x180, 0x180114d50\ncmp     ecx, eax                                                       ; +0x183, 0x180114d53\nja      short loc_180114D89                                            ; +0x185, 0x180114d55\nmov     eax, [rdi+10h]                                                 ; +0x187, 0x180114d57\ntest    eax, eax                                                       ; +0x18a, 0x180114d5a\njz      short loc_180114D6A                                            ; +0x18c, 0x180114d5c\nmov     rcx, [rbx+8]                                                   ; +0x18e, 0x180114d5e\nmov     [rbx+30h], eax                                                 ; +0x192, 0x180114d62\njmp     loc_180114C99                                                  ; +0x195, 0x180114d65\nmov     r8, rcx; Size                                                  ; +0x19a, 0x180114d6a\nlea     rdx, [rdi+20h]; Src                                            ; +0x19d, 0x180114d6d\nmov     rcx, [rbx+20h]; void *                                         ; +0x1a1, 0x180114d71\ncall    memmove                                                        ; +0x1a5, 0x180114d75\nmov     eax, [rdi+1Ch]                                                 ; +0x1aa, 0x180114d7a\nmov     rcx, [rbx+8]                                                   ; +0x1ad, 0x180114d7d\nmov     [rbx+2Ch], eax                                                 ; +0x1b1, 0x180114d81\njmp     loc_180114C99                                                  ; +0x1b4, 0x180114d84\nmov     rcx, rsi                                                       ; +0x1b9, 0x180114d89\ncall    FMOD_OS_CriticalSection_Leave                                  ; +0x1bc, 0x180114d8c\nmov     eax, 1Ch                                                       ; +0x1c1, 0x180114d91\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x1c6, 0x180114d96\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x1cb, 0x180114d9b\nadd     rsp, 20h                                                       ; +0x1d0, 0x180114da0\npop     rdi                                                            ; +0x1d4, 0x180114da4\nretn                                                                   ; +0x1d5, 0x180114da5\ncmp     al, 4                                                          ; +0x1d6, 0x180114da6\njnz     short loc_180114DB3                                            ; +0x1d8, 0x180114da8\ncall    sub_180113F70                                                  ; +0x1da, 0x180114daa\ntest    eax, eax                                                       ; +0x1df, 0x180114daf\njnz     short loc_180114DB5                                            ; +0x1e1, 0x180114db1\nxor     eax, eax                                                       ; +0x1e3, 0x180114db3\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x1e5, 0x180114db5\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x1ea, 0x180114dba\nadd     rsp, 20h                                                       ; +0x1ef, 0x180114dbf\npop     rdi                                                            ; +0x1f3, 0x180114dc3\nretn                                                                   ; +0x1f4, 0x180114dc4", "xrefs": ["<???> @ 0x18016f588", "<???> @ 0x180201ed4", "<???> @ 0x180201ee0"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}