{"type": "func", "start": 5371553264, "end": 5371553641, "name": "GJSmartBlockPreview::addPreview", "pseudocode": "// \n// GJSmartBlockPreview::addPreview from 0x1402b65f0 to 0x1402b6769 (377 bytes)\n// \n// 3 xrefs:\n// > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x14045a637\n// > BrowseSmartKeyLayer::init @ 0x14045b8ac\n// > <???> @ 0x1406d2480\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 __fastcall GJSmartBlockPreview::addPreview(__int64 a1, __int64 a2, __int64 a3, __int64 a4)\n{\n  float v4; // xmm0_4\n  cocos2d::CCArray *v9; // r12\n  __int64 v10; // rax\n  cocos2d::CCNode *v11; // r15\n  __int64 v12; // rcx\n  float *v13; // rax\n  __int64 v14; // rax\n  cocos2d::CCPoint v15; // [rsp+40h] [rbp-98h] BYREF\n  char v16; // [rsp+48h] [rbp-90h] BYREF\n  _BYTE v17[32]; // [rsp+58h] [rbp-80h] BYREF\n  __int64 v18; // [rsp+78h] [rbp-60h]\n  __int64 v19; // [rsp+80h] [rbp-58h]\n\n  v18 = a2;\n  v19 = a3;\n  if ( *(_QWORD *)(a3 + 16) )\n  {\n    v9 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);\n    v10 = sub_14003BDB0((__int64)v17, a3);\n    v11 = EditorUI::spriteFromObjectString(*(_QWORD *)(a4 + 14496), v10, 0, 0, 0, v9, nullptr, 0);\n    (*(void (__fastcall **)(__int64, cocos2d::CCNode *, __int64))(*(_QWORD *)a1 + 440LL))(a1, v11, 10);\n    if ( !*(_QWORD *)(a2 + 16) )\n      sub_14003BCC0(v12);\n    GJSmartTemplate::offsetForType((SmartBlockType)&v16);\n    (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 304LL))(a1);\n    v13 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 304LL))(a1);\n    cocos2d::CCPoint::CCPoint(v4, *v13 * 0.5);\n    cocos2d::CCPoint::operator+(v14, &v15);\n    v11->setPosition_0(v11, &v15);\n    LevelEditorLayer::updateObjectColors((LevelEditorLayer *)a4, v9);\n  }\n  sub_14003A830(a2);\n  sub_14003A830(a3);\n}", "assembly": "; \n; GJSmartBlockPreview::addPreview from 0x1402b65f0 to 0x1402b6769 (377 bytes)\n; \n; 3 xrefs:\n; > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x14045a637\n; > BrowseSmartKeyLayer::init @ 0x14045b8ac\n; > <???> @ 0x1406d2480\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     r11, rsp                                                       ; +0x0, 0x1402b65f0\npush    rbx                                                            ; +0x3, 0x1402b65f3\npush    rbp                                                            ; +0x4, 0x1402b65f4\npush    rsi                                                            ; +0x5, 0x1402b65f5\npush    rdi                                                            ; +0x6, 0x1402b65f6\npush    r12                                                            ; +0x7, 0x1402b65f7\npush    r14                                                            ; +0x9, 0x1402b65f9\npush    r15                                                            ; +0xb, 0x1402b65fb\nsub     rsp, 0A0h                                                      ; +0xd, 0x1402b65fd\nmovaps  xmmword ptr [r11-48h], xmm6                                    ; +0x14, 0x1402b6604\nmov     rax, cs:__security_cookie                                      ; +0x19, 0x1402b6609\nxor     rax, rsp                                                       ; +0x20, 0x1402b6610\nmov     [rsp+0D8h+var_50], rax                                         ; +0x23, 0x1402b6613\nmov     rbp, r9                                                        ; +0x2b, 0x1402b661b\nmov     rsi, r8                                                        ; +0x2e, 0x1402b661e\nmov     rdi, rdx                                                       ; +0x31, 0x1402b6621\nmov     r14, rcx                                                       ; +0x34, 0x1402b6624\nmov     [r11-60h], rdx                                                 ; +0x37, 0x1402b6627\nmov     [r11-58h], r8                                                  ; +0x3b, 0x1402b662b\ncmp     qword ptr [r8+10h], 0                                          ; +0x3f, 0x1402b662f\njz      loc_1402B6728                                                  ; +0x44, 0x1402b6634\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x4a, 0x1402b663a\nmov     r12, rax                                                       ; +0x50, 0x1402b6640\nmov     rdx, rsi                                                       ; +0x53, 0x1402b6643\nlea     rcx, [rsp+0D8h+var_80]                                         ; +0x56, 0x1402b6646\ncall    sub_14003BDB0                                                  ; +0x5b, 0x1402b664b\nxor     ecx, ecx                                                       ; +0x60, 0x1402b6650\nmov     [rsp+0D8h+var_A0], rcx                                         ; +0x62, 0x1402b6652\nmov     [rsp+0D8h+var_A8], rcx                                         ; +0x67, 0x1402b6657\nmov     [rsp+0D8h+var_B0], r12                                         ; +0x6c, 0x1402b665c\nmov     [rsp+0D8h+var_B8], ecx                                         ; +0x71, 0x1402b6661\nxor     r9d, r9d                                                       ; +0x75, 0x1402b6665\nxor     r8d, r8d                                                       ; +0x78, 0x1402b6668\nmov     rdx, rax                                                       ; +0x7b, 0x1402b666b\nmov     rcx, [rbp+38A0h]                                               ; +0x7e, 0x1402b666e\ncall    EditorUI__spriteFromObjectString                               ; +0x85, 0x1402b6675\nmov     r15, rax                                                       ; +0x8a, 0x1402b667a\nmov     r9, [r14]                                                      ; +0x8d, 0x1402b667d\nmov     r8d, 0Ah                                                       ; +0x90, 0x1402b6680\nmov     rdx, rax                                                       ; +0x96, 0x1402b6686\nmov     rcx, r14                                                       ; +0x99, 0x1402b6689\ncall    qword ptr [r9+1B8h]                                            ; +0x9c, 0x1402b668c\ncmp     qword ptr [rdi+10h], 0                                         ; +0xa3, 0x1402b6693\njbe     loc_1402B6763                                                  ; +0xa8, 0x1402b6698\nmov     rax, rdi                                                       ; +0xae, 0x1402b669e\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xb1, 0x1402b66a1\njbe     short loc_1402B66AB                                            ; +0xb6, 0x1402b66a6\nmov     rax, [rdi]                                                     ; +0xb8, 0x1402b66a8\nmovsx   edx, byte ptr [rax]                                            ; +0xbb, 0x1402b66ab\nlea     rcx, [rsp+0D8h+var_90]                                         ; +0xbe, 0x1402b66ae\ncall    GJSmartTemplate__offsetForType                                 ; +0xc3, 0x1402b66b3\nmov     rbx, rax                                                       ; +0xc8, 0x1402b66b8\nmov     rdx, [r14]                                                     ; +0xcb, 0x1402b66bb\nmov     rcx, r14                                                       ; +0xce, 0x1402b66be\ncall    qword ptr [rdx+130h]                                           ; +0xd1, 0x1402b66c1\nmovss   xmm6, dword ptr [rax+4]                                        ; +0xd7, 0x1402b66c7\nmov     rdx, [r14]                                                     ; +0xdc, 0x1402b66cc\nmov     rcx, r14                                                       ; +0xdf, 0x1402b66cf\ncall    qword ptr [rdx+130h]                                           ; +0xe2, 0x1402b66d2\nmulss   xmm6, cs:dword_140622B08                                       ; +0xe8, 0x1402b66d8\nmovss   xmm1, dword ptr [rax]                                          ; +0xf0, 0x1402b66e0\nmulss   xmm1, cs:dword_140622B08                                       ; +0xf4, 0x1402b66e4\nmovaps  xmm2, xmm6                                                     ; +0xfc, 0x1402b66ec\nlea     rcx, [rsp+0D8h+var_88]                                         ; +0xff, 0x1402b66ef\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x104, 0x1402b66f4\nmov     r8, rbx                                                        ; +0x10a, 0x1402b66fa\nlea     rdx, [rsp+0D8h+var_98]                                         ; +0x10d, 0x1402b66fd\nmov     rcx, rax                                                       ; +0x112, 0x1402b6702\ncall    cs:??HCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator+(cocos2d::CCPoint const &) ; +0x115, 0x1402b6705\nmov     rax, [r15]                                                     ; +0x11b, 0x1402b670b\nlea     rdx, [rsp+0D8h+var_98]                                         ; +0x11e, 0x1402b670e\nmov     rcx, r15                                                       ; +0x123, 0x1402b6713\ncall    qword ptr [rax+0B8h]                                           ; +0x126, 0x1402b6716\nmov     rdx, r12                                                       ; +0x12c, 0x1402b671c\nmov     rcx, rbp                                                       ; +0x12f, 0x1402b671f\ncall    LevelEditorLayer__updateObjectColors                           ; +0x132, 0x1402b6722\nnop                                                                    ; +0x137, 0x1402b6727\nmov     rcx, rdi                                                       ; +0x138, 0x1402b6728\ncall    sub_14003A830                                                  ; +0x13b, 0x1402b672b\nnop                                                                    ; +0x140, 0x1402b6730\nmov     rcx, rsi                                                       ; +0x141, 0x1402b6731\ncall    sub_14003A830                                                  ; +0x144, 0x1402b6734\nmov     rcx, [rsp+0D8h+var_50]                                         ; +0x149, 0x1402b6739\nxor     rcx, rsp; StackCookie                                          ; +0x151, 0x1402b6741\ncall    __security_check_cookie                                        ; +0x154, 0x1402b6744\nmovaps  xmm6, [rsp+0D8h+var_48]                                        ; +0x159, 0x1402b6749\nadd     rsp, 0A0h                                                      ; +0x161, 0x1402b6751\npop     r15                                                            ; +0x168, 0x1402b6758\npop     r14                                                            ; +0x16a, 0x1402b675a\npop     r12                                                            ; +0x16c, 0x1402b675c\npop     rdi                                                            ; +0x16e, 0x1402b675e\npop     rsi                                                            ; +0x16f, 0x1402b675f\npop     rbp                                                            ; +0x170, 0x1402b6760\npop     rbx                                                            ; +0x171, 0x1402b6761\nretn                                                                   ; +0x172, 0x1402b6762\ncall    sub_14003BCC0                                                  ; +0x173, 0x1402b6763\ndb 90h                                                                 ; +0x178, 0x1402b6768", "xrefs": ["BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x14045a637", "BrowseSmartKeyLayer::init @ 0x14045b8ac", "<???> @ 0x1406d2480"], "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"}