{"type": "func", "start": 5371326960, "end": 5371327203, "name": "GameManager::reorderKey", "pseudocode": "// \n// GameManager::reorderKey from 0x14027f1f0 to 0x14027f2e3 (243 bytes)\n// \n// 3 xrefs:\n// > EditorUI::orderUpCustomItem @ 0x1401f614d\n// > EditorUI::orderDownCustomItem @ 0x1401f61dd\n// > <???> @ 0x14091d030\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:28:59 +0000\n// \n\n__int64 __fastcall GameManager::reorderKey(__int64 a1, unsigned int a2, char a3)\n{\n  struct cocos2d::CCArray *v6; // rdi\n  unsigned int v7; // esi\n  unsigned int v8; // ebx\n  cocos2d::CCString *v9; // rax\n  unsigned int v10; // eax\n  unsigned int v12; // ebx\n  cocos2d::CCString *v13; // rax\n\n  v6 = cocos2d::CCDictionary::allKeys(*(cocos2d::CCDictionary **)(a1 + 464));\n  if ( cocos2d::CCArray::count(v6) )\n    qsort(\n      *(void **)(*((_QWORD *)v6 + 7) + 16LL),\n      **((unsigned int **)v6 + 7),\n      8u,\n      (_CoreCrtNonSecureSearchSortCompareFunction)sub_1402760B0);\n  v7 = 0;\n  v8 = 0;\n  if ( !cocos2d::CCArray::count(v6) )\n    return a2;\n  while ( 1 )\n  {\n    v9 = cocos2d::CCArray::stringAtIndex(v6, v8);\n    v10 = cocos2d::CCString::intValue(v9);\n    if ( v10 == a2 )\n      break;\n    v7 = v10;\n    if ( ++v8 >= cocos2d::CCArray::count(v6) )\n      return a2;\n  }\n  if ( !a3 )\n  {\n    v12 = v8 + 1;\n    if ( v12 >= cocos2d::CCArray::count(v6) )\n      return a2;\n    v13 = cocos2d::CCArray::stringAtIndex(v6, v12);\n    v7 = cocos2d::CCString::intValue(v13);\n  }\n  if ( !v7 )\n    return a2;\n  GameManager::switchCustomObjects(a1, a2, v7);\n  return v7;\n}", "assembly": "; \n; GameManager::reorderKey from 0x14027f1f0 to 0x14027f2e3 (243 bytes)\n; \n; 3 xrefs:\n; > EditorUI::orderUpCustomItem @ 0x1401f614d\n; > EditorUI::orderDownCustomItem @ 0x1401f61dd\n; > <???> @ 0x14091d030\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:28:59 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x14027f1f0\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x14027f1f5\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x14027f1fa\npush    rdi                                                            ; +0xf, 0x14027f1ff\npush    r14                                                            ; +0x10, 0x14027f200\npush    r15                                                            ; +0x12, 0x14027f202\nsub     rsp, 20h                                                       ; +0x14, 0x14027f204\nmov     r15, rcx                                                       ; +0x18, 0x14027f208\nmovzx   r14d, r8b                                                      ; +0x1b, 0x14027f20b\nmov     rcx, [rcx+1D0h]                                                ; +0x1f, 0x14027f20f\nmov     ebp, edx                                                       ; +0x26, 0x14027f216\ncall    cs:?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ; cocos2d::CCDictionary::allKeys(void) ; +0x28, 0x14027f218\nmov     rcx, rax                                                       ; +0x2e, 0x14027f21e\nmov     rdi, rax                                                       ; +0x31, 0x14027f221\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x34, 0x14027f224\ntest    eax, eax                                                       ; +0x3a, 0x14027f22a\njz      short loc_14027F24B                                            ; +0x3c, 0x14027f22c\nmov     rcx, [rdi+38h]                                                 ; +0x3e, 0x14027f22e\nlea     r9, sub_1402760B0; CompareFunction                             ; +0x42, 0x14027f232\nmov     r8d, 8; SizeOfElements                                         ; +0x49, 0x14027f239\nmov     edx, [rcx]; NumOfElements                                      ; +0x4f, 0x14027f23f\nmov     rcx, [rcx+10h]; Base                                           ; +0x51, 0x14027f241\ncall    cs:qsort                                                       ; +0x55, 0x14027f245\nxor     esi, esi                                                       ; +0x5b, 0x14027f24b\nmov     rcx, rdi                                                       ; +0x5d, 0x14027f24d\nmov     ebx, esi                                                       ; +0x60, 0x14027f250\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x62, 0x14027f252\ntest    eax, eax                                                       ; +0x68, 0x14027f258\njz      short loc_14027F289                                            ; +0x6a, 0x14027f25a\nnop     dword ptr [rax+00h]                                            ; +0x6c, 0x14027f25c\nmov     edx, ebx                                                       ; +0x70, 0x14027f260\nmov     rcx, rdi                                                       ; +0x72, 0x14027f262\ncall    cs:?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x75, 0x14027f265\nmov     rcx, rax                                                       ; +0x7b, 0x14027f26b\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x7e, 0x14027f26e\ncmp     eax, ebp                                                       ; +0x84, 0x14027f274\njz      short loc_14027F2A4                                            ; +0x86, 0x14027f276\nmov     rcx, rdi                                                       ; +0x88, 0x14027f278\nmov     esi, eax                                                       ; +0x8b, 0x14027f27b\ninc     ebx                                                            ; +0x8d, 0x14027f27d\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x8f, 0x14027f27f\ncmp     ebx, eax                                                       ; +0x95, 0x14027f285\njb      short loc_14027F260                                            ; +0x97, 0x14027f287\nmov     eax, ebp                                                       ; +0x99, 0x14027f289\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x9b, 0x14027f28b\nmov     rbp, [rsp+38h+arg_8]                                           ; +0xa0, 0x14027f290\nmov     rsi, [rsp+38h+arg_10]                                          ; +0xa5, 0x14027f295\nadd     rsp, 20h                                                       ; +0xaa, 0x14027f29a\npop     r15                                                            ; +0xae, 0x14027f29e\npop     r14                                                            ; +0xb0, 0x14027f2a0\npop     rdi                                                            ; +0xb2, 0x14027f2a2\nretn                                                                   ; +0xb3, 0x14027f2a3\ntest    r14b, r14b                                                     ; +0xb4, 0x14027f2a4\njnz     short loc_14027F2CE                                            ; +0xb7, 0x14027f2a7\nmov     rcx, rdi                                                       ; +0xb9, 0x14027f2a9\ninc     ebx                                                            ; +0xbc, 0x14027f2ac\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xbe, 0x14027f2ae\ncmp     ebx, eax                                                       ; +0xc4, 0x14027f2b4\njnb     short loc_14027F289                                            ; +0xc6, 0x14027f2b6\nmov     edx, ebx                                                       ; +0xc8, 0x14027f2b8\nmov     rcx, rdi                                                       ; +0xca, 0x14027f2ba\ncall    cs:?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0xcd, 0x14027f2bd\nmov     rcx, rax                                                       ; +0xd3, 0x14027f2c3\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0xd6, 0x14027f2c6\nmov     esi, eax                                                       ; +0xdc, 0x14027f2cc\ntest    esi, esi                                                       ; +0xde, 0x14027f2ce\njz      short loc_14027F289                                            ; +0xe0, 0x14027f2d0\nmov     r8d, esi                                                       ; +0xe2, 0x14027f2d2\nmov     edx, ebp                                                       ; +0xe5, 0x14027f2d5\nmov     rcx, r15                                                       ; +0xe7, 0x14027f2d7\ncall    GameManager__switchCustomObjects                               ; +0xea, 0x14027f2da\nmov     eax, esi                                                       ; +0xef, 0x14027f2df\njmp     short loc_14027F28B                                            ; +0xf1, 0x14027f2e1", "xrefs": ["EditorUI::orderUpCustomItem @ 0x1401f614d", "EditorUI::orderDownCustomItem @ 0x1401f61dd", "<???> @ 0x14091d030"], "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"}