{"type": "func", "start": 5369252832, "end": 5369253227, "name": "AudioEffectsLayer::init", "pseudocode": "// \n// AudioEffectsLayer::init from 0x140084be0 to 0x140084d6b (395 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::setupHasCompleted @ 0x1403a6e09\n// > <???> @ 0x1406c6bb8\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// Hidden C++ exception states: #wind=2\nchar __fastcall AudioEffectsLayer::init(__int64 a1, _QWORD *a2)\n{\n  _BYTE *v5; // rdx\n  size_t v6; // r8\n  void *v7; // rcx\n  cocos2d::CCTextureCache *v8; // rax\n  struct cocos2d::CCTexture2D *v9; // rax\n  struct cocos2d::CCSpriteBatchNode *v10; // rax\n  _QWORD v11[2]; // [rsp+20h] [rbp-48h] BYREF\n  void *Block[2]; // [rsp+30h] [rbp-38h] BYREF\n  __int128 v13; // [rsp+40h] [rbp-28h]\n\n  v11[1] = a2;\n  LODWORD(v11[0]) = 0;\n  if ( cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const struct cocos2d::_ccColor4B *)v11) )\n  {\n    v5 = a2;\n    if ( a2[3] > 0xFu )\n      v5 = (_BYTE *)*a2;\n    *(_OWORD *)Block = 0;\n    v13 = 0;\n    v6 = -1;\n    do\n      ++v6;\n    while ( v5[v6] );\n    sub_14003A930(Block, v5, v6);\n    *(_QWORD *)(a1 + 552) = sub_1400848C0((__int64 *)Block);\n    if ( *((_QWORD *)&v13 + 1) > 0xFu )\n    {\n      v7 = Block[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v13 + 1) + 1LL) >= 0x1000 )\n      {\n        v7 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v7);\n    }\n    cocos2d::CCObject::retain(*(cocos2d::CCObject **)(a1 + 552));\n    AudioEffectsLayer::resetAudioVars((AudioEffectsLayer *)a1);\n    v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n    v9 = cocos2d::CCTextureCache::addImage(v8, \"GJ_GameSheet.png\", 0);\n    v10 = cocos2d::CCSpriteBatchNode::createWithTexture(v9);\n    *(_QWORD *)(a1 + 544) = v10;\n    (*(void (__fastcall **)(__int64, struct cocos2d::CCSpriteBatchNode *))(*(_QWORD *)a1 + 448LL))(a1, v10);\n    v11[0] = 0x100000302LL;\n    (**(void (__fastcall ***)(__int64, __int64))(*(_QWORD *)(a1 + 544) + 320LL))(\n      *(_QWORD *)(a1 + 544) + 320LL,\n      0x100000302LL);\n    *(_DWORD *)(a1 + 580) = 1036831949;\n    sub_14003A830((__int64)a2);\n    return 1;\n  }\n  else\n  {\n    sub_14003A830((__int64)a2);\n    return 0;\n  }\n}", "assembly": "; \n; AudioEffectsLayer::init from 0x140084be0 to 0x140084d6b (395 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::setupHasCompleted @ 0x1403a6e09\n; > <???> @ 0x1406c6bb8\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_10], rbx                                              ; +0x0, 0x140084be0\npush    rdi                                                            ; +0x5, 0x140084be5\nsub     rsp, 60h                                                       ; +0x6, 0x140084be6\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x140084bea\nxor     rax, rsp                                                       ; +0x11, 0x140084bf1\nmov     [rsp+68h+var_18], rax                                          ; +0x14, 0x140084bf4\nmov     rbx, rdx                                                       ; +0x19, 0x140084bf9\nmov     rdi, rcx                                                       ; +0x1c, 0x140084bfc\nmov     [rsp+68h+var_40], rdx                                          ; +0x1f, 0x140084bff\nmov     dword ptr [rsp+68h+var_48], 0                                  ; +0x24, 0x140084c04\nmov     eax, dword ptr [rsp+68h+var_48]                                ; +0x2c, 0x140084c0c\nmov     dword ptr [rsp+68h+var_48], eax                                ; +0x30, 0x140084c10\nlea     rdx, [rsp+68h+var_48]                                          ; +0x34, 0x140084c14\ncall    cs:__imp_?initWithColor@CCLayerColor@cocos2d@@UEAA_NAEBU_ccColor4B@2@@Z; cocos2d::CCLayerColor::initWithColor(cocos2d::_ccColor4B const &) ; +0x39, 0x140084c19\ntest    al, al                                                         ; +0x3f, 0x140084c1f\njnz     short loc_140084C32                                            ; +0x41, 0x140084c21\nmov     rcx, rbx                                                       ; +0x43, 0x140084c23\ncall    sub_14003A830                                                  ; +0x46, 0x140084c26\nxor     al, al                                                         ; +0x4b, 0x140084c2b\njmp     loc_140084D50                                                  ; +0x4d, 0x140084c2d\nmov     rdx, rbx                                                       ; +0x52, 0x140084c32\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0x55, 0x140084c35\njbe     short loc_140084C3F                                            ; +0x5a, 0x140084c3a\nmov     rdx, [rbx]                                                     ; +0x5c, 0x140084c3c\nxorps   xmm0, xmm0                                                     ; +0x5f, 0x140084c3f\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0x62, 0x140084c42\nxorps   xmm1, xmm1                                                     ; +0x67, 0x140084c47\nmovdqu  [rsp+68h+var_28], xmm1                                         ; +0x6a, 0x140084c4a\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x70, 0x140084c50\nnop     word ptr [rax+rax+00000000h]                                   ; +0x77, 0x140084c57\ninc     r8                                                             ; +0x80, 0x140084c60\ncmp     byte ptr [rdx+r8], 0                                           ; +0x83, 0x140084c63\njnz     short loc_140084C60                                            ; +0x88, 0x140084c68\nlea     rcx, [rsp+68h+Block]                                           ; +0x8a, 0x140084c6a\ncall    sub_14003A930                                                  ; +0x8f, 0x140084c6f\nnop                                                                    ; +0x94, 0x140084c74\nlea     rcx, [rsp+68h+Block]                                           ; +0x95, 0x140084c75\ncall    sub_1400848C0                                                  ; +0x9a, 0x140084c7a\nmov     [rdi+228h], rax                                                ; +0x9f, 0x140084c7f\nmov     rdx, qword ptr [rsp+68h+var_28+8]                              ; +0xa6, 0x140084c86\ncmp     rdx, 0Fh                                                       ; +0xab, 0x140084c8b\njbe     short loc_140084CC6                                            ; +0xaf, 0x140084c8f\ninc     rdx                                                            ; +0xb1, 0x140084c91\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0xb4, 0x140084c94\nmov     rax, rcx                                                       ; +0xb9, 0x140084c99\ncmp     rdx, 1000h                                                     ; +0xbc, 0x140084c9c\njb      short loc_140084CC1                                            ; +0xc3, 0x140084ca3\nadd     rdx, 27h ; '''                                                 ; +0xc5, 0x140084ca5\nmov     rcx, [rcx-8]                                                   ; +0xc9, 0x140084ca9\nsub     rax, rcx                                                       ; +0xcd, 0x140084cad\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xd0, 0x140084cb0\ncmp     rax, 1Fh                                                       ; +0xd4, 0x140084cb4\njbe     short loc_140084CC1                                            ; +0xd8, 0x140084cb8\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xda, 0x140084cba\ndb 0CCh                                                                ; +0xe0, 0x140084cc0\ncall    j_j_free                                                       ; +0xe1, 0x140084cc1\nmov     rcx, [rdi+228h]                                                ; +0xe6, 0x140084cc6\ncall    cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xed, 0x140084ccd\nmov     rcx, rdi                                                       ; +0xf3, 0x140084cd3\ncall    AudioEffectsLayer__resetAudioVars                              ; +0xf6, 0x140084cd6\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0xfb, 0x140084cdb\nmov     rcx, rax                                                       ; +0x101, 0x140084ce1\nxor     r8d, r8d                                                       ; +0x104, 0x140084ce4\nlea     rdx, aGjGamesheetPng; \"GJ_GameSheet.png\"                       ; +0x107, 0x140084ce7\ncall    cs:?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0x10e, 0x140084cee\nmov     rcx, rax                                                       ; +0x114, 0x140084cf4\ncall    cs:?createWithTexture@CCSpriteBatchNode@cocos2d@@SAPEAV12@PEAVCCTexture2D@2@@Z; cocos2d::CCSpriteBatchNode::createWithTexture(cocos2d::CCTexture2D *) ; +0x117, 0x140084cf7\nmov     [rdi+220h], rax                                                ; +0x11d, 0x140084cfd\nmov     r8, [rdi]                                                      ; +0x124, 0x140084d04\nmov     rdx, rax                                                       ; +0x127, 0x140084d07\nmov     rcx, rdi                                                       ; +0x12a, 0x140084d0a\ncall    qword ptr [r8+1C0h]                                            ; +0x12d, 0x140084d0d\nmov     dword ptr [rsp+68h+var_48], 302h                               ; +0x134, 0x140084d14\nmov     dword ptr [rsp+68h+var_48+4], 1                                ; +0x13c, 0x140084d1c\nmov     rcx, [rdi+220h]                                                ; +0x144, 0x140084d24\nadd     rcx, 140h                                                      ; +0x14b, 0x140084d2b\nmov     rax, [rcx]                                                     ; +0x152, 0x140084d32\nmov     rdx, [rsp+68h+var_48]                                          ; +0x155, 0x140084d35\ncall    qword ptr [rax]                                                ; +0x15a, 0x140084d3a\nmov     dword ptr [rdi+244h], 3DCCCCCDh                                ; +0x15c, 0x140084d3c\nmov     rcx, rbx                                                       ; +0x166, 0x140084d46\ncall    sub_14003A830                                                  ; +0x169, 0x140084d49\nmov     al, 1                                                          ; +0x16e, 0x140084d4e\nmov     rcx, [rsp+68h+var_18]                                          ; +0x170, 0x140084d50\nxor     rcx, rsp; StackCookie                                          ; +0x175, 0x140084d55\ncall    __security_check_cookie                                        ; +0x178, 0x140084d58\nmov     rbx, [rsp+68h+arg_10]                                          ; +0x17d, 0x140084d5d\nadd     rsp, 60h                                                       ; +0x185, 0x140084d65\npop     rdi                                                            ; +0x189, 0x140084d69\nretn                                                                   ; +0x18a, 0x140084d6a", "xrefs": ["PlayLayer::setupHasCompleted @ 0x1403a6e09", "<???> @ 0x1406c6bb8"], "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"}