{"type": "func", "start": 5371530992, "end": 5371531461, "name": "GJSmartTemplate::saveRemapToDict", "pseudocode": "// \n// GJSmartTemplate::saveRemapToDict from 0x1402b0ef0 to 0x1402b10c5 (469 bytes)\n// \n// 8 xrefs:\n// > GJSmartTemplate::saveRemap @ 0x1402b0b9e\n// > GJSmartTemplate::saveRemap @ 0x1402b0be1\n// > GJSmartTemplate::saveRemap @ 0x1402b0c24\n// > GJSmartTemplate::saveRemap @ 0x1402b0d1e\n// > GJSmartTemplate::saveRemap @ 0x1402b0d63\n// > GJSmartTemplate::saveRemap @ 0x1402b0e47\n// > GJSmartTemplate::saveRemap @ 0x1402b0e8a\n// > <???> @ 0x1406d233c\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 GJSmartTemplate::saveRemapToDict(__int64 a1, __int64 a2, const void **a3, __int64 a4)\n{\n  __int64 v7; // rcx\n  cocos2d::CCArray *v8; // r12\n  unsigned int v9; // r15d\n  cocos2d::CCString *v10; // rax\n  const char *CString; // rax\n  size_t v12; // r8\n  const void *v13; // rdx\n  void **v14; // rcx\n  unsigned __int64 v15; // r13\n  char *v16; // rdi\n  const void *v17; // r14\n  size_t v18; // rbp\n  size_t v19; // r8\n  int v20; // ebx\n  char *v21; // rax\n  struct cocos2d::CCObject *v22; // rax\n  bool v23; // [rsp+20h] [rbp-88h]\n  void *Buf1[2]; // [rsp+40h] [rbp-68h] BYREF\n  size_t v26; // [rsp+50h] [rbp-58h]\n  unsigned __int64 v27; // [rsp+58h] [rbp-50h]\n\n  if ( *(_QWORD *)(a2 + 16) )\n  {\n    v8 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a4, a2);\n    if ( !v8 )\n    {\n      v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(v7);\n      cocos2d::CCDictionary::setObject(a4, v8, a2);\n    }\n    v9 = 0;\n    if ( cocos2d::CCArray::count(v8) )\n    {\n      while ( 1 )\n      {\n        v10 = cocos2d::CCArray::stringAtIndex(v8, v9);\n        CString = cocos2d::CCString::getCString(v10);\n        *(_OWORD *)Buf1 = 0;\n        v26 = 0;\n        v27 = 0;\n        v12 = -1;\n        do\n          ++v12;\n        while ( CString[v12] );\n        sub_14003A930(Buf1, CString, v12);\n        v13 = a3;\n        if ( (unsigned __int64)a3[3] > 0xF )\n          v13 = *a3;\n        v14 = Buf1;\n        v15 = v27;\n        v23 = v27 > 0xF;\n        v16 = (char *)Buf1[0];\n        if ( v27 > 0xF )\n          v14 = (void **)Buf1[0];\n        v17 = a3[2];\n        v18 = v26;\n        v19 = v26;\n        if ( (unsigned __int64)v17 < v26 )\n          v19 = (size_t)a3[2];\n        v20 = memcmp(v14, v13, v19);\n        if ( !v20 )\n        {\n          if ( v18 >= (unsigned __int64)v17 )\n            v20 = v18 > (unsigned __int64)v17;\n          else\n            v20 = -1;\n        }\n        if ( v23 )\n        {\n          v21 = v16;\n          if ( v15 + 1 >= 0x1000 )\n          {\n            v16 = *((char **)v16 - 1);\n            if ( (unsigned __int64)(v21 - v16 - 8) > 0x1F )\n              invalid_parameter_noinfo_noreturn();\n          }\n          j_j_free(v16);\n        }\n        if ( !v20 )\n          break;\n        if ( ++v9 >= cocos2d::CCArray::count(v8) )\n          goto LABEL_25;\n      }\n    }\n    else\n    {\nLABEL_25:\n      v22 = (struct cocos2d::CCObject *)cocos2d::CCString::create(a3);\n      cocos2d::CCArray::addObject(v8, v22);\n    }\n  }\n  sub_14003A830(a2);\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GJSmartTemplate::saveRemapToDict from 0x1402b0ef0 to 0x1402b10c5 (469 bytes)\n; \n; 8 xrefs:\n; > GJSmartTemplate::saveRemap @ 0x1402b0b9e\n; > GJSmartTemplate::saveRemap @ 0x1402b0be1\n; > GJSmartTemplate::saveRemap @ 0x1402b0c24\n; > GJSmartTemplate::saveRemap @ 0x1402b0d1e\n; > GJSmartTemplate::saveRemap @ 0x1402b0d63\n; > GJSmartTemplate::saveRemap @ 0x1402b0e47\n; > GJSmartTemplate::saveRemap @ 0x1402b0e8a\n; > <???> @ 0x1406d233c\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     [rsp+arg_0], rbx                                               ; +0x0, 0x1402b0ef0\npush    rbp                                                            ; +0x5, 0x1402b0ef5\npush    rsi                                                            ; +0x6, 0x1402b0ef6\npush    rdi                                                            ; +0x7, 0x1402b0ef7\npush    r12                                                            ; +0x8, 0x1402b0ef8\npush    r13                                                            ; +0xa, 0x1402b0efa\npush    r14                                                            ; +0xc, 0x1402b0efc\npush    r15                                                            ; +0xe, 0x1402b0efe\nsub     rsp, 70h                                                       ; +0x10, 0x1402b0f00\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x1402b0f04\nxor     rax, rsp                                                       ; +0x1b, 0x1402b0f0b\nmov     [rsp+0A8h+var_48], rax                                         ; +0x1e, 0x1402b0f0e\nmov     rbx, r9                                                        ; +0x23, 0x1402b0f13\nmov     rsi, r8                                                        ; +0x26, 0x1402b0f16\nmov     rdi, rdx                                                       ; +0x29, 0x1402b0f19\nmov     [rsp+0A8h+var_80], rdx                                         ; +0x2c, 0x1402b0f1c\nmov     [rsp+0A8h+var_78], rdx                                         ; +0x31, 0x1402b0f21\nmov     [rsp+0A8h+var_70], r8                                          ; +0x36, 0x1402b0f26\ncmp     qword ptr [rdx+10h], 0                                         ; +0x3b, 0x1402b0f2b\njz      loc_1402B108D                                                  ; +0x40, 0x1402b0f30\nmov     rcx, rbx                                                       ; +0x46, 0x1402b0f36\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x49, 0x1402b0f39\nmov     r12, rax                                                       ; +0x4f, 0x1402b0f3f\ntest    rax, rax                                                       ; +0x52, 0x1402b0f42\njnz     short loc_1402B0F5F                                            ; +0x55, 0x1402b0f45\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x57, 0x1402b0f47\nmov     r12, rax                                                       ; +0x5d, 0x1402b0f4d\nmov     r8, rdi                                                        ; +0x60, 0x1402b0f50\nmov     rdx, rax                                                       ; +0x63, 0x1402b0f53\nmov     rcx, rbx                                                       ; +0x66, 0x1402b0f56\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x69, 0x1402b0f59\nxor     ebx, ebx                                                       ; +0x6f, 0x1402b0f5f\nmov     r15d, ebx                                                      ; +0x71, 0x1402b0f61\nmov     rcx, r12                                                       ; +0x74, 0x1402b0f64\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x77, 0x1402b0f67\ntest    eax, eax                                                       ; +0x7d, 0x1402b0f6d\njz      loc_1402B1077                                                  ; +0x7f, 0x1402b0f6f\nnop     word ptr [rax+rax+00000000h]                                   ; +0x85, 0x1402b0f75\nmov     edx, r15d                                                      ; +0x90, 0x1402b0f80\nmov     rcx, r12                                                       ; +0x93, 0x1402b0f83\ncall    cs:?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x96, 0x1402b0f86\nmov     rcx, rax                                                       ; +0x9c, 0x1402b0f8c\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x9f, 0x1402b0f8f\nxorps   xmm0, xmm0                                                     ; +0xa5, 0x1402b0f95\nmovups  xmmword ptr [rsp+0A8h+Buf1], xmm0                              ; +0xa8, 0x1402b0f98\nmov     [rsp+0A8h+var_58], rbx                                         ; +0xad, 0x1402b0f9d\nmov     [rsp+0A8h+var_50], rbx                                         ; +0xb2, 0x1402b0fa2\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xb7, 0x1402b0fa7\nxchg    ax, ax                                                         ; +0xbe, 0x1402b0fae\ninc     r8                                                             ; +0xc0, 0x1402b0fb0\ncmp     byte ptr [rax+r8], 0                                           ; +0xc3, 0x1402b0fb3\njnz     short loc_1402B0FB0                                            ; +0xc8, 0x1402b0fb8\nmov     rdx, rax                                                       ; +0xca, 0x1402b0fba\nlea     rcx, [rsp+0A8h+Buf1]                                           ; +0xcd, 0x1402b0fbd\ncall    sub_14003A930                                                  ; +0xd2, 0x1402b0fc2\nmov     rdx, rsi                                                       ; +0xd7, 0x1402b0fc7\ncmp     qword ptr [rsi+18h], 0Fh                                       ; +0xda, 0x1402b0fca\njbe     short loc_1402B0FD4                                            ; +0xdf, 0x1402b0fcf\nmov     rdx, [rsi]; Buf2                                               ; +0xe1, 0x1402b0fd1\nlea     rcx, [rsp+0A8h+Buf1]                                           ; +0xe4, 0x1402b0fd4\nmov     r13, [rsp+0A8h+var_50]                                         ; +0xe9, 0x1402b0fd9\ncmp     r13, 0Fh                                                       ; +0xee, 0x1402b0fde\nsetnbe  [rsp+0A8h+var_88]                                              ; +0xf2, 0x1402b0fe2\nmov     rdi, [rsp+0A8h+Buf1]                                           ; +0xf7, 0x1402b0fe7\ncmova   rcx, rdi; Buf1                                                 ; +0xfc, 0x1402b0fec\nmov     r14, [rsi+10h]                                                 ; +0x100, 0x1402b0ff0\nmov     rbp, [rsp+0A8h+var_58]                                         ; +0x104, 0x1402b0ff4\nmov     r8, rbp                                                        ; +0x109, 0x1402b0ff9\ncmp     r14, rbp                                                       ; +0x10c, 0x1402b0ffc\ncmovb   r8, r14; Size                                                  ; +0x10f, 0x1402b0fff\ncall    memcmp                                                         ; +0x113, 0x1402b1003\nmov     ebx, eax                                                       ; +0x118, 0x1402b1008\ntest    eax, eax                                                       ; +0x11a, 0x1402b100a\njnz     short loc_1402B1020                                            ; +0x11c, 0x1402b100c\ncmp     rbp, r14                                                       ; +0x11e, 0x1402b100e\njnb     short loc_1402B1018                                            ; +0x121, 0x1402b1011\nlea     ebx, [rax-1]                                                   ; +0x123, 0x1402b1013\njmp     short loc_1402B1020                                            ; +0x126, 0x1402b1016\nxor     ebx, ebx                                                       ; +0x128, 0x1402b1018\ncmp     rbp, r14                                                       ; +0x12a, 0x1402b101a\nsetnbe  bl                                                             ; +0x12d, 0x1402b101d\ncmp     [rsp+0A8h+var_88], 0                                           ; +0x130, 0x1402b1020\njz      short loc_1402B1054                                            ; +0x135, 0x1402b1025\nlea     rdx, [r13+1]                                                   ; +0x137, 0x1402b1027\nmov     rax, rdi                                                       ; +0x13b, 0x1402b102b\ncmp     rdx, 1000h                                                     ; +0x13e, 0x1402b102e\njb      short loc_1402B104C                                            ; +0x145, 0x1402b1035\nadd     rdx, 27h ; '''                                                 ; +0x147, 0x1402b1037\nmov     rdi, [rdi-8]                                                   ; +0x14b, 0x1402b103b\nsub     rax, rdi                                                       ; +0x14f, 0x1402b103f\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x152, 0x1402b1042\ncmp     rax, 1Fh                                                       ; +0x156, 0x1402b1046\nja      short loc_1402B1070                                            ; +0x15a, 0x1402b104a\nmov     rcx, rdi; Block                                                ; +0x15c, 0x1402b104c\ncall    j_j_free                                                       ; +0x15f, 0x1402b104f\ntest    ebx, ebx                                                       ; +0x164, 0x1402b1054\njz      short loc_1402B108D                                            ; +0x166, 0x1402b1056\ninc     r15d                                                           ; +0x168, 0x1402b1058\nmov     rcx, r12                                                       ; +0x16b, 0x1402b105b\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x16e, 0x1402b105e\ncmp     r15d, eax                                                      ; +0x174, 0x1402b1064\njnb     short loc_1402B1077                                            ; +0x177, 0x1402b1067\nxor     ebx, ebx                                                       ; +0x179, 0x1402b1069\njmp     loc_1402B0F80                                                  ; +0x17b, 0x1402b106b\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x180, 0x1402b1070\ndb 0CCh                                                                ; +0x186, 0x1402b1076\nmov     rcx, rsi                                                       ; +0x187, 0x1402b1077\ncall    cs:?create@CCString@cocos2d@@SAPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCString::create(std::string const &) ; +0x18a, 0x1402b107a\nmov     rdx, rax                                                       ; +0x190, 0x1402b1080\nmov     rcx, r12                                                       ; +0x193, 0x1402b1083\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x196, 0x1402b1086\nnop                                                                    ; +0x19c, 0x1402b108c\nmov     rcx, [rsp+0A8h+var_80]                                         ; +0x19d, 0x1402b108d\ncall    sub_14003A830                                                  ; +0x1a2, 0x1402b1092\nnop                                                                    ; +0x1a7, 0x1402b1097\nmov     rcx, rsi                                                       ; +0x1a8, 0x1402b1098\ncall    sub_14003A830                                                  ; +0x1ab, 0x1402b109b\nmov     rcx, [rsp+0A8h+var_48]                                         ; +0x1b0, 0x1402b10a0\nxor     rcx, rsp; StackCookie                                          ; +0x1b5, 0x1402b10a5\ncall    __security_check_cookie                                        ; +0x1b8, 0x1402b10a8\nmov     rbx, [rsp+0A8h+arg_0]                                          ; +0x1bd, 0x1402b10ad\nadd     rsp, 70h                                                       ; +0x1c5, 0x1402b10b5\npop     r15                                                            ; +0x1c9, 0x1402b10b9\npop     r14                                                            ; +0x1cb, 0x1402b10bb\npop     r13                                                            ; +0x1cd, 0x1402b10bd\npop     r12                                                            ; +0x1cf, 0x1402b10bf\npop     rdi                                                            ; +0x1d1, 0x1402b10c1\npop     rsi                                                            ; +0x1d2, 0x1402b10c2\npop     rbp                                                            ; +0x1d3, 0x1402b10c3\nretn                                                                   ; +0x1d4, 0x1402b10c4", "xrefs": ["GJSmartTemplate::saveRemap @ 0x1402b0b9e", "GJSmartTemplate::saveRemap @ 0x1402b0be1", "GJSmartTemplate::saveRemap @ 0x1402b0c24", "GJSmartTemplate::saveRemap @ 0x1402b0d1e", "GJSmartTemplate::saveRemap @ 0x1402b0d63", "GJSmartTemplate::saveRemap @ 0x1402b0e47", "GJSmartTemplate::saveRemap @ 0x1402b0e8a", "<???> @ 0x1406d233c"], "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"}