{"type": "func", "start": 5370956288, "end": 5370956633, "name": "GJBaseGameLayer::sortStickyGroups", "pseudocode": "// \n// GJBaseGameLayer::sortStickyGroups from 0x140224a00 to 0x140224b59 (345 bytes)\n// \n// 3 xrefs:\n// > GJBaseGameLayer::updateSpecialGroupData @ 0x14020e060\n// > LevelEditorLayer::init @ 0x1402d2dcf\n// > <???> @ 0x1406cd770\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\nvoid GJBaseGameLayer::sortStickyGroups(GJBaseGameLayer *a1)\n{\n  unsigned int v2; // ebx\n  cocos2d::CCDictionary *i; // r14\n  struct cocos2d::CCObject *v4; // rbp\n  __int64 m_unknown2; // rax\n  __int64 v6; // rcx\n  cocos2d::CCArray *v7; // rsi\n  cocos2d::CCDictElement *m_pElements; // rsi\n  cocos2d::CCDictElement *j; // rbp\n  unsigned int v10; // ebx\n  cocos2d::CCArray *m_pObject; // rsi\n  struct cocos2d::CCObject *v12; // rax\n\n  v2 = 0;\n  for ( i = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(a1); v2 < cocos2d::CCArray::count(a1->m_objects); ++v2 )\n  {\n    v4 = cocos2d::CCArray::objectAtIndex(a1->m_objects, v2);\n    m_unknown2 = v4[15].m_unknown2;\n    if ( (int)m_unknown2 > 0 )\n    {\n      v7 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(i, m_unknown2);\n      if ( !v7 )\n      {\n        v7 = (cocos2d::CCArray *)cocos2d::CCArray::create(v6);\n        cocos2d::CCDictionary::setObject(i, v7, v4[15].m_unknown2);\n      }\n      cocos2d::CCArray::addObject(v7, v4);\n    }\n  }\n  a1->m_lastUsedLinkedID = 0;\n  if ( i )\n  {\n    m_pElements = i->m_pElements;\n    if ( m_pElements )\n    {\n      for ( j = (cocos2d::CCDictElement *)m_pElements->hh.next; ; j = (cocos2d::CCDictElement *)j->hh.next )\n      {\n        ++a1->m_lastUsedLinkedID;\n        v10 = 0;\n        m_pObject = (cocos2d::CCArray *)m_pElements->m_pObject;\n        if ( cocos2d::CCArray::count(m_pObject) )\n        {\n          do\n          {\n            v12 = cocos2d::CCArray::objectAtIndex(m_pObject, v10++);\n            v12[15].m_unknown2 = a1->m_lastUsedLinkedID;\n          }\n          while ( v10 < cocos2d::CCArray::count(m_pObject) );\n        }\n        cocos2d::CCDictionary::setObject(a1->m_linkedGroupDict, m_pObject, (unsigned int)a1->m_lastUsedLinkedID);\n        m_pElements = j;\n        if ( !j )\n          break;\n      }\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::sortStickyGroups from 0x140224a00 to 0x140224b59 (345 bytes)\n; \n; 3 xrefs:\n; > GJBaseGameLayer::updateSpecialGroupData @ 0x14020e060\n; > LevelEditorLayer::init @ 0x1402d2dcf\n; > <???> @ 0x1406cd770\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, 0x140224a00\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x140224a05\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x140224a0a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x140224a0f\npush    r14                                                            ; +0x14, 0x140224a14\nsub     rsp, 20h                                                       ; +0x16, 0x140224a16\nmov     rdi, rcx                                                       ; +0x1a, 0x140224a1a\ncall    cs:?create@CCDictionary@cocos2d@@SAPEAV12@XZ; cocos2d::CCDictionary::create(void) ; +0x1d, 0x140224a1d\nmov     rcx, [rdi+0DB8h]                                               ; +0x23, 0x140224a23\nxor     ebx, ebx                                                       ; +0x2a, 0x140224a2a\nmov     r14, rax                                                       ; +0x2c, 0x140224a2c\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x2f, 0x140224a2f\ntest    eax, eax                                                       ; +0x35, 0x140224a35\njz      short loc_140224AAC                                            ; +0x37, 0x140224a37\nnop     dword ptr [rax+00000000h]                                      ; +0x39, 0x140224a39\nmov     rcx, [rdi+0DB8h]                                               ; +0x40, 0x140224a40\nmov     edx, ebx                                                       ; +0x47, 0x140224a47\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x49, 0x140224a49\nmov     rbp, rax                                                       ; +0x4f, 0x140224a4f\nmovsxd  rax, dword ptr [rax+370h]                                      ; +0x52, 0x140224a52\ntest    eax, eax                                                       ; +0x59, 0x140224a59\njle     short loc_140224A99                                            ; +0x5b, 0x140224a5b\nmov     rdx, rax                                                       ; +0x5d, 0x140224a5d\nmov     rcx, r14                                                       ; +0x60, 0x140224a60\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x63, 0x140224a63\nmov     rsi, rax                                                       ; +0x69, 0x140224a69\ntest    rax, rax                                                       ; +0x6c, 0x140224a6c\njnz     short loc_140224A8D                                            ; +0x6f, 0x140224a6f\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x71, 0x140224a71\nmovsxd  r8, dword ptr [rbp+370h]                                       ; +0x77, 0x140224a77\nmov     rcx, r14                                                       ; +0x7e, 0x140224a7e\nmov     rdx, rax                                                       ; +0x81, 0x140224a81\nmov     rsi, rax                                                       ; +0x84, 0x140224a84\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,__int64) ; +0x87, 0x140224a87\nmov     rdx, rbp                                                       ; +0x8d, 0x140224a8d\nmov     rcx, rsi                                                       ; +0x90, 0x140224a90\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x93, 0x140224a93\nmov     rcx, [rdi+0DB8h]                                               ; +0x99, 0x140224a99\ninc     ebx                                                            ; +0xa0, 0x140224aa0\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xa2, 0x140224aa2\ncmp     ebx, eax                                                       ; +0xa8, 0x140224aa8\njb      short loc_140224A40                                            ; +0xaa, 0x140224aaa\nmov     dword ptr [rdi+0FC8h], 0                                       ; +0xac, 0x140224aac\ntest    r14, r14                                                       ; +0xb6, 0x140224ab6\njz      loc_140224B3E                                                  ; +0xb9, 0x140224ab9\nmov     rsi, [r14+38h]                                                 ; +0xbf, 0x140224abf\ntest    rsi, rsi                                                       ; +0xc3, 0x140224ac3\njz      short loc_140224B3E                                            ; +0xc6, 0x140224ac6\nmov     rbp, [rsi+120h]                                                ; +0xc8, 0x140224ac8\nnop                                                                    ; +0xcf, 0x140224acf\ninc     dword ptr [rdi+0FC8h]                                          ; +0xd0, 0x140224ad0\nxor     ebx, ebx                                                       ; +0xd6, 0x140224ad6\nmov     rsi, [rsi+108h]                                                ; +0xd8, 0x140224ad8\nmov     rcx, rsi                                                       ; +0xdf, 0x140224adf\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xe2, 0x140224ae2\ntest    eax, eax                                                       ; +0xe8, 0x140224ae8\njz      short loc_140224B16                                            ; +0xea, 0x140224aea\nnop     dword ptr [rax+00h]                                            ; +0xec, 0x140224aec\nmov     edx, ebx                                                       ; +0xf0, 0x140224af0\nmov     rcx, rsi                                                       ; +0xf2, 0x140224af2\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0xf5, 0x140224af5\nmov     ecx, [rdi+0FC8h]                                               ; +0xfb, 0x140224afb\ninc     ebx                                                            ; +0x101, 0x140224b01\nmov     [rax+370h], ecx                                                ; +0x103, 0x140224b03\nmov     rcx, rsi                                                       ; +0x109, 0x140224b09\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x10c, 0x140224b0c\ncmp     ebx, eax                                                       ; +0x112, 0x140224b12\njb      short loc_140224AF0                                            ; +0x114, 0x140224b14\nmov     r8d, [rdi+0FC8h]                                               ; +0x116, 0x140224b16\nmov     rdx, rsi                                                       ; +0x11d, 0x140224b1d\nmov     rcx, [rdi+0FC0h]                                               ; +0x120, 0x140224b20\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,__int64) ; +0x127, 0x140224b27\nmov     rsi, rbp                                                       ; +0x12d, 0x140224b2d\ntest    rbp, rbp                                                       ; +0x130, 0x140224b30\njz      short loc_140224B3E                                            ; +0x133, 0x140224b33\nmov     rbp, [rbp+120h]                                                ; +0x135, 0x140224b35\njmp     short loc_140224AD0                                            ; +0x13c, 0x140224b3c\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x13e, 0x140224b3e\nmov     rbp, [rsp+28h+arg_8]                                           ; +0x143, 0x140224b43\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x148, 0x140224b48\nmov     rdi, [rsp+28h+arg_18]                                          ; +0x14d, 0x140224b4d\nadd     rsp, 20h                                                       ; +0x152, 0x140224b52\npop     r14                                                            ; +0x156, 0x140224b56\nretn                                                                   ; +0x158, 0x140224b58", "xrefs": ["GJBaseGameLayer::updateSpecialGroupData @ 0x14020e060", "LevelEditorLayer::init @ 0x1402d2dcf", "<???> @ 0x1406cd770"], "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"}