{"type": "func", "start": 5372627824, "end": 5372628199, "name": "GJSmartBlockPreview::addPreview", "pseudocode": "// \n// GJSmartBlockPreview::addPreview from 0x1403bcb70 to 0x1403bcce7 (375 bytes)\n// \n// 3 xrefs:\n// > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x1405f0107\n// > BrowseSmartKeyLayer::init @ 0x1405f13cf\n// > <???> @ 0x140923e40\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:31:27 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall GJSmartBlockPreview::addPreview(__int64 a1, _QWORD *a2, __int64 a3, __int64 a4)\n{\n  cocos2d::CCArray *v8; // r13\n  __int64 v9; // rax\n  __int64 v10; // r12\n  __int64 v11; // rdx\n  __int64 v12; // rcx\n  __int64 v13; // r8\n  __int64 v14; // r9\n  char *v15; // rax\n  cocos2d::CCPoint *v16; // rdi\n  float *v17; // rbx\n  __int64 v18; // rax\n  __int64 v19; // rax\n  _BYTE v20[8]; // [rsp+40h] [rbp-98h] BYREF\n  _BYTE v21[8]; // [rsp+48h] [rbp-90h] BYREF\n  _BYTE v22[8]; // [rsp+50h] [rbp-88h] BYREF\n  _BYTE v23[32]; // [rsp+58h] [rbp-80h] BYREF\n  _QWORD *v24; // [rsp+78h] [rbp-60h]\n  __int64 v25; // [rsp+80h] [rbp-58h]\n\n  v24 = a2;\n  v25 = a3;\n  if ( *(_QWORD *)(a3 + 16) )\n  {\n    v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);\n    v9 = sub_14003F4F0((__int64)v23, a3);\n    v10 = EditorUI::spriteFromObjectString(*(_QWORD *)(a4 + 14904), v9, 0, 0, 0, v8, nullptr, 0);\n    (*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v10, 10);\n    if ( !a2[2] )\n      sub_14003F4D0(v12, v11, v13, v14);\n    v15 = (char *)a2;\n    if ( a2[3] > 0xFu )\n      v15 = (char *)*a2;\n    v16 = GJSmartTemplate::offsetForType((cocos2d::CCPoint *)v21, *v15);\n    v17 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 320LL))(a1);\n    v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 320LL))(a1);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v22, *v17 * 0.5, *(float *)(v18 + 4) * 0.5);\n    cocos2d::CCPoint::operator+(v19, v20, v16);\n    (*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v10 + 184LL))(v10, v20);\n    LevelEditorLayer::updateObjectColors(a4, v8);\n  }\n  sub_14003D310((__int64)a2);\n  sub_14003D310(a3);\n}", "assembly": "; \n; GJSmartBlockPreview::addPreview from 0x1403bcb70 to 0x1403bcce7 (375 bytes)\n; \n; 3 xrefs:\n; > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x1405f0107\n; > BrowseSmartKeyLayer::init @ 0x1405f13cf\n; > <???> @ 0x140923e40\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:31:27 +0000\n; \npush    rbx                                                            ; +0x0, 0x1403bcb70\npush    rbp                                                            ; +0x2, 0x1403bcb72\npush    rsi                                                            ; +0x3, 0x1403bcb73\npush    rdi                                                            ; +0x4, 0x1403bcb74\npush    r12                                                            ; +0x5, 0x1403bcb75\npush    r13                                                            ; +0x7, 0x1403bcb77\npush    r14                                                            ; +0x9, 0x1403bcb79\npush    r15                                                            ; +0xb, 0x1403bcb7b\nsub     rsp, 98h                                                       ; +0xd, 0x1403bcb7d\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x1403bcb84\nxor     rax, rsp                                                       ; +0x1b, 0x1403bcb8b\nmov     [rsp+0D8h+var_50], rax                                         ; +0x1e, 0x1403bcb8e\nmov     r15, r9                                                        ; +0x26, 0x1403bcb96\nmov     rbp, r8                                                        ; +0x29, 0x1403bcb99\nmov     rsi, rdx                                                       ; +0x2c, 0x1403bcb9c\nmov     r14, rcx                                                       ; +0x2f, 0x1403bcb9f\nmov     [rsp+0D8h+var_60], rdx                                         ; +0x32, 0x1403bcba2\nmov     [rsp+0D8h+var_58], r8                                          ; +0x37, 0x1403bcba7\ncmp     qword ptr [r8+10h], 0                                          ; +0x3f, 0x1403bcbaf\njz      loc_1403BCCAC                                                  ; +0x44, 0x1403bcbb4\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x4a, 0x1403bcbba\nmov     r13, rax                                                       ; +0x50, 0x1403bcbc0\nmov     rdx, rbp                                                       ; +0x53, 0x1403bcbc3\nlea     rcx, [rsp+0D8h+var_80]                                         ; +0x56, 0x1403bcbc6\ncall    sub_14003F4F0                                                  ; +0x5b, 0x1403bcbcb\nxor     ecx, ecx                                                       ; +0x60, 0x1403bcbd0\nmov     [rsp+0D8h+var_A0], rcx                                         ; +0x62, 0x1403bcbd2\nmov     [rsp+0D8h+var_A8], rcx                                         ; +0x67, 0x1403bcbd7\nmov     [rsp+0D8h+var_B0], r13                                         ; +0x6c, 0x1403bcbdc\nmov     [rsp+0D8h+var_B8], ecx                                         ; +0x71, 0x1403bcbe1\nxor     r9d, r9d                                                       ; +0x75, 0x1403bcbe5\nxor     r8d, r8d                                                       ; +0x78, 0x1403bcbe8\nmov     rdx, rax                                                       ; +0x7b, 0x1403bcbeb\nmov     rcx, [r15+3A38h]                                               ; +0x7e, 0x1403bcbee\ncall    EditorUI__spriteFromObjectString                               ; +0x85, 0x1403bcbf5\nmov     r12, rax                                                       ; +0x8a, 0x1403bcbfa\nmov     rcx, [r14]                                                     ; +0x8d, 0x1403bcbfd\nmov     r9, [rcx+1C8h]                                                 ; +0x90, 0x1403bcc00\nmov     r8d, 0Ah                                                       ; +0x97, 0x1403bcc07\nmov     rdx, rax                                                       ; +0x9d, 0x1403bcc0d\nmov     rcx, r14                                                       ; +0xa0, 0x1403bcc10\ncall    r9                                                             ; +0xa3, 0x1403bcc13\ncmp     qword ptr [rsi+10h], 0                                         ; +0xa6, 0x1403bcc16\njbe     loc_1403BCCE1                                                  ; +0xab, 0x1403bcc1b\nmov     rax, rsi                                                       ; +0xb1, 0x1403bcc21\ncmp     qword ptr [rsi+18h], 0Fh                                       ; +0xb4, 0x1403bcc24\njbe     short loc_1403BCC2E                                            ; +0xb9, 0x1403bcc29\nmov     rax, [rsi]                                                     ; +0xbb, 0x1403bcc2b\nmovsx   edx, byte ptr [rax]                                            ; +0xbe, 0x1403bcc2e\nlea     rcx, [rsp+0D8h+var_90]                                         ; +0xc1, 0x1403bcc31\ncall    GJSmartTemplate__offsetForType                                 ; +0xc6, 0x1403bcc36\nmov     rdi, rax                                                       ; +0xcb, 0x1403bcc3b\nmov     rdx, [r14]                                                     ; +0xce, 0x1403bcc3e\nmov     rcx, r14                                                       ; +0xd1, 0x1403bcc41\ncall    qword ptr [rdx+140h]                                           ; +0xd4, 0x1403bcc44\nmov     rbx, rax                                                       ; +0xda, 0x1403bcc4a\nmov     rdx, [r14]                                                     ; +0xdd, 0x1403bcc4d\nmov     rcx, r14                                                       ; +0xe0, 0x1403bcc50\ncall    qword ptr [rdx+140h]                                           ; +0xe3, 0x1403bcc53\nmovss   xmm2, dword ptr [rax+4]                                        ; +0xe9, 0x1403bcc59\nmulss   xmm2, cs:dword_140834F20                                       ; +0xee, 0x1403bcc5e\nmovss   xmm1, dword ptr [rbx]                                          ; +0xf6, 0x1403bcc66\nmulss   xmm1, cs:dword_140834F20                                       ; +0xfa, 0x1403bcc6a\nlea     rcx, [rsp+0D8h+var_88]                                         ; +0x102, 0x1403bcc72\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x107, 0x1403bcc77\nmov     r8, rdi                                                        ; +0x10d, 0x1403bcc7d\nlea     rdx, [rsp+0D8h+var_98]                                         ; +0x110, 0x1403bcc80\nmov     rcx, rax                                                       ; +0x115, 0x1403bcc85\ncall    cs:??HCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator+(cocos2d::CCPoint const &) ; +0x118, 0x1403bcc88\nmov     rax, [r12]                                                     ; +0x11e, 0x1403bcc8e\nlea     rdx, [rsp+0D8h+var_98]                                         ; +0x122, 0x1403bcc92\nmov     rcx, r12                                                       ; +0x127, 0x1403bcc97\ncall    qword ptr [rax+0B8h]                                           ; +0x12a, 0x1403bcc9a\nmov     rdx, r13                                                       ; +0x130, 0x1403bcca0\nmov     rcx, r15                                                       ; +0x133, 0x1403bcca3\ncall    LevelEditorLayer__updateObjectColors                           ; +0x136, 0x1403bcca6\nnop                                                                    ; +0x13b, 0x1403bccab\nmov     rcx, rsi                                                       ; +0x13c, 0x1403bccac\ncall    sub_14003D310                                                  ; +0x13f, 0x1403bccaf\nnop                                                                    ; +0x144, 0x1403bccb4\nmov     rcx, rbp                                                       ; +0x145, 0x1403bccb5\ncall    sub_14003D310                                                  ; +0x148, 0x1403bccb8\nmov     rcx, [rsp+0D8h+var_50]                                         ; +0x14d, 0x1403bccbd\nxor     rcx, rsp; StackCookie                                          ; +0x155, 0x1403bccc5\ncall    __security_check_cookie                                        ; +0x158, 0x1403bccc8\nadd     rsp, 98h                                                       ; +0x15d, 0x1403bcccd\npop     r15                                                            ; +0x164, 0x1403bccd4\npop     r14                                                            ; +0x166, 0x1403bccd6\npop     r13                                                            ; +0x168, 0x1403bccd8\npop     r12                                                            ; +0x16a, 0x1403bccda\npop     rdi                                                            ; +0x16c, 0x1403bccdc\npop     rsi                                                            ; +0x16d, 0x1403bccdd\npop     rbp                                                            ; +0x16e, 0x1403bccde\npop     rbx                                                            ; +0x16f, 0x1403bccdf\nretn                                                                   ; +0x170, 0x1403bcce0\ncall    sub_14003F4D0                                                  ; +0x171, 0x1403bcce1\ndb 90h                                                                 ; +0x176, 0x1403bcce6", "xrefs": ["BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x1405f0107", "BrowseSmartKeyLayer::init @ 0x1405f13cf", "<???> @ 0x140923e40"], "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"}