{"type": "func", "start": 4299222336, "end": 4299222796, "name": "GJSmartTemplate::savePrefab", "pseudocode": "// \n// GJSmartTemplate::savePrefab from 0x10040ed40 to 0x10040ef0c (460 bytes)\n// \n// 1 xrefs:\n// > EditorUI::addObjectsToSmartTemplate @ 0x100013957\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 12:30:08 +0000\n// \n\nvoid __fastcall GJSmartTemplate::savePrefab(std::string *a1, __int128 *a2, const std::string *a3)\n{\n  __int64 size; // rdi\n  __int64 v6; // r12\n  unsigned int i; // r13d\n  __int64 v8; // rax\n  unsigned int v9; // r14d\n  size_t v10; // r14\n  const void *v11; // rax\n  unsigned int v12; // ebx\n  size_t v13; // rbx\n  std::string::pointer data; // rsi\n  size_t v15; // rdx\n  char *v16; // r13\n  int v17; // eax\n  __int128 v19; // [rsp+10h] [rbp-50h] BYREF\n  void *__p; // [rsp+20h] [rbp-40h]\n  std::string *v21; // [rsp+30h] [rbp-30h]\n\n  std::string::assign(a1 + 7, \"\");\n  size = a1[2].__r_.__value_.__l.__size_;\n  v6 = cocos2d::CCDictionary::objectForKey(size, (char *)a2);\n  if ( !v6 )\n  {\n    v6 = sub_1007FE900(size);\n    cocos2d::CCDictionary::setObject(a1[2].__r_.__value_.__l.__size_, v6, (char *)a2);\n  }\n  v21 = a1;\n  if ( (unsigned int)sub_1007FEF90(v6) )\n  {\n    for ( i = 0; i < (unsigned int)sub_1007FEF90(v6); ++i )\n    {\n      v8 = sub_1007FEFE0(v6, i);\n      v9 = *(unsigned __int8 *)(v8 + 80);\n      if ( (v9 & 1) != 0 )\n      {\n        v10 = *(_QWORD *)(v8 + 88);\n        v11 = *(const void **)(v8 + 96);\n        v12 = (unsigned int)a3->__r_.__value_.__l.0;\n        if ( (v12 & 1) == 0 )\n          goto LABEL_8;\n      }\n      else\n      {\n        v10 = v9 >> 1;\n        v11 = (const void *)(v8 + 81);\n        v12 = (unsigned int)a3->__r_.__value_.__l.0;\n        if ( (v12 & 1) == 0 )\n        {\nLABEL_8:\n          v13 = v12 >> 1;\n          data = a3->__r_.__value_.__s.__data_;\n          goto LABEL_11;\n        }\n      }\n      v13 = a3->__r_.__value_.__l.__size_;\n      data = a3->__r_.__value_.__l.__data_;\nLABEL_11:\n      v15 = v10;\n      if ( v13 < v10 )\n        v15 = v13;\n      if ( !memcmp(v11, data, v15) && v13 == v10 )\n        return;\n    }\n  }\n  v16 = (char *)operator new(0x70u);\n  cocos2d::CCObject::CCObject(v16);\n  *(_QWORD *)v16 = off_100B3E920;\n  *(_OWORD *)(v16 + 56) = 0;\n  *(_OWORD *)(v16 + 72) = 0;\n  *(_OWORD *)(v16 + 88) = 0;\n  *((_QWORD *)v16 + 13) = 0;\n  v17 = dword_100BDEB00++;\n  *((_DWORD *)v16 + 26) = v17;\n  cocos2d::CCObject::autorelease(v16);\n  std::string::operator=((std::string *)(v16 + 80), a3);\n  std::string::operator=((std::string *)(v16 + 56), (const std::string *)a2);\n  sub_1007FEBF0(v6, v16);\n  if ( (*(_BYTE *)a2 & 1) != 0 )\n  {\n    sub_10001AD30(&v19, *((const void **)a2 + 2), *((_QWORD *)a2 + 1));\n  }\n  else\n  {\n    __p = *((void **)a2 + 2);\n    v19 = *a2;\n  }\n  GJSmartTemplate::saveRemap(v21, &v19);\n  if ( (v19 & 1) != 0 )\n    operator delete(__p);\n}", "assembly": "; \n; GJSmartTemplate::savePrefab from 0x10040ed40 to 0x10040ef0c (460 bytes)\n; \n; 1 xrefs:\n; > EditorUI::addObjectsToSmartTemplate @ 0x100013957\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 12:30:08 +0000\n; \npush    rbp                                                            ; +0x0, 0x10040ed40\nmov     rbp, rsp                                                       ; +0x1, 0x10040ed41\npush    r15                                                            ; +0x4, 0x10040ed44\npush    r14                                                            ; +0x6, 0x10040ed46\npush    r13                                                            ; +0x8, 0x10040ed48\npush    r12                                                            ; +0xa, 0x10040ed4a\npush    rbx                                                            ; +0xc, 0x10040ed4c\nsub     rsp, 38h                                                       ; +0xd, 0x10040ed4d\nmov     r15, rdx                                                       ; +0x11, 0x10040ed51\nmov     r14, rsi                                                       ; +0x14, 0x10040ed54\nmov     rbx, rdi                                                       ; +0x17, 0x10040ed57\nadd     rdi, 0A8h; this                                                ; +0x1a, 0x10040ed5a\nlea     rsi, asc_100A41668; \"\"                                         ; +0x21, 0x10040ed61\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc; std::string::assign(char const*) ; +0x28, 0x10040ed68\nmov     rdi, [rbx+38h]                                                 ; +0x2d, 0x10040ed6d\nmov     rsi, r14                                                       ; +0x31, 0x10040ed71\ncall    cocos2d__CCDictionary__objectForKey                            ; +0x34, 0x10040ed74\nmov     r12, rax                                                       ; +0x39, 0x10040ed79\ntest    rax, rax                                                       ; +0x3c, 0x10040ed7c\njnz     short loc_10040ED98                                            ; +0x3f, 0x10040ed7f\ncall    sub_1007FE900                                                  ; +0x41, 0x10040ed81\nmov     r12, rax                                                       ; +0x46, 0x10040ed86\nmov     rdi, [rbx+38h]                                                 ; +0x49, 0x10040ed89\nmov     rsi, rax                                                       ; +0x4d, 0x10040ed8d\nmov     rdx, r14                                                       ; +0x50, 0x10040ed90\ncall    cocos2d__CCDictionary__setObject                               ; +0x53, 0x10040ed93\nmov     [rbp+__str], r14                                               ; +0x58, 0x10040ed98\nmov     [rbp+var_30], rbx                                              ; +0x5c, 0x10040ed9c\nmov     rdi, r12                                                       ; +0x60, 0x10040eda0\ncall    sub_1007FEF90                                                  ; +0x63, 0x10040eda3\ntest    eax, eax                                                       ; +0x68, 0x10040eda8\njz      loc_10040EE38                                                  ; +0x6a, 0x10040edaa\nlea     rax, [r15+1]                                                   ; +0x70, 0x10040edb0\nmov     [rbp+var_60], rax                                              ; +0x74, 0x10040edb4\nxor     r13d, r13d                                                     ; +0x78, 0x10040edb8\njmp     short loc_10040EDD0                                            ; +0x7b, 0x10040edbb\nalign 20h                                                              ; +0x7d, 0x10040edbd\ninc     r13d                                                           ; +0x80, 0x10040edc0\nmov     rdi, r12                                                       ; +0x83, 0x10040edc3\ncall    sub_1007FEF90                                                  ; +0x86, 0x10040edc6\ncmp     r13d, eax                                                      ; +0x8b, 0x10040edcb\njnb     short loc_10040EE38                                            ; +0x8e, 0x10040edce\nmov     rdi, r12                                                       ; +0x90, 0x10040edd0\nmov     esi, r13d                                                      ; +0x93, 0x10040edd3\ncall    sub_1007FEFE0                                                  ; +0x96, 0x10040edd6\nmovzx   r14d, byte ptr [rax+50h]                                       ; +0x9b, 0x10040eddb\ntest    r14b, 1                                                        ; +0xa0, 0x10040ede0\njz      short loc_10040EE00                                            ; +0xa4, 0x10040ede4\nmov     r14, [rax+58h]                                                 ; +0xa6, 0x10040ede6\nmov     rax, [rax+60h]                                                 ; +0xaa, 0x10040edea\nmovzx   ebx, byte ptr [r15]                                            ; +0xae, 0x10040edee\ntest    bl, 1                                                          ; +0xb2, 0x10040edf2\njnz     short loc_10040EE10                                            ; +0xb5, 0x10040edf5\nshr     ebx, 1                                                         ; +0xb7, 0x10040edf7\nmov     rsi, [rbp+var_60]                                              ; +0xb9, 0x10040edf9\njmp     short loc_10040EE18                                            ; +0xbd, 0x10040edfd\nalign 20h                                                              ; +0xbf, 0x10040edff\nshr     r14d, 1                                                        ; +0xc0, 0x10040ee00\nadd     rax, 51h ; 'Q'                                                 ; +0xc3, 0x10040ee03\nmovzx   ebx, byte ptr [r15]                                            ; +0xc7, 0x10040ee07\ntest    bl, 1                                                          ; +0xcb, 0x10040ee0b\njz      short loc_10040EDF7                                            ; +0xce, 0x10040ee0e\nmov     rbx, [r15+8]                                                   ; +0xd0, 0x10040ee10\nmov     rsi, [r15+10h]; __s2                                           ; +0xd4, 0x10040ee14\ncmp     rbx, r14                                                       ; +0xd8, 0x10040ee18\nmov     rdx, r14                                                       ; +0xdb, 0x10040ee1b\ncmovb   rdx, rbx; __n                                                  ; +0xde, 0x10040ee1e\nmov     rdi, rax; __s1                                                 ; +0xe2, 0x10040ee22\ncall    _memcmp                                                        ; +0xe5, 0x10040ee25\ntest    eax, eax                                                       ; +0xea, 0x10040ee2a\njnz     short loc_10040EDC0                                            ; +0xec, 0x10040ee2c\ncmp     rbx, r14                                                       ; +0xee, 0x10040ee2e\njnz     short loc_10040EDC0                                            ; +0xf1, 0x10040ee31\njmp     loc_10040EEFD                                                  ; +0xf3, 0x10040ee33\nmov     edi, 70h ; 'p'; __sz                                           ; +0xf8, 0x10040ee38\ncall    __Znwm; operator new(ulong)                                    ; +0xfd, 0x10040ee3d\nmov     r13, rax                                                       ; +0x102, 0x10040ee42\nmov     rdi, rax                                                       ; +0x105, 0x10040ee45\ncall    cocos2d__CCObject__CCObject                                    ; +0x108, 0x10040ee48\nlea     rax, off_100B3E920                                             ; +0x10d, 0x10040ee4d\nmov     [r13+0], rax                                                   ; +0x114, 0x10040ee54\nlea     rbx, [r13+38h]                                                 ; +0x118, 0x10040ee58\nxorps   xmm0, xmm0                                                     ; +0x11c, 0x10040ee5c\nmovups  xmmword ptr [r13+38h], xmm0                                    ; +0x11f, 0x10040ee5f\nmovups  xmmword ptr [r13+48h], xmm0                                    ; +0x124, 0x10040ee64\nmovups  xmmword ptr [r13+58h], xmm0                                    ; +0x129, 0x10040ee69\nmov     qword ptr [r13+68h], 0                                         ; +0x12e, 0x10040ee6e\nmov     eax, cs:dword_100BDEB00                                        ; +0x136, 0x10040ee76\nlea     ecx, [rax+1]                                                   ; +0x13c, 0x10040ee7c\nmov     cs:dword_100BDEB00, ecx                                        ; +0x13f, 0x10040ee7f\nmov     [r13+68h], eax                                                 ; +0x145, 0x10040ee85\nmov     rdi, r13                                                       ; +0x149, 0x10040ee89\ncall    cocos2d__CCObject__autorelease                                 ; +0x14c, 0x10040ee8c\nmov     rdi, r13                                                       ; +0x151, 0x10040ee91\nadd     rdi, 50h ; 'P'; this                                           ; +0x154, 0x10040ee94\nmov     rsi, r15; __str                                                ; +0x158, 0x10040ee98\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_; std::string::operator=(std::string const&) ; +0x15b, 0x10040ee9b\nmov     rdi, rbx; this                                                 ; +0x160, 0x10040eea0\nmov     rbx, [rbp+__str]                                               ; +0x163, 0x10040eea3\nmov     rsi, rbx; __str                                                ; +0x167, 0x10040eea7\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_; std::string::operator=(std::string const&) ; +0x16a, 0x10040eeaa\nmov     rdi, r12                                                       ; +0x16f, 0x10040eeaf\nmov     rsi, r13                                                       ; +0x172, 0x10040eeb2\ncall    sub_1007FEBF0                                                  ; +0x175, 0x10040eeb5\ntest    byte ptr [rbx], 1                                              ; +0x17a, 0x10040eeba\njnz     short loc_10040EED0                                            ; +0x17d, 0x10040eebd\nmov     rax, [rbx+10h]                                                 ; +0x17f, 0x10040eebf\nmov     [rbp+__p], rax                                                 ; +0x183, 0x10040eec3\nmovups  xmm0, xmmword ptr [rbx]                                        ; +0x187, 0x10040eec7\nmovaps  [rbp+var_50], xmm0                                             ; +0x18a, 0x10040eeca\njmp     short loc_10040EEE1                                            ; +0x18e, 0x10040eece\nmov     rdx, [rbx+8]                                                   ; +0x190, 0x10040eed0\nmov     rsi, [rbx+10h]                                                 ; +0x194, 0x10040eed4\nlea     rdi, [rbp+var_50]                                              ; +0x198, 0x10040eed8\ncall    sub_10001AD30                                                  ; +0x19c, 0x10040eedc\nmov     rdi, [rbp+var_30]                                              ; +0x1a1, 0x10040eee1\nlea     rsi, [rbp+var_50]                                              ; +0x1a5, 0x10040eee5\ncall    GJSmartTemplate__saveRemap                                     ; +0x1a9, 0x10040eee9\ntest    byte ptr [rbp+var_50], 1                                       ; +0x1ae, 0x10040eeee\njz      short loc_10040EEFD                                            ; +0x1b2, 0x10040eef2\nmov     rdi, [rbp+__p]; __p                                            ; +0x1b4, 0x10040eef4\ncall    __ZdlPv; operator delete(void *)                               ; +0x1b8, 0x10040eef8\nadd     rsp, 38h                                                       ; +0x1bd, 0x10040eefd\npop     rbx                                                            ; +0x1c1, 0x10040ef01\npop     r12                                                            ; +0x1c2, 0x10040ef02\npop     r13                                                            ; +0x1c4, 0x10040ef04\npop     r14                                                            ; +0x1c6, 0x10040ef06\npop     r15                                                            ; +0x1c8, 0x10040ef08\npop     rbp                                                            ; +0x1ca, 0x10040ef0a\nretn                                                                   ; +0x1cb, 0x10040ef0b", "xrefs": ["EditorUI::addObjectsToSmartTemplate @ 0x100013957"], "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"}