{"type": "func", "start": 3814600, "end": 3814946, "name": "EditorUI::createNewKeyframeAnim", "pseudocode": "// \n// EditorUI::createNewKeyframeAnim from 0x3a34c8 to 0x3a3622 (346 bytes)\n// \n// 1 xrefs:\n// > SetGroupIDLayer::onAnim @ 0x508a82\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 EditorUI::createNewKeyframeAnim(EditorUI *a1)\n{\n  EditorUI *v1; // r4\n  cocos2d::CCArray *v2; // r0\n  cocos2d::CCObject *m_selectedObject; // r1\n  cocos2d::CCArray *v4; // r5\n  cocos2d::CCArray *v5; // r0\n  cocos2d::CCArray *v6; // r9\n  cocos2d::ccArray *data; // r3\n  cocos2d::CCObject **arr; // r7\n  int v9; // r5\n  int v10; // t1\n  cocos2d::CCObject *v11; // r0\n  cocos2d::CCObject_vtbl *v12; // r3\n  int v13; // r6\n  bool (__fastcall *isEqual)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // r3\n  unsigned int v15; // r12\n  bool (__fastcall *v16)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // r8\n  int v17; // r3\n  int v18; // t1\n  const cocos2d::CCPoint *v19; // r0\n  cocos2d::CCPoint v20; // r2\n  KeyframeGameObject *Object; // r6\n  cocos2d::CCArray *NewKeyframeAnim; // r0\n  int v23; // r0\n  cocos2d::CCObject **v24; // [sp+4h] [bp-20h]\n  int v25; // [sp+8h] [bp-1Ch]\n  unsigned int v26; // [sp+Ch] [bp-18h]\n  cocos2d::CCPoint v27; // [sp+14h] [bp-10h] BYREF\n\n  v1 = a1;\n  if ( a1->m_selectedObject || (a1 = (EditorUI *)cocos2d::CCArray::count(a1->m_selectedObjects)) != nullptr )\n  {\n    v2 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);\n    m_selectedObject = v1->m_selectedObject;\n    v4 = v2;\n    if ( m_selectedObject )\n      cocos2d::CCArray::addObject(v2, m_selectedObject);\n    else\n      cocos2d::CCArray::addObjectsFromArray(v2, v1->m_selectedObjects);\n    EditorUI::deselectAll(v1);\n    v5 = (cocos2d::CCArray *)((int (__fastcall *)(LevelEditorLayer *, _DWORD))v1->m_editorLayer->updateVisibility)(\n                               v1->m_editorLayer,\n                               0);\n    v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);\n    if ( v4 )\n    {\n      data = v4->data;\n      if ( data->num )\n      {\n        arr = data->arr;\n        v24 = &arr[data->num] + 0x3FFFFFFF;\n        while ( arr <= v24 )\n        {\n          v10 = (int)*arr++;\n          v9 = v10;\n          if ( !v10 )\n            break;\n          if ( *(_BYTE *)(v9 + 1014) )\n          {\n            v11 = cocos2d::CCDictionary::objectForKey(v1->m_editorLayer->m_parentGroupIDs, *(_DWORD *)(v9 + 772));\n            if ( v11 )\n            {\n              v12 = v11[1].__vftable;\n              if ( v12->copyWithZone )\n              {\n                v13 = (int)v12->copyWithZone + 0x40000000;\n                isEqual = v12->isEqual;\n                v15 = (unsigned int)isEqual + 4 * v13 - 4;\n                v16 = isEqual;\n                while ( (unsigned int)v16 <= v15 )\n                {\n                  v18 = *(_DWORD *)v16;\n                  v16 = (bool (__fastcall *)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *))((char *)v16 + 4);\n                  v17 = v18;\n                  if ( !v18 )\n                    break;\n                  v26 = v15;\n                  v25 = *(_DWORD *)(v17 + 52);\n                  v19 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(int))(*(_DWORD *)v9 + 96))(v9);\n                  cocos2d::CCPoint::CCPoint(&v27, v19);\n                  LODWORD(v20.x) = &v27;\n                  Object = (KeyframeGameObject *)EditorUI::createObject(v1, 3032, v20);\n                  LevelEditorLayer::removeSpecial(v1->m_editorLayer, Object);\n                  cocos2d::CCArray::addObject(v6, Object);\n                  EffectGameObject::setTargetID(Object, v25);\n                  KeyframeGameObject::updateShadowObjects(Object, v1->m_editorLayer, v1);\n                  NewKeyframeAnim = GJBaseGameLayer::createNewKeyframeAnim(v1->m_editorLayer);\n                  v23 = NewKeyframeAnim->getTag(NewKeyframeAnim);\n                  Object->m_keyframeIndex = 0;\n                  Object->m_keyframeGroup = v23;\n                  LevelEditorLayer::addSpecial(v1->m_editorLayer, Object);\n                  v15 = v26;\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n    EditorUI::selectObjects(v1, v6, 0);\n  }\n}", "assembly": "; \n; EditorUI::createNewKeyframeAnim from 0x3a34c8 to 0x3a3622 (346 bytes)\n; \n; 1 xrefs:\n; > SetGroupIDLayer::onAnim @ 0x508a82\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\nLDR             R2, =(__stack_chk_guard_ptr - 0x3A34D2)                ; +0x0, 0x3a34c8\nPUSH.W          {R4-R11,LR}                                            ; +0x2, 0x3a34ca\nADD             R2, PC; __stack_chk_guard_ptr                          ; +0x6, 0x3a34ce\nLDR             R2, [R2]; __stack_chk_guard                            ; +0x8, 0x3a34d0\nSUB             SP, SP, #0x24                                          ; +0xa, 0x3a34d2\nMOV             R4, R0                                                 ; +0xc, 0x3a34d4\nLDR             R3, [R2]                                               ; +0xe, 0x3a34d6\nMOV             R11, R2                                                ; +0x10, 0x3a34d8\nSTR             R3, [SP,#0x24+var_8]                                   ; +0x12, 0x3a34da\nLDR.W           R3, [R0,#0x374]                                        ; +0x14, 0x3a34dc\nCBNZ            R3, loc_3A34F0                                         ; +0x18, 0x3a34e0\nLDR.W           R0, [R0,#0x260]; this                                  ; +0x1a, 0x3a34e2\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x1e, 0x3a34e6\nCMP             R0, #0                                                 ; +0x22, 0x3a34ea\nBEQ.W           loc_3A360E                                             ; +0x24, 0x3a34ec\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x28, 0x3a34f0\nLDR.W           R1, [R4,#0x374]; cocos2d::CCObject *                   ; +0x2c, 0x3a34f4\nMOV             R5, R0                                                 ; +0x30, 0x3a34f8\nCBZ             R1, loc_3A3502                                         ; +0x32, 0x3a34fa\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x34, 0x3a34fc\nB               loc_3A350A                                             ; +0x38, 0x3a3500\nLDR.W           R1, [R4,#0x260]; cocos2d::CCArray *                    ; +0x3a, 0x3a3502\nBL              _ZN7cocos2d7CCArray19addObjectsFromArrayEPS0_; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray*) ; +0x3e, 0x3a3506\nMOV             R0, R4; this                                           ; +0x42, 0x3a350a\nBL              _ZN8EditorUI11deselectAllEv; EditorUI::deselectAll(void) ; +0x44, 0x3a350c\nLDR.W           R0, [R4,#0x340]                                        ; +0x48, 0x3a3510\nMOVS            R1, #0                                                 ; +0x4c, 0x3a3514\nLDR             R3, [R0]                                               ; +0x4e, 0x3a3516\nLDR.W           R3, [R3,#0x24C]                                        ; +0x50, 0x3a3518\nBLX             R3                                                     ; +0x54, 0x3a351c\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x56, 0x3a351e\nMOV             R9, R0                                                 ; +0x5a, 0x3a3522\nCBNZ            R5, loc_3A3532                                         ; +0x5c, 0x3a3524\nMOV             R0, R4; this                                           ; +0x5e, 0x3a3526\nMOV             R1, R9; cocos2d::CCArray *                             ; +0x60, 0x3a3528\nMOVS            R2, #0; bool                                           ; +0x62, 0x3a352a\nBL              _ZN8EditorUI13selectObjectsEPN7cocos2d7CCArrayEb; EditorUI::selectObjects(cocos2d::CCArray *,bool) ; +0x64, 0x3a352c\nB               loc_3A360E                                             ; +0x68, 0x3a3530\nLDR             R3, [R5,#0x34]                                         ; +0x6a, 0x3a3532\nLDR             R6, [R3]                                               ; +0x6c, 0x3a3534\nCMP             R6, #0                                                 ; +0x6e, 0x3a3536\nBEQ             loc_3A3526                                             ; +0x70, 0x3a3538\nADD.W           R5, R6, #0x40000000                                    ; +0x72, 0x3a353a\nLDR             R7, [R3,#0xC]                                          ; +0x76, 0x3a353e\nSUBS            R5, #1                                                 ; +0x78, 0x3a3540\nADD.W           R10, SP, #0x24+var_10                                  ; +0x7a, 0x3a3542\nADD.W           R3, R7, R5,LSL#2                                       ; +0x7e, 0x3a3546\nSTR             R3, [SP,#0x24+var_20]                                  ; +0x82, 0x3a354a\nLDR             R3, [SP,#0x24+var_20]                                  ; +0x84, 0x3a354c\nCMP             R7, R3                                                 ; +0x86, 0x3a354e\nBHI             loc_3A3526                                             ; +0x88, 0x3a3550\nLDR.W           R5, [R7],#4                                            ; +0x8a, 0x3a3552\nCMP             R5, #0                                                 ; +0x8e, 0x3a3556\nBEQ             loc_3A3526                                             ; +0x90, 0x3a3558\nLDRB.W          R3, [R5,#0x3F6]                                        ; +0x92, 0x3a355a\nCMP             R3, #0                                                 ; +0x96, 0x3a355e\nBEQ             loc_3A354C                                             ; +0x98, 0x3a3560\nLDR.W           R3, [R4,#0x340]                                        ; +0x9a, 0x3a3562\nLDR.W           R1, [R5,#0x304]; int                                   ; +0x9e, 0x3a3566\nLDR.W           R0, [R3,#0x9B4]; this                                  ; +0xa2, 0x3a356a\nBL              _ZN7cocos2d12CCDictionary12objectForKeyEi; cocos2d::CCDictionary::objectForKey(int) ; +0xa6, 0x3a356e\nCMP             R0, #0                                                 ; +0xaa, 0x3a3572\nBEQ             loc_3A354C                                             ; +0xac, 0x3a3574\nLDR             R3, [R0,#0x34]                                         ; +0xae, 0x3a3576\nLDR             R6, [R3]                                               ; +0xb0, 0x3a3578\nCMP             R6, #0                                                 ; +0xb2, 0x3a357a\nBEQ             loc_3A354C                                             ; +0xb4, 0x3a357c\nADD.W           R6, R6, #0x40000000                                    ; +0xb6, 0x3a357e\nLDR             R3, [R3,#0xC]                                          ; +0xba, 0x3a3582\nSUBS            R6, #1                                                 ; +0xbc, 0x3a3584\nADD.W           R12, R3, R6,LSL#2                                      ; +0xbe, 0x3a3586\nMOV             R8, R3                                                 ; +0xc2, 0x3a358a\nCMP             R8, R12                                                ; +0xc4, 0x3a358c\nBHI             loc_3A354C                                             ; +0xc6, 0x3a358e\nLDR.W           R3, [R8],#4                                            ; +0xc8, 0x3a3590\nCMP             R3, #0                                                 ; +0xcc, 0x3a3594\nBEQ             loc_3A354C                                             ; +0xce, 0x3a3596\nLDR             R3, [R3,#0x34]                                         ; +0xd0, 0x3a3598\nMOV             R0, R5                                                 ; +0xd2, 0x3a359a\nLDR             R2, [R5]                                               ; +0xd4, 0x3a359c\nSTR.W           R12, [SP,#0x24+var_18]                                 ; +0xd6, 0x3a359e\nSTR             R3, [SP,#0x24+var_1C]                                  ; +0xda, 0x3a35a2\nLDR             R2, [R2,#0x60]                                         ; +0xdc, 0x3a35a4\nBLX             R2                                                     ; +0xde, 0x3a35a6\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0xe0, 0x3a35a8\nMOV             R0, R10; this                                          ; +0xe2, 0x3a35aa\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xe4, 0x3a35ac\nMOV             R2, R10                                                ; +0xe8, 0x3a35b0\nMOVW            R1, #0xBD8                                             ; +0xea, 0x3a35b2\nMOV             R0, R4                                                 ; +0xee, 0x3a35b6\nBL              _ZN8EditorUI12createObjectEiN7cocos2d7CCPointE; EditorUI::createObject(int,cocos2d::CCPoint) ; +0xf0, 0x3a35b8\nMOV             R6, R0                                                 ; +0xf4, 0x3a35bc\nLDR.W           R0, [R4,#0x340]; this                                  ; +0xf6, 0x3a35be\nMOV             R1, R6; GameObject *                                   ; +0xfa, 0x3a35c2\nBL              _ZN16LevelEditorLayer13removeSpecialEP10GameObject; LevelEditorLayer::removeSpecial(GameObject *) ; +0xfc, 0x3a35c4\nMOV             R0, R9; this                                           ; +0x100, 0x3a35c8\nMOV             R1, R6; cocos2d::CCObject *                            ; +0x102, 0x3a35ca\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x104, 0x3a35cc\nLDR             R3, [SP,#0x24+var_1C]                                  ; +0x108, 0x3a35d0\nMOV             R0, R6; this                                           ; +0x10a, 0x3a35d2\nMOV             R1, R3; int                                            ; +0x10c, 0x3a35d4\nBL              _ZN16EffectGameObject11setTargetIDEi; EffectGameObject::setTargetID(int) ; +0x10e, 0x3a35d6\nLDR.W           R1, [R4,#0x340]; GJBaseGameLayer *                     ; +0x112, 0x3a35da\nMOV             R2, R4; EditorUI *                                     ; +0x116, 0x3a35de\nMOV             R0, R6; this                                           ; +0x118, 0x3a35e0\nBL              _ZN18KeyframeGameObject19updateShadowObjectsEP15GJBaseGameLayerP8EditorUI; KeyframeGameObject::updateShadowObjects(GJBaseGameLayer *,EditorUI *) ; +0x11a, 0x3a35e2\nLDR.W           R0, [R4,#0x340]; this                                  ; +0x11e, 0x3a35e6\nBL              _ZN15GJBaseGameLayer21createNewKeyframeAnimEv; GJBaseGameLayer::createNewKeyframeAnim(void) ; +0x122, 0x3a35ea\nLDR             R3, [R0]                                               ; +0x126, 0x3a35ee\nLDR             R3, [R3,#0x20]                                         ; +0x128, 0x3a35f0\nBLX             R3                                                     ; +0x12a, 0x3a35f2\nMOVS            R3, #0                                                 ; +0x12c, 0x3a35f4\nMOV             R1, R6; GameObject *                                   ; +0x12e, 0x3a35f6\nSTR.W           R3, [R6,#0x670]                                        ; +0x130, 0x3a35f8\nSTR.W           R0, [R6,#0x66C]                                        ; +0x134, 0x3a35fc\nLDR.W           R0, [R4,#0x340]; this                                  ; +0x138, 0x3a3600\nBL              _ZN16LevelEditorLayer10addSpecialEP10GameObject; LevelEditorLayer::addSpecial(GameObject *) ; +0x13c, 0x3a3604\nLDR.W           R12, [SP,#0x24+var_18]                                 ; +0x140, 0x3a3608\nB               loc_3A358C                                             ; +0x144, 0x3a360c\nLDR             R2, [SP,#0x24+var_8]                                   ; +0x146, 0x3a360e\nLDR.W           R3, [R11]                                              ; +0x148, 0x3a3610\nCMP             R2, R3                                                 ; +0x14c, 0x3a3614\nBEQ             loc_3A361C                                             ; +0x14e, 0x3a3616\nBLX             __stack_chk_fail                                       ; +0x150, 0x3a3618\nADD             SP, SP, #0x24 ; '$'                                    ; +0x154, 0x3a361c\nPOP.W           {R4-R11,PC}                                            ; +0x156, 0x3a361e", "xrefs": ["SetGroupIDLayer::onAnim @ 0x508a82"], "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"}