{"type": "func", "start": 5371540624, "end": 5371540810, "name": "GJSmartTemplate::getPrefabWithID", "pseudocode": "// \n// GJSmartTemplate::getPrefabWithID from 0x1402b3490 to 0x1402b354a (186 bytes)\n// \n// 5 xrefs:\n// > EditorUI::createPrefab @ 0x140117ccc\n// > BrowseSmartKeyLayer::onButton @ 0x14045beff\n// > BrowseSmartKeyLayer::onButton @ 0x14045bf90\n// > BrowseSmartKeyLayer::updateChanceValues @ 0x14045c40f\n// > <???> @ 0x1406d23a8\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=1\nstruct cocos2d::CCObject *__fastcall GJSmartTemplate::getPrefabWithID(__int64 a1, __int64 a2, int a3)\n{\n  cocos2d::CCArray *v5; // rax\n  cocos2d::CCArray *v6; // rdi\n  unsigned int v7; // ebx\n  struct cocos2d::CCObject *v8; // rsi\n\n  if ( a3 > 0\n    && (v5 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 56), a2), (v6 = v5) != nullptr)\n    && cocos2d::CCArray::count(v5)\n    && (v7 = 0, cocos2d::CCArray::count(v6)) )\n  {\n    while ( 1 )\n    {\n      v8 = cocos2d::CCArray::objectAtIndex(v6, v7);\n      if ( v8[2].m_uID == a3 )\n        break;\n      if ( ++v7 >= cocos2d::CCArray::count(v6) )\n        goto LABEL_7;\n    }\n    sub_14003A830(a2);\n    return v8;\n  }\n  else\n  {\nLABEL_7:\n    sub_14003A830(a2);\n    return nullptr;\n  }\n}", "assembly": "; \n; GJSmartTemplate::getPrefabWithID from 0x1402b3490 to 0x1402b354a (186 bytes)\n; \n; 5 xrefs:\n; > EditorUI::createPrefab @ 0x140117ccc\n; > BrowseSmartKeyLayer::onButton @ 0x14045beff\n; > BrowseSmartKeyLayer::onButton @ 0x14045bf90\n; > BrowseSmartKeyLayer::updateChanceValues @ 0x14045c40f\n; > <???> @ 0x1406d23a8\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_10], rbx                                              ; +0x0, 0x1402b3490\nmov     [rsp+arg_18], rbp                                              ; +0x5, 0x1402b3495\npush    rsi                                                            ; +0xa, 0x1402b349a\npush    rdi                                                            ; +0xb, 0x1402b349b\npush    r14                                                            ; +0xc, 0x1402b349c\nsub     rsp, 30h                                                       ; +0xe, 0x1402b349e\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x1402b34a2\nxor     rax, rsp                                                       ; +0x19, 0x1402b34a9\nmov     [rsp+48h+var_20], rax                                          ; +0x1c, 0x1402b34ac\nmov     r14d, r8d                                                      ; +0x21, 0x1402b34b1\nmov     rbp, rdx                                                       ; +0x24, 0x1402b34b4\nmov     [rsp+48h+var_28], rdx                                          ; +0x27, 0x1402b34b7\ntest    r8d, r8d                                                       ; +0x2c, 0x1402b34bc\njle     short loc_1402B3513                                            ; +0x2f, 0x1402b34bf\nmov     rcx, [rcx+38h]                                                 ; +0x31, 0x1402b34c1\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 &) ; +0x35, 0x1402b34c5\nmov     rdi, rax                                                       ; +0x3b, 0x1402b34cb\ntest    rax, rax                                                       ; +0x3e, 0x1402b34ce\njz      short loc_1402B3513                                            ; +0x41, 0x1402b34d1\nmov     rcx, rax                                                       ; +0x43, 0x1402b34d3\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x46, 0x1402b34d6\ntest    eax, eax                                                       ; +0x4c, 0x1402b34dc\njz      short loc_1402B3513                                            ; +0x4e, 0x1402b34de\nxor     ebx, ebx                                                       ; +0x50, 0x1402b34e0\nmov     rcx, rdi                                                       ; +0x52, 0x1402b34e2\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x55, 0x1402b34e5\ntest    eax, eax                                                       ; +0x5b, 0x1402b34eb\njz      short loc_1402B3513                                            ; +0x5d, 0x1402b34ed\nnop                                                                    ; +0x5f, 0x1402b34ef\nmov     edx, ebx                                                       ; +0x60, 0x1402b34f0\nmov     rcx, rdi                                                       ; +0x62, 0x1402b34f2\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x65, 0x1402b34f5\nmov     rsi, rax                                                       ; +0x6b, 0x1402b34fb\ncmp     [rax+78h], r14d                                                ; +0x6e, 0x1402b34fe\njz      short loc_1402B353D                                            ; +0x72, 0x1402b3502\ninc     ebx                                                            ; +0x74, 0x1402b3504\nmov     rcx, rdi                                                       ; +0x76, 0x1402b3506\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x79, 0x1402b3509\ncmp     ebx, eax                                                       ; +0x7f, 0x1402b350f\njb      short loc_1402B34F0                                            ; +0x81, 0x1402b3511\nmov     rcx, rbp                                                       ; +0x83, 0x1402b3513\ncall    sub_14003A830                                                  ; +0x86, 0x1402b3516\nxor     eax, eax                                                       ; +0x8b, 0x1402b351b\nmov     rcx, [rsp+48h+var_20]                                          ; +0x8d, 0x1402b351d\nxor     rcx, rsp; StackCookie                                          ; +0x92, 0x1402b3522\ncall    __security_check_cookie                                        ; +0x95, 0x1402b3525\nmov     rbx, [rsp+48h+arg_10]                                          ; +0x9a, 0x1402b352a\nmov     rbp, [rsp+48h+arg_18]                                          ; +0x9f, 0x1402b352f\nadd     rsp, 30h                                                       ; +0xa4, 0x1402b3534\npop     r14                                                            ; +0xa8, 0x1402b3538\npop     rdi                                                            ; +0xaa, 0x1402b353a\npop     rsi                                                            ; +0xab, 0x1402b353b\nretn                                                                   ; +0xac, 0x1402b353c\nmov     rcx, rbp                                                       ; +0xad, 0x1402b353d\ncall    sub_14003A830                                                  ; +0xb0, 0x1402b3540\nmov     rax, rsi                                                       ; +0xb5, 0x1402b3545\njmp     short loc_1402B351D                                            ; +0xb8, 0x1402b3548", "xrefs": ["EditorUI::createPrefab @ 0x140117ccc", "BrowseSmartKeyLayer::onButton @ 0x14045beff", "BrowseSmartKeyLayer::onButton @ 0x14045bf90", "BrowseSmartKeyLayer::updateChanceValues @ 0x14045c40f", "<???> @ 0x1406d23a8"], "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"}