{"type": "func", "start": 4300126112, "end": 4300126465, "name": "BrowseSmartKeyLayer::createTemplateObjects", "pseudocode": "// \n// BrowseSmartKeyLayer::createTemplateObjects from 0x1004eb7a0 to 0x1004eb901 (353 bytes)\n// \n// 1 xrefs:\n// > BrowseSmartKeyLayer::onButton @ 0x1004eb742\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\nvoid __fastcall BrowseSmartKeyLayer::createTemplateObjects(BrowseSmartKeyLayer *a1)\n{\n  double v1; // xmm0_8\n  cocos2d::CCArray *AllSelectedBlocks; // r14\n  std::string *p_m_prefabKey; // r12\n  unsigned int v4; // r15d\n  __int64 v5; // r13\n  int v6; // eax\n  cocos2d::CCObject *v7; // rax\n  __int128 v8; // [rsp+8h] [rbp-78h] BYREF\n  void *v9; // [rsp+18h] [rbp-68h]\n  std::string v10; // [rsp+20h] [rbp-60h] BYREF\n  char v11; // [rsp+38h] [rbp-48h] BYREF\n  _BYTE v12[23]; // [rsp+39h] [rbp-47h] BYREF\n  std::string::pointer *p_data; // [rsp+50h] [rbp-30h]\n\n  AllSelectedBlocks = BrowseSmartKeyLayer::getAllSelectedBlocks(a1);\n  if ( (unsigned int)sub_100720070(AllSelectedBlocks) )\n  {\n    if ( (unsigned int)sub_100720070(AllSelectedBlocks) )\n    {\n      p_m_prefabKey = &a1->m_prefabKey;\n      v4 = 0;\n      p_data = &v10.__r_.__value_.__l.__data_;\n      do\n      {\n        v5 = sub_1007200C0(AllSelectedBlocks, v4);\n        if ( (p_m_prefabKey->m_data.m_short.sizex2 & 1) != 0 )\n        {\n          sub_100006B70(&v10, a1->m_prefabKey.m_data.m_long.longStorage, a1->m_prefabKey.m_data.m_long.size, v1);\n        }\n        else\n        {\n          v10.__r_.__value_.__r.__words[2] = (std::string::size_type)a1->m_prefabKey.m_data.m_long.longStorage;\n          *(_OWORD *)&v10.__r_.__value_.__l.0 = *(_OWORD *)&p_m_prefabKey->m_data.m_short.sizex2;\n        }\n        v1 = (*(double (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5);\n        BrowseSmartTemplateLayer::createPrefab((__int64)a1, &v10, v6, v1);\n        if ( (*(_BYTE *)&v10.__r_.__value_.__s.0 & 1) != 0 )\n          operator delete(v10.__r_.__value_.__l.__data_);\n        ++v4;\n      }\n      while ( v4 < (unsigned int)sub_100720070(AllSelectedBlocks) );\n    }\n    v11 = 30;\n    strcpy(v12, \"Added to editor\");\n    LOWORD(v8) = 0;\n    v7 = TextAlertPopup::create((__int64)&v11, 0x96u, &v8, (__m128)0x3F000000u, 0.60000002);\n    ((void (__fastcall *)(BrowseSmartKeyLayer *, cocos2d::CCObject *, __int64))a1->addChild_0)(a1, v7, 100);\n    if ( (v8 & 1) != 0 )\n      operator delete(v9);\n    if ( (v11 & 1) != 0 )\n      operator delete(*(void **)&v12[15]);\n  }\n}", "assembly": "; \n; BrowseSmartKeyLayer::createTemplateObjects from 0x1004eb7a0 to 0x1004eb901 (353 bytes)\n; \n; 1 xrefs:\n; > BrowseSmartKeyLayer::onButton @ 0x1004eb742\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\npush    rbp                                                            ; +0x0, 0x1004eb7a0\nmov     rbp, rsp                                                       ; +0x1, 0x1004eb7a1\npush    r15                                                            ; +0x4, 0x1004eb7a4\npush    r14                                                            ; +0x6, 0x1004eb7a6\npush    r13                                                            ; +0x8, 0x1004eb7a8\npush    r12                                                            ; +0xa, 0x1004eb7aa\npush    rbx                                                            ; +0xc, 0x1004eb7ac\nsub     rsp, 58h                                                       ; +0xd, 0x1004eb7ad\nmov     rbx, rdi                                                       ; +0x11, 0x1004eb7b1\ncall    BrowseSmartKeyLayer__getAllSelectedBlocks                      ; +0x14, 0x1004eb7b4\nmov     r14, rax                                                       ; +0x19, 0x1004eb7b9\nmov     rdi, rax                                                       ; +0x1c, 0x1004eb7bc\ncall    sub_100720070                                                  ; +0x1f, 0x1004eb7bf\ntest    eax, eax                                                       ; +0x24, 0x1004eb7c4\njz      loc_1004EB8F2                                                  ; +0x26, 0x1004eb7c6\nmov     rdi, r14                                                       ; +0x2c, 0x1004eb7cc\ncall    sub_100720070                                                  ; +0x2f, 0x1004eb7cf\ntest    eax, eax                                                       ; +0x34, 0x1004eb7d4\njz      loc_1004EB870                                                  ; +0x36, 0x1004eb7d6\nlea     r12, [rbx+2A8h]                                                ; +0x3c, 0x1004eb7dc\nxor     r15d, r15d                                                     ; +0x43, 0x1004eb7e3\nlea     rax, [rbp+__p]                                                 ; +0x46, 0x1004eb7e6\nmov     [rbp+var_30], rax                                              ; +0x4a, 0x1004eb7ea\njmp     short loc_1004EB800                                            ; +0x4e, 0x1004eb7ee\ninc     r15d                                                           ; +0x50, 0x1004eb7f0\nmov     rdi, r14                                                       ; +0x53, 0x1004eb7f3\ncall    sub_100720070                                                  ; +0x56, 0x1004eb7f6\ncmp     r15d, eax                                                      ; +0x5b, 0x1004eb7fb\njnb     short loc_1004EB870                                            ; +0x5e, 0x1004eb7fe\nmov     rdi, r14                                                       ; +0x60, 0x1004eb800\nmov     esi, r15d                                                      ; +0x63, 0x1004eb803\ncall    sub_1007200C0                                                  ; +0x66, 0x1004eb806\nmov     r13, rax                                                       ; +0x6b, 0x1004eb80b\ntest    byte ptr [r12], 1                                              ; +0x6e, 0x1004eb80e\njnz     short loc_1004EB830                                            ; +0x73, 0x1004eb813\nmov     rax, [r12+10h]                                                 ; +0x75, 0x1004eb815\nmov     [rbp+__p], rax                                                 ; +0x7a, 0x1004eb81a\nmovups  xmm0, xmmword ptr [r12]                                        ; +0x7e, 0x1004eb81e\nmovaps  [rbp+var_60], xmm0                                             ; +0x83, 0x1004eb823\njmp     short loc_1004EB847                                            ; +0x87, 0x1004eb827\nalign 10h                                                              ; +0x89, 0x1004eb829\nmov     rdx, [rbx+2B0h]                                                ; +0x90, 0x1004eb830\nmov     rsi, [rbx+2B8h]                                                ; +0x97, 0x1004eb837\nlea     rdi, [rbp+var_60]                                              ; +0x9e, 0x1004eb83e\ncall    sub_100006B70                                                  ; +0xa2, 0x1004eb842\nmov     rax, [r13+0]                                                   ; +0xa7, 0x1004eb847\nmov     rdi, r13                                                       ; +0xab, 0x1004eb84b\ncall    qword ptr [rax+40h]                                            ; +0xae, 0x1004eb84e\nmov     rdi, rbx                                                       ; +0xb1, 0x1004eb851\nlea     rsi, [rbp+var_60]                                              ; +0xb4, 0x1004eb854\nmov     edx, eax                                                       ; +0xb8, 0x1004eb858\ncall    BrowseSmartTemplateLayer__createPrefab                         ; +0xba, 0x1004eb85a\ntest    byte ptr [rbp+var_60], 1                                       ; +0xbf, 0x1004eb85f\njz      short loc_1004EB7F0                                            ; +0xc3, 0x1004eb863\nmov     rdi, [rbp+__p]; __p                                            ; +0xc5, 0x1004eb865\ncall    __ZdlPv; operator delete(void *)                               ; +0xc9, 0x1004eb869\njmp     short loc_1004EB7F0                                            ; +0xce, 0x1004eb86e\nmov     [rbp+var_48], 1Eh                                              ; +0xd0, 0x1004eb870\nmov     rax, 6F74206465646441h                                         ; +0xd4, 0x1004eb874\nmov     [rbp+var_47], rax                                              ; +0xde, 0x1004eb87e\nmov     rax, 726F74696465206Fh                                         ; +0xe2, 0x1004eb882\nmov     [rbp+var_47+7], rax                                            ; +0xec, 0x1004eb88c\nlea     r14, [rbp+var_38]                                              ; +0xf0, 0x1004eb890\nmov     byte ptr [rbp+var_38], 0                                       ; +0xf4, 0x1004eb894\nmov     word ptr [rbp+var_78], 0                                       ; +0xf8, 0x1004eb898\nlea     rdi, [rbp+var_48]                                              ; +0xfe, 0x1004eb89e\nmovss   xmm0, cs:dword_100814FA8                                       ; +0x102, 0x1004eb8a2\nmovss   xmm1, cs:dword_100814FB0                                       ; +0x10a, 0x1004eb8aa\nlea     rdx, [rbp+var_78]                                              ; +0x112, 0x1004eb8b2\nmov     esi, 96h                                                       ; +0x116, 0x1004eb8b6\ncall    TextAlertPopup__create                                         ; +0x11b, 0x1004eb8bb\nmov     rcx, [rbx]                                                     ; +0x120, 0x1004eb8c0\nmov     rdi, rbx                                                       ; +0x123, 0x1004eb8c3\nmov     rsi, rax                                                       ; +0x126, 0x1004eb8c6\nmov     edx, 64h ; 'd'                                                 ; +0x129, 0x1004eb8c9\ncall    qword ptr [rcx+1C0h]                                           ; +0x12e, 0x1004eb8ce\ntest    byte ptr [rbp+var_78], 1                                       ; +0x134, 0x1004eb8d4\njz      short loc_1004EB8E3                                            ; +0x138, 0x1004eb8d8\nmov     rdi, [rbp+var_68]; __p                                         ; +0x13a, 0x1004eb8da\ncall    __ZdlPv; operator delete(void *)                               ; +0x13e, 0x1004eb8de\ntest    [rbp+var_48], 1                                                ; +0x143, 0x1004eb8e3\njz      short loc_1004EB8F2                                            ; +0x147, 0x1004eb8e7\nmov     rdi, [rbp+var_38]; __p                                         ; +0x149, 0x1004eb8e9\ncall    __ZdlPv; operator delete(void *)                               ; +0x14d, 0x1004eb8ed\nadd     rsp, 58h                                                       ; +0x152, 0x1004eb8f2\npop     rbx                                                            ; +0x156, 0x1004eb8f6\npop     r12                                                            ; +0x157, 0x1004eb8f7\npop     r13                                                            ; +0x159, 0x1004eb8f9\npop     r14                                                            ; +0x15b, 0x1004eb8fb\npop     r15                                                            ; +0x15d, 0x1004eb8fd\npop     rbp                                                            ; +0x15f, 0x1004eb8ff\nretn                                                                   ; +0x160, 0x1004eb900", "xrefs": ["BrowseSmartKeyLayer::onButton @ 0x1004eb742"], "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"}