{"type": "func", "start": 5373276368, "end": 5373277066, "name": "BrowseSmartTemplateLayer::onTemplateObject", "pseudocode": "// \n// BrowseSmartTemplateLayer::onTemplateObject from 0x14045b0d0 to 0x14045b38a (698 bytes)\n// \n// 2 xrefs:\n// > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x14045a71d\n// > <???> @ 0x1406dabb0\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\nvoid BrowseSmartTemplateLayer::onTemplateObject(BrowseSmartTemplateLayer *a1, cocos2d::CCObject *a2)\n{\n  __int64 v3; // r14\n  cocos2d::CCArray *v4; // rdi\n  __int64 v5; // rcx\n  __int64 v6; // rax\n  cocos2d::CCTouchDispatcher *v7; // rax\n  _BOOL8 v8; // rdx\n  __int64 v9; // r15\n  GJSmartTemplate *m_template; // rbx\n  char *v11; // rdi\n  __int64 v12; // rax\n  void (*v13)(FLAlertLayer *); // rdx\n  __int64 v14; // rax\n  BrowseSmartTemplateLayer_vtbl *v15; // rbx\n  __int64 v16; // rdx\n  __int64 v17; // r8\n  cocos2d::CCNode *v18; // rax\n  char v19[16]; // [rsp+30h] [rbp-40h] BYREF\n  __int64 v20; // [rsp+40h] [rbp-30h]\n  __int64 v21; // [rsp+48h] [rbp-28h]\n  __int128 v22; // [rsp+50h] [rbp-20h] BYREF\n  __int64 v23; // [rsp+60h] [rbp-10h]\n  __int64 v24; // [rsp+68h] [rbp-8h]\n  __int64 v25; // [rsp+A0h] [rbp+30h]\n\n  v3 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->__vftable[13].copyWithZone)(a2) + 320;\n  v25 = sub_14003BDB0((__int64)&v22, v3);\n  v4 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_template->m_prefabArrays, v25);\n  sub_14003A830(v25);\n  if ( v4 && cocos2d::CCArray::count(v4) )\n  {\n    v6 = cocos2d::CCDirector::sharedDirector(v5);\n    v7 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 144LL))(v6);\n    cocos2d::CCTouchDispatcher::unregisterForcePrio(v7, a1);\n    a1->setKeypadEnabled(a1, 0);\n    LOBYTE(v8) = 1;\n    a1->removeFromParentAndCleanup(a1, v8);\n    v9 = sub_14003BDB0((__int64)&v22, v3);\n    m_template = a1->m_template;\n    v11 = (char *)operator new(0x2D0u);\n    BrowseSmartTemplateLayer::BrowseSmartTemplateLayer((BrowseSmartTemplateLayer *)v11);\n    *(_QWORD *)v11 = &BrowseSmartKeyLayer::`vftable';\n    *((_QWORD *)v11 + 40) = &BrowseSmartKeyLayer::`vftable';\n    *((_QWORD *)v11 + 41) = &BrowseSmartKeyLayer::`vftable';\n    *((_QWORD *)v11 + 42) = &BrowseSmartKeyLayer::`vftable';\n    *((_QWORD *)v11 + 43) = &BrowseSmartKeyLayer::`vftable';\n    *((_QWORD *)v11 + 44) = &BrowseSmartKeyLayer::`vftable';\n    *((_QWORD *)v11 + 51) = &BrowseSmartKeyLayer::`vftable';\n    *((_QWORD *)v11 + 54) = &BrowseSmartKeyLayer::`vftable';\n    *(_OWORD *)(v11 + 680) = 0;\n    *((_QWORD *)v11 + 87) = 0;\n    *((_QWORD *)v11 + 88) = 15;\n    v11[680] = 0;\n    *((_DWORD *)v11 + 178) = 0;\n    v12 = sub_14003BDB0((__int64)v19, v9);\n    if ( (unsigned __int8)BrowseSmartKeyLayer::init(v11, m_template, v12) )\n    {\n      cocos2d::CCObject::autorelease((cocos2d::CCObject *)v11);\n    }\n    else\n    {\n      (*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v11 + 8LL))(v11, 1);\n      v11 = nullptr;\n    }\n    sub_14003A830(v9);\n    *((_DWORD *)v11 + 178) = a1->m_page;\n    v13 = *(void (**)(FLAlertLayer *))(*(_QWORD *)v11 + 1040LL);\n    if ( v13 == FLAlertLayer::show )\n      FLAlertLayer::show((FLAlertLayer *)v11);\n    else\n      v13((FLAlertLayer *)v11);\n  }\n  else\n  {\n    v14 = sub_14003BDB0((__int64)&v22, v3);\n    BrowseSmartTemplateLayer::createPrefab((__int64)a1, v14, 0);\n    v22 = 0;\n    v23 = 0;\n    v24 = 15;\n    LOBYTE(v22) = 0;\n    v20 = 15;\n    v21 = 15;\n    strcpy(v19, \"Added to editor\");\n    v15 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v18 = TextAlertPopup::create((__int64)v19, v16, v17, 150, (__int64)&v22);\n    v15->addChild_0(a1, v18, 100);\n  }\n}", "assembly": "; \n; BrowseSmartTemplateLayer::onTemplateObject from 0x14045b0d0 to 0x14045b38a (698 bytes)\n; \n; 2 xrefs:\n; > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x14045a71d\n; > <???> @ 0x1406dabb0\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-28h+arg_10], rbx                                          ; +0x0, 0x14045b0d0\npush    rbp                                                            ; +0x5, 0x14045b0d5\npush    rsi                                                            ; +0x6, 0x14045b0d6\npush    rdi                                                            ; +0x7, 0x14045b0d7\npush    r14                                                            ; +0x8, 0x14045b0d8\npush    r15                                                            ; +0xa, 0x14045b0da\nmov     rbp, rsp                                                       ; +0xc, 0x14045b0dc\nsub     rsp, 70h                                                       ; +0xf, 0x14045b0df\nmov     rsi, rcx                                                       ; +0x13, 0x14045b0e3\nmov     rax, [rdx]                                                     ; +0x16, 0x14045b0e6\nmov     rcx, rdx                                                       ; +0x19, 0x14045b0e9\ncall    qword ptr [rax+3A8h]                                           ; +0x1c, 0x14045b0ec\nlea     r14, [rax+140h]                                                ; +0x22, 0x14045b0f2\nmov     rdx, r14                                                       ; +0x29, 0x14045b0f9\nlea     rcx, [rbp+var_20]                                              ; +0x2c, 0x14045b0fc\ncall    sub_14003BDB0                                                  ; +0x30, 0x14045b100\nmov     rbx, rax                                                       ; +0x35, 0x14045b105\nmov     [rbp+arg_0], rax                                               ; +0x38, 0x14045b108\nmov     rcx, [rsi+278h]                                                ; +0x3c, 0x14045b10c\nmov     rdx, rax                                                       ; +0x43, 0x14045b113\nmov     rcx, [rcx+38h]                                                 ; +0x46, 0x14045b116\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x4a, 0x14045b11a\nmov     rdi, rax                                                       ; +0x50, 0x14045b120\nmov     rcx, rbx                                                       ; +0x53, 0x14045b123\ncall    sub_14003A830                                                  ; +0x56, 0x14045b126\ntest    rdi, rdi                                                       ; +0x5b, 0x14045b12b\njz      loc_14045B2C0                                                  ; +0x5e, 0x14045b12e\nmov     rcx, rdi                                                       ; +0x64, 0x14045b134\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x67, 0x14045b137\ntest    eax, eax                                                       ; +0x6d, 0x14045b13d\njz      loc_14045B2C0                                                  ; +0x6f, 0x14045b13f\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x75, 0x14045b145\nmov     rdx, [rax]                                                     ; +0x7b, 0x14045b14b\nmov     rcx, rax                                                       ; +0x7e, 0x14045b14e\ncall    qword ptr [rdx+90h]                                            ; +0x81, 0x14045b151\nmov     rcx, rax                                                       ; +0x87, 0x14045b157\nmov     rdx, rsi                                                       ; +0x8a, 0x14045b15a\ncall    cs:?unregisterForcePrio@CCTouchDispatcher@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCTouchDispatcher::unregisterForcePrio(cocos2d::CCObject *) ; +0x8d, 0x14045b15d\nmov     rax, [rsi]                                                     ; +0x93, 0x14045b163\nxor     edx, edx                                                       ; +0x96, 0x14045b166\nmov     rcx, rsi                                                       ; +0x98, 0x14045b168\ncall    qword ptr [rax+3D0h]                                           ; +0x9b, 0x14045b16b\nmov     rax, [rsi]                                                     ; +0xa1, 0x14045b171\nmov     dl, 1                                                          ; +0xa4, 0x14045b174\nmov     rcx, rsi                                                       ; +0xa6, 0x14045b176\ncall    qword ptr [rax+1F8h]                                           ; +0xa9, 0x14045b179\nmov     rdx, r14                                                       ; +0xaf, 0x14045b17f\nlea     rcx, [rbp+var_20]                                              ; +0xb2, 0x14045b182\ncall    sub_14003BDB0                                                  ; +0xb6, 0x14045b186\nmov     r15, rax                                                       ; +0xbb, 0x14045b18b\nmov     [rbp+arg_0], rax                                               ; +0xbe, 0x14045b18e\nmov     rbx, [rsi+278h]                                                ; +0xc2, 0x14045b192\nmov     ecx, 2D0h; Size                                                ; +0xc9, 0x14045b199\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xce, 0x14045b19e\nmov     rdi, rax                                                       ; +0xd3, 0x14045b1a3\nmov     [rbp+arg_8], rax                                               ; +0xd6, 0x14045b1a6\nmov     rcx, rax                                                       ; +0xda, 0x14045b1aa\ncall    BrowseSmartTemplateLayer__BrowseSmartTemplateLayer             ; +0xdd, 0x14045b1ad\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@; const BrowseSmartKeyLayer::`vftable' ; +0xe2, 0x14045b1b2\nmov     [rdi], rax                                                     ; +0xe9, 0x14045b1b9\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@_0; const BrowseSmartKeyLayer::`vftable' ; +0xec, 0x14045b1bc\nmov     [rdi+140h], rax                                                ; +0xf3, 0x14045b1c3\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@_1; const BrowseSmartKeyLayer::`vftable' ; +0xfa, 0x14045b1ca\nmov     [rdi+148h], rax                                                ; +0x101, 0x14045b1d1\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@_2; const BrowseSmartKeyLayer::`vftable' ; +0x108, 0x14045b1d8\nmov     [rdi+150h], rax                                                ; +0x10f, 0x14045b1df\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@_3; const BrowseSmartKeyLayer::`vftable' ; +0x116, 0x14045b1e6\nmov     [rdi+158h], rax                                                ; +0x11d, 0x14045b1ed\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@_4; const BrowseSmartKeyLayer::`vftable' ; +0x124, 0x14045b1f4\nmov     [rdi+160h], rax                                                ; +0x12b, 0x14045b1fb\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@_5; const BrowseSmartKeyLayer::`vftable' ; +0x132, 0x14045b202\nmov     [rdi+198h], rax                                                ; +0x139, 0x14045b209\nlea     rax, ??_7BrowseSmartKeyLayer@@6B@_6; const BrowseSmartKeyLayer::`vftable' ; +0x140, 0x14045b210\nmov     [rdi+1B0h], rax                                                ; +0x147, 0x14045b217\nxorps   xmm0, xmm0                                                     ; +0x14e, 0x14045b21e\nmovups  xmmword ptr [rdi+2A8h], xmm0                                   ; +0x151, 0x14045b221\nxor     r14d, r14d                                                     ; +0x158, 0x14045b228\nmov     [rdi+2B8h], r14                                                ; +0x15b, 0x14045b22b\nmov     qword ptr [rdi+2C0h], 0Fh                                      ; +0x162, 0x14045b232\nmov     [rdi+2A8h], r14b                                               ; +0x16d, 0x14045b23d\nmov     [rdi+2C8h], r14d                                               ; +0x174, 0x14045b244\nmov     rdx, r15                                                       ; +0x17b, 0x14045b24b\nlea     rcx, [rbp+var_40]                                              ; +0x17e, 0x14045b24e\ncall    sub_14003BDB0                                                  ; +0x182, 0x14045b252\nmov     r8, rax                                                        ; +0x187, 0x14045b257\nmov     rdx, rbx                                                       ; +0x18a, 0x14045b25a\nmov     rcx, rdi                                                       ; +0x18d, 0x14045b25d\ncall    BrowseSmartKeyLayer__init                                      ; +0x190, 0x14045b260\nmov     rcx, rdi                                                       ; +0x195, 0x14045b265\ntest    al, al                                                         ; +0x198, 0x14045b268\njz      short loc_14045B274                                            ; +0x19a, 0x14045b26a\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x19c, 0x14045b26c\njmp     short loc_14045B282                                            ; +0x1a2, 0x14045b272\nmov     rax, [rdi]                                                     ; +0x1a4, 0x14045b274\nmov     edx, 1                                                         ; +0x1a7, 0x14045b277\ncall    qword ptr [rax+8]                                              ; +0x1ac, 0x14045b27c\nmov     rdi, r14                                                       ; +0x1af, 0x14045b27f\nmov     rcx, r15                                                       ; +0x1b2, 0x14045b282\ncall    sub_14003A830                                                  ; +0x1b5, 0x14045b285\nmov     eax, [rsi+288h]                                                ; +0x1ba, 0x14045b28a\nmov     [rdi+2C8h], eax                                                ; +0x1c0, 0x14045b290\nmov     rax, [rdi]                                                     ; +0x1c6, 0x14045b296\nmov     rdx, [rax+410h]                                                ; +0x1c9, 0x14045b299\nlea     rax, FLAlertLayer__show                                        ; +0x1d0, 0x14045b2a0\nmov     rcx, rdi                                                       ; +0x1d7, 0x14045b2a7\ncmp     rdx, rax                                                       ; +0x1da, 0x14045b2aa\njnz     short loc_14045B2B9                                            ; +0x1dd, 0x14045b2ad\ncall    FLAlertLayer__show                                             ; +0x1df, 0x14045b2af\njmp     loc_14045B376                                                  ; +0x1e4, 0x14045b2b4\ncall    rdx                                                            ; +0x1e9, 0x14045b2b9\njmp     loc_14045B376                                                  ; +0x1eb, 0x14045b2bb\nmov     rdx, r14                                                       ; +0x1f0, 0x14045b2c0\nlea     rcx, [rbp+var_20]                                              ; +0x1f3, 0x14045b2c3\ncall    sub_14003BDB0                                                  ; +0x1f7, 0x14045b2c7\nxor     r8d, r8d                                                       ; +0x1fc, 0x14045b2cc\nmov     rdx, rax                                                       ; +0x1ff, 0x14045b2cf\nmov     rcx, rsi                                                       ; +0x202, 0x14045b2d2\ncall    BrowseSmartTemplateLayer__createPrefab                         ; +0x205, 0x14045b2d5\nlea     rax, [rbp+var_20]                                              ; +0x20a, 0x14045b2da\nmov     [rbp+arg_0], rax                                               ; +0x20e, 0x14045b2de\nxorps   xmm0, xmm0                                                     ; +0x212, 0x14045b2e2\nmovups  [rbp+var_20], xmm0                                             ; +0x215, 0x14045b2e5\nxor     r14d, r14d                                                     ; +0x219, 0x14045b2e9\nmov     [rbp+var_10], r14                                              ; +0x21c, 0x14045b2ec\nmov     [rbp+var_8], 0Fh                                               ; +0x220, 0x14045b2f0\nmov     byte ptr [rbp+var_20], r14b                                    ; +0x228, 0x14045b2f8\nmov     [rbp+var_30], 0Fh                                              ; +0x22c, 0x14045b2fc\nmov     [rbp+var_28], 0Fh                                              ; +0x234, 0x14045b304\nmovsd   xmm0, cs:qword_1405F4EC0                                       ; +0x23c, 0x14045b30c\nmovsd   qword ptr [rbp+var_40], xmm0                                   ; +0x244, 0x14045b314\nmov     eax, cs:dword_1405F4EC8                                        ; +0x249, 0x14045b319\nmov     dword ptr [rbp+var_40+8], eax                                  ; +0x24f, 0x14045b31f\nmovzx   eax, cs:word_1405F4ECC                                         ; +0x252, 0x14045b322\nmov     word ptr [rbp+var_40+0Ch], ax                                  ; +0x259, 0x14045b329\nmovzx   eax, cs:byte_1405F4ECE                                         ; +0x25d, 0x14045b32d\nmov     [rbp+var_40+0Eh], al                                           ; +0x264, 0x14045b334\nmov     [rbp+var_40+0Fh], r14b                                         ; +0x267, 0x14045b337\nmov     rbx, [rsi]                                                     ; +0x26b, 0x14045b33b\nlea     rax, [rbp+var_20]                                              ; +0x26e, 0x14045b33e\nmov     [rsp+70h+var_50], rax                                          ; +0x272, 0x14045b342\nmov     r9d, 96h                                                       ; +0x277, 0x14045b347\nmovss   xmm2, cs:dword_140622B38                                       ; +0x27d, 0x14045b34d\nmovss   xmm1, cs:dword_140622B08                                       ; +0x285, 0x14045b355\nlea     rcx, [rbp+var_40]                                              ; +0x28d, 0x14045b35d\ncall    TextAlertPopup__create                                         ; +0x291, 0x14045b361\nmov     rdx, rax                                                       ; +0x296, 0x14045b366\nlea     r8d, [r14+64h]                                                 ; +0x299, 0x14045b369\nmov     rcx, rsi                                                       ; +0x29d, 0x14045b36d\ncall    qword ptr [rbx+1B8h]                                           ; +0x2a0, 0x14045b370\nmov     rbx, [rsp+70h+arg_10]                                          ; +0x2a6, 0x14045b376\nadd     rsp, 70h                                                       ; +0x2ae, 0x14045b37e\npop     r15                                                            ; +0x2b2, 0x14045b382\npop     r14                                                            ; +0x2b4, 0x14045b384\npop     rdi                                                            ; +0x2b6, 0x14045b386\npop     rsi                                                            ; +0x2b7, 0x14045b387\npop     rbp                                                            ; +0x2b8, 0x14045b388\nretn                                                                   ; +0x2b9, 0x14045b389", "xrefs": ["BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x14045a71d", "<???> @ 0x1406dabb0"], "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"}