{"type": "func", "start": 5370499920, "end": 5370500071, "name": "EditorUI::editorLayerForArray", "pseudocode": "// \n// EditorUI::editorLayerForArray from 0x1401b5350 to 0x1401b53e7 (151 bytes)\n// \n// 3 xrefs:\n// > EditorUI::updateButtons @ 0x1401ad63f\n// > EditorUI::updateButtons @ 0x1401ad652\n// > <???> @ 0x14091a18c\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:27:57 +0000\n// \n\n__int64 __fastcall EditorUI::editorLayerForArray(__int64 a1, cocos2d::CCArray *a2, unsigned __int8 a3)\n{\n  __int64 v3; // r14\n  unsigned int v5; // ebp\n  unsigned int v6; // edi\n  unsigned int v7; // ebx\n  __int64 v8; // r14\n  unsigned int v9; // ecx\n\n  v3 = a3;\n  if ( !a2 )\n    return 0;\n  v5 = 0;\n  v6 = 0;\n  v7 = -1;\n  if ( !cocos2d::CCArray::count(a2) )\n    return 0;\n  v8 = 2 * v3 + 1210;\n  do\n  {\n    v9 = *(__int16 *)((char *)cocos2d::CCArray::objectAtIndex(a2, v6) + v8);\n    if ( v7 == -1 )\n    {\n      v7 = v9;\n    }\n    else if ( v7 != v9 )\n    {\n      return 0;\n    }\n    ++v6;\n  }\n  while ( v6 < cocos2d::CCArray::count(a2) );\n  if ( v7 != -1 )\n    return v7;\n  return v5;\n}", "assembly": "; \n; EditorUI::editorLayerForArray from 0x1401b5350 to 0x1401b53e7 (151 bytes)\n; \n; 3 xrefs:\n; > EditorUI::updateButtons @ 0x1401ad63f\n; > EditorUI::updateButtons @ 0x1401ad652\n; > <???> @ 0x14091a18c\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:27:57 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1401b5350\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1401b5355\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1401b535a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x1401b535f\npush    r14                                                            ; +0x14, 0x1401b5364\nsub     rsp, 20h                                                       ; +0x16, 0x1401b5366\nmovzx   r14d, r8b                                                      ; +0x1a, 0x1401b536a\nmov     rsi, rdx                                                       ; +0x1e, 0x1401b536e\ntest    rdx, rdx                                                       ; +0x21, 0x1401b5371\njz      short loc_1401B53CA                                            ; +0x24, 0x1401b5374\nxor     ebp, ebp                                                       ; +0x26, 0x1401b5376\nmov     rcx, rdx                                                       ; +0x28, 0x1401b5378\nmov     edi, ebp                                                       ; +0x2b, 0x1401b537b\nmov     ebx, 0FFFFFFFFh                                                ; +0x2d, 0x1401b537d\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x32, 0x1401b5382\ntest    eax, eax                                                       ; +0x38, 0x1401b5388\njz      short loc_1401B53CA                                            ; +0x3a, 0x1401b538a\nlea     r14, ds:4BAh[r14*2]                                            ; +0x3c, 0x1401b538c\nmov     edx, edi                                                       ; +0x44, 0x1401b5394\nmov     rcx, rsi                                                       ; +0x46, 0x1401b5396\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x49, 0x1401b5399\nmovsx   ecx, word ptr [r14+rax]                                        ; +0x4f, 0x1401b539f\ncmp     ebx, 0FFFFFFFFh                                                ; +0x54, 0x1401b53a4\njnz     short loc_1401B53AD                                            ; +0x57, 0x1401b53a7\nmov     ebx, ecx                                                       ; +0x59, 0x1401b53a9\njmp     short loc_1401B53B1                                            ; +0x5b, 0x1401b53ab\ncmp     ebx, ecx                                                       ; +0x5d, 0x1401b53ad\njnz     short loc_1401B53CA                                            ; +0x5f, 0x1401b53af\nmov     rcx, rsi                                                       ; +0x61, 0x1401b53b1\ninc     edi                                                            ; +0x64, 0x1401b53b4\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x66, 0x1401b53b6\ncmp     edi, eax                                                       ; +0x6c, 0x1401b53bc\njb      short loc_1401B5394                                            ; +0x6e, 0x1401b53be\ncmp     ebx, 0FFFFFFFFh                                                ; +0x70, 0x1401b53c0\ncmovnz  ebp, ebx                                                       ; +0x73, 0x1401b53c3\nmov     eax, ebp                                                       ; +0x76, 0x1401b53c6\njmp     short loc_1401B53CC                                            ; +0x78, 0x1401b53c8\nxor     eax, eax                                                       ; +0x7a, 0x1401b53ca\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x7c, 0x1401b53cc\nmov     rbp, [rsp+28h+arg_8]                                           ; +0x81, 0x1401b53d1\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x86, 0x1401b53d6\nmov     rdi, [rsp+28h+arg_18]                                          ; +0x8b, 0x1401b53db\nadd     rsp, 20h                                                       ; +0x90, 0x1401b53e0\npop     r14                                                            ; +0x94, 0x1401b53e4\nretn                                                                   ; +0x96, 0x1401b53e6", "xrefs": ["EditorUI::updateButtons @ 0x1401ad63f", "EditorUI::updateButtons @ 0x1401ad652", "<???> @ 0x14091a18c"], "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"}