{"type": "func", "start": 4299330176, "end": 4299330527, "name": "GJSmartBlockPreview::addPreview", "pseudocode": "// \n// GJSmartBlockPreview::addPreview from 0x100429280 to 0x1004293df (351 bytes)\n// \n// 2 xrefs:\n// > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x1004e9ca7\n// > BrowseSmartKeyLayer::init @ 0x1004eb103\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 GJSmartBlockPreview::addPreview(\n        __int64 a1,\n        std::string *a2,\n        unsigned __int8 *a3,\n        LevelEditorLayer *a4,\n        double a5)\n{\n  unsigned int v7; // eax\n  cocos2d::CCArray *v8; // r14\n  EditorUI *m_editorUI; // rbx\n  const cocos2d::CCPoint *v10; // r13\n  __int64 v11; // rax\n  double v12; // [rsp+10h] [rbp-70h] BYREF\n  unsigned __int64 v13; // [rsp+18h] [rbp-68h] BYREF\n  unsigned __int64 v14; // [rsp+20h] [rbp-60h] BYREF\n  LevelEditorLayer *v15; // [rsp+28h] [rbp-58h]\n  __int128 v16; // [rsp+30h] [rbp-50h] BYREF\n  void *__p; // [rsp+40h] [rbp-40h]\n  float v18; // [rsp+54h] [rbp-2Ch]\n  double v19; // 0:xmm0_8.8\n\n  v7 = *a3;\n  if ( (v7 & 1) != 0 )\n  {\n    if ( !*((_QWORD *)a3 + 1) )\n      return;\n  }\n  else if ( !(v7 >> 1) )\n  {\n    return;\n  }\n  v8 = (cocos2d::CCArray *)sub_10071F9E0(a1, a2);\n  v15 = a4;\n  m_editorUI = a4->m_editorUI;\n  if ( (*a3 & 1) != 0 )\n  {\n    sub_100006B70(&v16, *((const void **)a3 + 2), *((_QWORD *)a3 + 1), a5);\n  }\n  else\n  {\n    __p = *((void **)a3 + 2);\n    v16 = *(_OWORD *)a3;\n  }\n  v10 = EditorUI::spriteFromObjectString(m_editorUI, (__int64)&v16, 0, 0, 0, (__int64)v8, 0, 0);\n  if ( (v16 & 1) != 0 )\n    operator delete(__p);\n  (*(void (__fastcall **)(__int64, const cocos2d::CCPoint *, __int64))(*(_QWORD *)a1 + 448LL))(a1, v10, 10);\n  std::string::at(a2, 0);\n  v18 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 312LL))(a1) * 0.5;\n  v11 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 312LL))(a1);\n  sub_10028CBE0((float *)&v13, v18, 0.5 * *(float *)(v11 + 4));\n  *(cocos2d::CCPoint *)&v19 = GJSmartTemplate::offsetForType((SmartBlockType)&v14);\n  sub_10028CCE0(&v12, &v13, &v14);\n  (*(void (__fastcall **)(const cocos2d::CCPoint *, double *, double))(*(_QWORD *)v10 + 184LL))(v10, &v12, v19);\n  LevelEditorLayer::updateObjectColors(v15, v8);\n}", "assembly": "; \n; GJSmartBlockPreview::addPreview from 0x100429280 to 0x1004293df (351 bytes)\n; \n; 2 xrefs:\n; > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x1004e9ca7\n; > BrowseSmartKeyLayer::init @ 0x1004eb103\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, 0x100429280\nmov     rbp, rsp                                                       ; +0x1, 0x100429281\npush    r15                                                            ; +0x4, 0x100429284\npush    r14                                                            ; +0x6, 0x100429286\npush    r13                                                            ; +0x8, 0x100429288\npush    r12                                                            ; +0xa, 0x10042928a\npush    rbx                                                            ; +0xc, 0x10042928c\nsub     rsp, 58h                                                       ; +0xd, 0x10042928d\nmov     rbx, rcx                                                       ; +0x11, 0x100429291\nmov     r13, rdx                                                       ; +0x14, 0x100429294\nmov     r12, rsi                                                       ; +0x17, 0x100429297\nmov     r15, rdi                                                       ; +0x1a, 0x10042929a\nmovzx   eax, byte ptr [rdx]                                            ; +0x1d, 0x10042929d\ntest    al, 1                                                          ; +0x20, 0x1004292a0\njnz     short loc_1004292B0                                            ; +0x22, 0x1004292a2\nshr     eax, 1                                                         ; +0x24, 0x1004292a4\ntest    rax, rax                                                       ; +0x26, 0x1004292a6\njnz     short loc_1004292BD                                            ; +0x29, 0x1004292a9\njmp     loc_1004293D0                                                  ; +0x2b, 0x1004292ab\nmov     rax, [r13+8]                                                   ; +0x30, 0x1004292b0\ntest    rax, rax                                                       ; +0x34, 0x1004292b4\njz      loc_1004293D0                                                  ; +0x37, 0x1004292b7\ncall    sub_10071F9E0                                                  ; +0x3d, 0x1004292bd\nmov     r14, rax                                                       ; +0x42, 0x1004292c2\nmov     [rbp+var_58], rbx                                              ; +0x45, 0x1004292c5\nmov     rbx, [rbx+3670h]                                               ; +0x49, 0x1004292c9\ntest    byte ptr [r13+0], 1                                            ; +0x50, 0x1004292d0\njnz     short loc_1004292EA                                            ; +0x55, 0x1004292d5\nmov     rax, [r13+10h]                                                 ; +0x57, 0x1004292d7\nmov     [rbp+__p], rax                                                 ; +0x5b, 0x1004292db\nmovups  xmm0, xmmword ptr [r13+0]                                      ; +0x5f, 0x1004292df\nmovaps  [rbp+var_50], xmm0                                             ; +0x64, 0x1004292e4\njmp     short loc_1004292FB                                            ; +0x68, 0x1004292e8\nmov     rdx, [r13+8]                                                   ; +0x6a, 0x1004292ea\nmov     rsi, [r13+10h]                                                 ; +0x6e, 0x1004292ee\nlea     rdi, [rbp+var_50]                                              ; +0x72, 0x1004292f2\ncall    sub_100006B70                                                  ; +0x76, 0x1004292f6\nxorps   xmm0, xmm0                                                     ; +0x7b, 0x1004292fb\nmovups  [rsp+80h+var_80], xmm0                                         ; +0x7e, 0x1004292fe\nlea     rsi, [rbp+var_50]                                              ; +0x82, 0x100429302\nmov     rdi, rbx                                                       ; +0x86, 0x100429306\nxor     edx, edx                                                       ; +0x89, 0x100429309\nxor     ecx, ecx                                                       ; +0x8b, 0x10042930b\nxor     r8d, r8d                                                       ; +0x8d, 0x10042930d\nmov     r9, r14                                                        ; +0x90, 0x100429310\ncall    EditorUI__spriteFromObjectString                               ; +0x93, 0x100429313\nmov     r13, rax                                                       ; +0x98, 0x100429318\ntest    byte ptr [rbp+var_50], 1                                       ; +0x9b, 0x10042931b\njz      short loc_10042932A                                            ; +0x9f, 0x10042931f\nmov     rdi, [rbp+__p]; __p                                            ; +0xa1, 0x100429321\ncall    __ZdlPv; operator delete(void *)                               ; +0xa5, 0x100429325\nmov     rax, [r15]                                                     ; +0xaa, 0x10042932a\nmov     rdi, r15                                                       ; +0xad, 0x10042932d\nmov     rsi, r13                                                       ; +0xb0, 0x100429330\nmov     edx, 0Ah                                                       ; +0xb3, 0x100429333\ncall    qword ptr [rax+1C0h]                                           ; +0xb8, 0x100429338\nmov     rdi, r12; this                                                 ; +0xbe, 0x10042933e\nxor     esi, esi; __n                                                  ; +0xc1, 0x100429341\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm; std::string::at(ulong) ; +0xc3, 0x100429343\nmovsx   r12d, byte ptr [rax]                                           ; +0xc8, 0x100429348\nmov     rax, [r15]                                                     ; +0xcc, 0x10042934c\nmov     rdi, r15                                                       ; +0xcf, 0x10042934f\ncall    qword ptr [rax+138h]                                           ; +0xd2, 0x100429352\nmovss   xmm1, dword ptr [rax]                                          ; +0xd8, 0x100429358\nmulss   xmm1, cs:dword_100814FA8                                       ; +0xdc, 0x10042935c\nmovss   [rbp+var_2C], xmm1                                             ; +0xe4, 0x100429364\nmov     rax, [r15]                                                     ; +0xe9, 0x100429369\nmov     rdi, r15                                                       ; +0xec, 0x10042936c\ncall    qword ptr [rax+138h]                                           ; +0xef, 0x10042936f\nmovss   xmm1, cs:dword_100814FA8                                       ; +0xf5, 0x100429375\nmulss   xmm1, dword ptr [rax+4]                                        ; +0xfd, 0x10042937d\nlea     rbx, [rbp+var_68]                                              ; +0x102, 0x100429382\nmov     rdi, rbx                                                       ; +0x106, 0x100429386\nmovss   xmm0, [rbp+var_2C]                                             ; +0x109, 0x100429389\ncall    sub_10028CBE0                                                  ; +0x10e, 0x10042938e\nlea     r15, [rbp+var_60]                                              ; +0x113, 0x100429393\nmov     rdi, r15                                                       ; +0x117, 0x100429397\nmov     esi, r12d                                                      ; +0x11a, 0x10042939a\ncall    GJSmartTemplate__offsetForType                                 ; +0x11d, 0x10042939d\nlea     r12, [rbp+var_70]                                              ; +0x122, 0x1004293a2\nmov     rdi, r12                                                       ; +0x126, 0x1004293a6\nmov     rsi, rbx                                                       ; +0x129, 0x1004293a9\nmov     rdx, r15                                                       ; +0x12c, 0x1004293ac\ncall    sub_10028CCE0                                                  ; +0x12f, 0x1004293af\nmov     rax, [r13+0]                                                   ; +0x134, 0x1004293b4\nmov     rdi, r13                                                       ; +0x138, 0x1004293b8\nmov     rsi, r12                                                       ; +0x13b, 0x1004293bb\ncall    qword ptr [rax+0B8h]                                           ; +0x13e, 0x1004293be\nmov     rdi, [rbp+var_58]                                              ; +0x144, 0x1004293c4\nmov     rsi, r14                                                       ; +0x148, 0x1004293c8\ncall    LevelEditorLayer__updateObjectColors                           ; +0x14b, 0x1004293cb\nadd     rsp, 58h                                                       ; +0x150, 0x1004293d0\npop     rbx                                                            ; +0x154, 0x1004293d4\npop     r12                                                            ; +0x155, 0x1004293d5\npop     r13                                                            ; +0x157, 0x1004293d7\npop     r14                                                            ; +0x159, 0x1004293d9\npop     r15                                                            ; +0x15b, 0x1004293db\npop     rbp                                                            ; +0x15d, 0x1004293dd\nretn                                                                   ; +0x15e, 0x1004293de", "xrefs": ["BrowseSmartTemplateLayer::addPrefabMenuItem @ 0x1004e9ca7", "BrowseSmartKeyLayer::init @ 0x1004eb103"], "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"}