{"type": "func", "start": 5369125664, "end": 5369126235, "name": "FMODAudioEngine::createStream", "pseudocode": "// \n// FMODAudioEngine::createStream from 0x140065b20 to 0x140065d5b (571 bytes)\n// \n// 2 xrefs:\n// > FMODAudioEngine::preloadMusic @ 0x140065876\n// > <???> @ 0x140910e14\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:25:45 +0000\n// \n\n// Hidden C++ exception states: #wind=4\n__int64 __fastcall FMODAudioEngine::createStream(__int64 a1, _QWORD *a2)\n{\n  __int64 v4; // rax\n  _QWORD *v5; // r8\n  _QWORD *v6; // rax\n  size_t v7; // r8\n  _QWORD *v8; // rsi\n  unsigned __int64 v9; // rax\n  char *v10; // rbx\n  __int64 v11; // rax\n  void **v12; // rdx\n  int v13; // eax\n  __int64 v14; // rbx\n  void *v15; // rcx\n  void *v17; // rcx\n  __int64 v18; // [rsp+30h] [rbp-D0h] BYREF\n  _DWORD v19[56]; // [rsp+40h] [rbp-C0h] BYREF\n  _QWORD *v20; // [rsp+120h] [rbp+20h]\n  void *Block[2]; // [rsp+128h] [rbp+28h] BYREF\n  __m128i si128; // [rsp+138h] [rbp+38h]\n  _BYTE v23[32]; // [rsp+148h] [rbp+48h] BYREF\n\n  v20 = a2;\n  v4 = cocos2d::CCFileUtils::sharedFileUtils();\n  v5 = a2;\n  if ( a2[3] > 0xFu )\n    v5 = (_QWORD *)*a2;\n  v6 = (_QWORD *)(*(__int64 (__fastcall **)(__int64, _BYTE *, _QWORD *, _QWORD))(*(_QWORD *)v4 + 40LL))(v4, v23, v5, 0);\n  if ( v6[3] > 0xFu )\n    v6 = (_QWORD *)*v6;\n  *(_OWORD *)Block = 0;\n  si128 = 0;\n  v7 = -1;\n  do\n    ++v7;\n  while ( *((_BYTE *)v6 + v7) );\n  sub_14003D230(Block, v6, v7);\n  sub_14003D310((__int64)v23);\n  memset(&v19[1], 0, 0xDCu);\n  v19[0] = 224;\n  v8 = a2;\n  if ( a2[3] > 0xFu )\n    v8 = (_QWORD *)*a2;\n  v9 = a2[2];\n  if ( v9 < 4\n    || (v10 = (char *)v8 + v9, v11 = sub_1406774C0(v8, (char *)v8 + v9, \".ogg\", 4), (char *)v11 == v10)\n    || (v19[28] = 10, v11 - (_QWORD)v8 == -1) )\n  {\n    v19[28] = 9;\n  }\n  v12 = Block;\n  if ( si128.m128i_i64[1] > 0xFuLL )\n    v12 = (void **)Block[0];\n  v13 = FMOD::System::createStream(*(_QWORD *)(a1 + 560), v12, 134299658, v19, &v18);\n  *(_DWORD *)(a1 + 608) = v13;\n  if ( !v13 )\n  {\n    FMOD::Sound::setLoopCount(v18, 0);\n    v14 = v18;\n    if ( si128.m128i_i64[1] <= 0xFuLL )\n    {\nLABEL_20:\n      si128 = _mm_load_si128((const __m128i *)&Size);\n      LOBYTE(Block[0]) = 0;\n      sub_14003D310((__int64)a2);\n      return v14;\n    }\n    v15 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) < 0x1000\n      || (v15 = *((void **)Block[0] - 1), (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) <= 0x1F) )\n    {\n      j_j_free(v15);\n      goto LABEL_20;\n    }\nLABEL_24:\n    invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n  }\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v17 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v17 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )\n        goto LABEL_24;\n    }\n    j_j_free(v17);\n  }\n  si128 = _mm_load_si128((const __m128i *)&Size);\n  LOBYTE(Block[0]) = 0;\n  sub_14003D310((__int64)a2);\n  return 0;\n}", "assembly": "; \n; FMODAudioEngine::createStream from 0x140065b20 to 0x140065d5b (571 bytes)\n; \n; 2 xrefs:\n; > FMODAudioEngine::preloadMusic @ 0x140065876\n; > <???> @ 0x140910e14\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:25:45 +0000\n; \nmov     [rsp-8+arg_10], rbx                                            ; +0x0, 0x140065b20\nmov     [rsp-8+arg_18], rsi                                            ; +0x5, 0x140065b25\npush    rbp                                                            ; +0xa, 0x140065b2a\npush    rdi                                                            ; +0xb, 0x140065b2b\npush    r14                                                            ; +0xc, 0x140065b2c\nlea     rbp, [rsp-70h]                                                 ; +0xe, 0x140065b2e\nsub     rsp, 170h                                                      ; +0x13, 0x140065b33\nmov     rax, cs:__security_cookie                                      ; +0x1a, 0x140065b3a\nxor     rax, rsp                                                       ; +0x21, 0x140065b41\nmov     [rbp+80h+var_18], rax                                          ; +0x24, 0x140065b44\nmov     rdi, rdx                                                       ; +0x28, 0x140065b48\nmov     r14, rcx                                                       ; +0x2b, 0x140065b4b\nmov     [rbp+80h+var_60], rdx                                          ; +0x2e, 0x140065b4e\ncall    cs:?sharedFileUtils@CCFileUtils@cocos2d@@SAPEAV12@XZ; cocos2d::CCFileUtils::sharedFileUtils(void) ; +0x32, 0x140065b52\nmov     r8, rdi                                                        ; +0x38, 0x140065b58\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0x3b, 0x140065b5b\njbe     short loc_140065B65                                            ; +0x40, 0x140065b60\nmov     r8, [rdi]                                                      ; +0x42, 0x140065b62\nmov     rcx, [rax]                                                     ; +0x45, 0x140065b65\nmov     r10, [rcx+28h]                                                 ; +0x48, 0x140065b68\nxor     r9d, r9d                                                       ; +0x4c, 0x140065b6c\nlea     rdx, [rbp+80h+var_38]                                          ; +0x4f, 0x140065b6f\nmov     rcx, rax                                                       ; +0x53, 0x140065b73\ncall    r10                                                            ; +0x56, 0x140065b76\nnop                                                                    ; +0x59, 0x140065b79\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x5a, 0x140065b7a\njbe     short loc_140065B84                                            ; +0x5f, 0x140065b7f\nmov     rax, [rax]                                                     ; +0x61, 0x140065b81\nxorps   xmm0, xmm0                                                     ; +0x64, 0x140065b84\nmovups  xmmword ptr [rbp+80h+Block], xmm0                              ; +0x67, 0x140065b87\nxorps   xmm1, xmm1                                                     ; +0x6b, 0x140065b8b\nmovdqu  [rbp+80h+var_48], xmm1                                         ; +0x6e, 0x140065b8e\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x73, 0x140065b93\nnop     word ptr [rax+rax+00h]                                         ; +0x7a, 0x140065b9a\ninc     r8                                                             ; +0x80, 0x140065ba0\ncmp     byte ptr [rax+r8], 0                                           ; +0x83, 0x140065ba3\njnz     short loc_140065BA0                                            ; +0x88, 0x140065ba8\nmov     rdx, rax                                                       ; +0x8a, 0x140065baa\nlea     rcx, [rbp+80h+Block]                                           ; +0x8d, 0x140065bad\ncall    sub_14003D230                                                  ; +0x91, 0x140065bb1\nnop                                                                    ; +0x96, 0x140065bb6\nlea     rcx, [rbp+80h+var_38]                                          ; +0x97, 0x140065bb7\ncall    sub_14003D310                                                  ; +0x9b, 0x140065bbb\nxor     edx, edx; Val                                                  ; +0xa0, 0x140065bc0\nmov     r8d, 0DCh; Size                                                ; +0xa2, 0x140065bc2\nlea     rcx, [rsp+180h+var_13C]; void *                                ; +0xa8, 0x140065bc8\ncall    memset                                                         ; +0xad, 0x140065bcd\nmov     [rsp+180h+var_140], 0E0h                                       ; +0xb2, 0x140065bd2\nmov     rsi, rdi                                                       ; +0xba, 0x140065bda\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xbd, 0x140065bdd\njbe     short loc_140065BE7                                            ; +0xc2, 0x140065be2\nmov     rsi, [rdi]                                                     ; +0xc4, 0x140065be4\nmov     rax, [rdi+10h]                                                 ; +0xc7, 0x140065be7\ncmp     rax, 4                                                         ; +0xcb, 0x140065beb\njb      short loc_140065C22                                            ; +0xcf, 0x140065bef\nlea     rbx, [rax+rsi]                                                 ; +0xd1, 0x140065bf1\nmov     r9d, 4                                                         ; +0xd5, 0x140065bf5\nlea     r8, aOgg; \".ogg\"                                               ; +0xdb, 0x140065bfb\nmov     rdx, rbx                                                       ; +0xe2, 0x140065c02\nmov     rcx, rsi                                                       ; +0xe5, 0x140065c05\ncall    sub_1406774C0                                                  ; +0xe8, 0x140065c08\ncmp     rax, rbx                                                       ; +0xed, 0x140065c0d\njz      short loc_140065C22                                            ; +0xf0, 0x140065c10\nsub     rax, rsi                                                       ; +0xf2, 0x140065c12\ncmp     rax, 0FFFFFFFFFFFFFFFFh                                        ; +0xf5, 0x140065c15\nmov     [rbp+80h+var_D0], 0Ah                                          ; +0xf9, 0x140065c19\njnz     short loc_140065C29                                            ; +0x100, 0x140065c20\nmov     [rbp+80h+var_D0], 9                                            ; +0x102, 0x140065c22\nlea     rdx, [rbp+80h+Block]                                           ; +0x109, 0x140065c29\ncmp     qword ptr [rbp+80h+var_48+8], 0Fh                              ; +0x10d, 0x140065c2d\ncmova   rdx, [rbp+80h+Block]                                           ; +0x112, 0x140065c32\nlea     rax, [rsp+180h+var_150]                                        ; +0x117, 0x140065c37\nmov     [rsp+180h+Reserved], rax                                       ; +0x11c, 0x140065c3c\nlea     r9, [rsp+180h+var_140]                                         ; +0x121, 0x140065c41\nmov     r8d, 801400Ah                                                  ; +0x126, 0x140065c46\nmov     rcx, [r14+230h]                                                ; +0x12c, 0x140065c4c\ncall    cs:?createStream@System@FMOD@@QEAA?AW4FMOD_RESULT@@PEBDIPEAUFMOD_CREATESOUNDEXINFO@@PEAPEAVSound@2@@Z; FMOD::System::createStream(char const *,uint,FMOD_CREATESOUNDEXINFO *,FMOD::Sound * *) ; +0x133, 0x140065c53\nmov     [r14+260h], eax                                                ; +0x139, 0x140065c59\ntest    eax, eax                                                       ; +0x140, 0x140065c60\njnz     short loc_140065CCB                                            ; +0x142, 0x140065c62\nxor     edx, edx                                                       ; +0x144, 0x140065c64\nmov     rcx, [rsp+180h+var_150]                                        ; +0x146, 0x140065c66\ncall    cs:?setLoopCount@Sound@FMOD@@QEAA?AW4FMOD_RESULT@@H@Z; FMOD::Sound::setLoopCount(int) ; +0x14b, 0x140065c6b\nmov     rbx, [rsp+180h+var_150]                                        ; +0x151, 0x140065c71\nmov     rdx, qword ptr [rbp+80h+var_48+8]                              ; +0x156, 0x140065c76\ncmp     rdx, 0Fh                                                       ; +0x15a, 0x140065c7a\njbe     short loc_140065CAD                                            ; +0x15e, 0x140065c7e\ninc     rdx                                                            ; +0x160, 0x140065c80\nmov     rcx, [rbp+80h+Block]                                           ; +0x163, 0x140065c83\nmov     rax, rcx                                                       ; +0x167, 0x140065c87\ncmp     rdx, 1000h                                                     ; +0x16a, 0x140065c8a\njb      short loc_140065CA8                                            ; +0x171, 0x140065c91\nadd     rdx, 27h ; '''                                                 ; +0x173, 0x140065c93\nmov     rcx, [rcx-8]; Block                                            ; +0x177, 0x140065c97\nsub     rax, rcx                                                       ; +0x17b, 0x140065c9b\nsub     rax, 8                                                         ; +0x17e, 0x140065c9e\ncmp     rax, 1Fh                                                       ; +0x182, 0x140065ca2\nja      short loc_140065CFD                                            ; +0x186, 0x140065ca6\ncall    j_j_free                                                       ; +0x188, 0x140065ca8\nmovdqa  xmm0, cs:Size                                                  ; +0x18d, 0x140065cad\nmovdqu  [rbp+80h+var_48], xmm0                                         ; +0x195, 0x140065cb5\nmov     byte ptr [rbp+80h+Block], 0                                    ; +0x19a, 0x140065cba\nmov     rcx, rdi                                                       ; +0x19e, 0x140065cbe\ncall    sub_14003D310                                                  ; +0x1a1, 0x140065cc1\nmov     rax, rbx                                                       ; +0x1a6, 0x140065cc6\njmp     short loc_140065D37                                            ; +0x1a9, 0x140065cc9\nmov     rdx, qword ptr [rbp+80h+var_48+8]                              ; +0x1ab, 0x140065ccb\ncmp     rdx, 0Fh                                                       ; +0x1af, 0x140065ccf\njbe     short loc_140065D1C                                            ; +0x1b3, 0x140065cd3\ninc     rdx                                                            ; +0x1b5, 0x140065cd5\nmov     rcx, [rbp+80h+Block]; Block                                    ; +0x1b8, 0x140065cd8\nmov     rax, rcx                                                       ; +0x1bc, 0x140065cdc\ncmp     rdx, 1000h                                                     ; +0x1bf, 0x140065cdf\njb      short loc_140065D17                                            ; +0x1c6, 0x140065ce6\nadd     rdx, 27h ; '''                                                 ; +0x1c8, 0x140065ce8\nmov     rcx, [rcx-8]                                                   ; +0x1cc, 0x140065cec\nsub     rax, rcx                                                       ; +0x1d0, 0x140065cf0\nsub     rax, 8                                                         ; +0x1d3, 0x140065cf3\ncmp     rax, 1Fh                                                       ; +0x1d7, 0x140065cf7\njbe     short loc_140065D17                                            ; +0x1db, 0x140065cfb\nmov     [rsp+180h+Reserved], 0; Reserved                               ; +0x1dd, 0x140065cfd\nxor     r9d, r9d; LineNo                                               ; +0x1e6, 0x140065d06\nxor     r8d, r8d; FileName                                             ; +0x1e9, 0x140065d09\nxor     edx, edx; FunctionName                                         ; +0x1ec, 0x140065d0c\nxor     ecx, ecx; Expression                                           ; +0x1ee, 0x140065d0e\ncall    cs:_invoke_watson                                              ; +0x1f0, 0x140065d10\ndb 0CCh                                                                ; +0x1f6, 0x140065d16\ncall    j_j_free                                                       ; +0x1f7, 0x140065d17\nmovdqa  xmm0, cs:Size                                                  ; +0x1fc, 0x140065d1c\nmovdqu  [rbp+80h+var_48], xmm0                                         ; +0x204, 0x140065d24\nmov     byte ptr [rbp+80h+Block], 0                                    ; +0x209, 0x140065d29\nmov     rcx, rdi                                                       ; +0x20d, 0x140065d2d\ncall    sub_14003D310                                                  ; +0x210, 0x140065d30\nxor     eax, eax                                                       ; +0x215, 0x140065d35\nmov     rcx, [rbp+80h+var_18]                                          ; +0x217, 0x140065d37\nxor     rcx, rsp; StackCookie                                          ; +0x21b, 0x140065d3b\ncall    __security_check_cookie                                        ; +0x21e, 0x140065d3e\nlea     r11, [rsp+180h+var_10]                                         ; +0x223, 0x140065d43\nmov     rbx, [r11+30h]                                                 ; +0x22b, 0x140065d4b\nmov     rsi, [r11+38h]                                                 ; +0x22f, 0x140065d4f\nmov     rsp, r11                                                       ; +0x233, 0x140065d53\npop     r14                                                            ; +0x236, 0x140065d56\npop     rdi                                                            ; +0x238, 0x140065d58\npop     rbp                                                            ; +0x239, 0x140065d59\nretn                                                                   ; +0x23a, 0x140065d5a", "xrefs": ["FMODAudioEngine::preloadMusic @ 0x140065876", "<???> @ 0x140910e14"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}