{"type": "func", "start": 6442535552, "end": 6442535752, "name": "cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject", "pseudocode": "// \n// cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject from 0x180014a80 to 0x180014b48 (200 bytes)\n// \n// 5 xrefs:\n// > <???> @ 0x18002ec88\n// > <???> @ 0x18002ecc4\n// > <???> @ 0x18002ecd4\n// > <???> @ 0x18002fdf8\n// > <???> @ 0x18004a6b0\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__int64 __fastcall cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject(\n        cocos2d::extension::CCArrayForObjectSorting *this,\n        struct cocos2d::extension::CCSortableObject *a2)\n{\n  unsigned int v3; // ebx\n  unsigned int v4; // ebp\n  unsigned int v5; // esi\n  unsigned int *v6; // rdi\n  __int64 v7; // rax\n  _QWORD *v8; // rdi\n  _QWORD *i; // r14\n  __int64 v10; // rax\n  unsigned int v11; // eax\n\n  v3 = 0;\n  if ( !a2 )\n    return 0xFFFFFFFFLL;\n  v4 = 0;\n  v5 = (*(__int64 (__fastcall **)(struct cocos2d::extension::CCSortableObject *))(*(_QWORD *)a2 + 16LL))(a2);\n  if ( !this )\n    return 0;\n  v6 = *((unsigned int **)this + 7);\n  v7 = *v6;\n  if ( !(_DWORD)v7 )\n    return 0;\n  v8 = *((_QWORD **)v6 + 2);\n  for ( i = &v8[v7 - 1]; v8 <= i; v4 = v11 )\n  {\n    if ( !*v8 )\n      break;\n    v10 = _RTDynamicCast(\n            *v8,\n            0,\n            &cocos2d::CCObject `RTTI Type Descriptor',\n            &cocos2d::extension::CCSortableObject `RTTI Type Descriptor',\n            0);\n    v11 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 16LL))(v10);\n    if ( v5 == v11 || v5 >= v4 && v5 < v11 )\n      break;\n    ++v3;\n    ++v8;\n  }\n  return v3;\n}", "assembly": "; \n; cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject from 0x180014a80 to 0x180014b48 (200 bytes)\n; \n; 5 xrefs:\n; > <???> @ 0x18002ec88\n; > <???> @ 0x18002ecc4\n; > <???> @ 0x18002ecd4\n; > <???> @ 0x18002fdf8\n; > <???> @ 0x18004a6b0\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    rbx                                                            ; +0x0, 0x180014a80\npush    rdi                                                            ; +0x2, 0x180014a82\npush    r15                                                            ; +0x3, 0x180014a83\nsub     rsp, 30h                                                       ; +0x5, 0x180014a85\nxor     r15d, r15d                                                     ; +0x9, 0x180014a89\nmov     rdi, rcx                                                       ; +0xc, 0x180014a8c\nmov     ebx, r15d                                                      ; +0xf, 0x180014a8f\ntest    rdx, rdx                                                       ; +0x12, 0x180014a92\njz      loc_180014B3A                                                  ; +0x15, 0x180014a95\nmov     rax, [rdx]                                                     ; +0x1b, 0x180014a9b\nmov     rcx, rdx                                                       ; +0x1e, 0x180014a9e\nmov     [rsp+48h+arg_0], rbp                                           ; +0x21, 0x180014aa1\nmov     ebp, r15d                                                      ; +0x26, 0x180014aa6\nmov     [rsp+48h+arg_8], rsi                                           ; +0x29, 0x180014aa9\ncall    qword ptr [rax+10h]                                            ; +0x2e, 0x180014aae\nmov     esi, eax                                                       ; +0x31, 0x180014ab1\ntest    rdi, rdi                                                       ; +0x33, 0x180014ab3\njz      short loc_180014B36                                            ; +0x36, 0x180014ab6\nmov     rdi, [rdi+38h]                                                 ; +0x38, 0x180014ab8\nmov     eax, [rdi]                                                     ; +0x3c, 0x180014abc\ntest    eax, eax                                                       ; +0x3e, 0x180014abe\njz      short loc_180014B36                                            ; +0x40, 0x180014ac0\nmov     rdi, [rdi+10h]                                                 ; +0x42, 0x180014ac2\nmov     [rsp+48h+arg_10], r14                                          ; +0x46, 0x180014ac6\nlea     r14, [rax-1]                                                   ; +0x4b, 0x180014acb\nlea     r14, [rdi+r14*8]                                               ; +0x4f, 0x180014acf\ncmp     rdi, r14                                                       ; +0x53, 0x180014ad3\nja      short loc_180014B1C                                            ; +0x56, 0x180014ad6\nmov     rcx, [rdi]                                                     ; +0x58, 0x180014ad8\ntest    rcx, rcx                                                       ; +0x5b, 0x180014adb\njz      short loc_180014B1C                                            ; +0x5e, 0x180014ade\nlea     r9, ??_R0?AVCCSortableObject@extension@cocos2d@@@8; cocos2d::extension::CCSortableObject `RTTI Type Descriptor' ; +0x60, 0x180014ae0\nmov     [rsp+48h+var_28], r15d                                         ; +0x67, 0x180014ae7\nlea     r8, ??_R0?AVCCObject@cocos2d@@@8; cocos2d::CCObject `RTTI Type Descriptor' ; +0x6c, 0x180014aec\nxor     edx, edx                                                       ; +0x73, 0x180014af3\ncall    __RTDynamicCast                                                ; +0x75, 0x180014af5\nmov     rcx, rax                                                       ; +0x7a, 0x180014afa\nmov     rdx, [rax]                                                     ; +0x7d, 0x180014afd\ncall    qword ptr [rdx+10h]                                            ; +0x80, 0x180014b00\ncmp     esi, eax                                                       ; +0x83, 0x180014b03\njz      short loc_180014B1C                                            ; +0x85, 0x180014b05\ncmp     esi, ebp                                                       ; +0x87, 0x180014b07\njb      short loc_180014B0F                                            ; +0x89, 0x180014b09\ncmp     esi, eax                                                       ; +0x8b, 0x180014b0b\njb      short loc_180014B1C                                            ; +0x8d, 0x180014b0d\ninc     ebx                                                            ; +0x8f, 0x180014b0f\nadd     rdi, 8                                                         ; +0x91, 0x180014b11\nmov     ebp, eax                                                       ; +0x95, 0x180014b15\ncmp     rdi, r14                                                       ; +0x97, 0x180014b17\njbe     short loc_180014AD8                                            ; +0x9a, 0x180014b1a\nmov     r14, [rsp+48h+arg_10]                                          ; +0x9c, 0x180014b1c\nmov     eax, ebx                                                       ; +0xa1, 0x180014b21\nmov     rbp, [rsp+48h+arg_0]                                           ; +0xa3, 0x180014b23\nmov     rsi, [rsp+48h+arg_8]                                           ; +0xa8, 0x180014b28\nadd     rsp, 30h                                                       ; +0xad, 0x180014b2d\npop     r15                                                            ; +0xb1, 0x180014b31\npop     rdi                                                            ; +0xb3, 0x180014b33\npop     rbx                                                            ; +0xb4, 0x180014b34\nretn                                                                   ; +0xb5, 0x180014b35\nmov     eax, ebx                                                       ; +0xb6, 0x180014b36\njmp     short loc_180014B23                                            ; +0xb8, 0x180014b38\nmov     eax, 0FFFFFFFFh                                                ; +0xba, 0x180014b3a\nadd     rsp, 30h                                                       ; +0xbf, 0x180014b3f\npop     r15                                                            ; +0xc3, 0x180014b43\npop     rdi                                                            ; +0xc5, 0x180014b45\npop     rbx                                                            ; +0xc6, 0x180014b46\nretn                                                                   ; +0xc7, 0x180014b47", "xrefs": ["<???> @ 0x18002ec88", "<???> @ 0x18002ecc4", "<???> @ 0x18002ecd4", "<???> @ 0x18002fdf8", "<???> @ 0x18004a6b0"], "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"}