{"type": "func", "start": 5372850208, "end": 5372850333, "name": "LevelEditorLayer::undoLastAction", "pseudocode": "// \n// LevelEditorLayer::undoLastAction from 0x1403f3020 to 0x1403f309d (125 bytes)\n// \n// 4 xrefs:\n// > EditorUI::undoLastAction @ 0x1401b3be2\n// > EditorUI::handleEditorAction @ 0x1401c2313\n// > LevelEditorLayer::handleAction @ 0x1403f2f54\n// > <???> @ 0x140925448\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:31:48 +0000\n// \n\nvoid __fastcall LevelEditorLayer::undoLastAction(__int64 a1)\n{\n  __int64 v2; // rax\n  int v3; // ecx\n  int v4; // eax\n  int v5; // ecx\n\n  v2 = cocos2d::CCDirector::sharedDirector(a1);\n  if ( !*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 176LL))(v2) + 157) )\n  {\n    ++*(_DWORD *)(a1 + 15428);\n    v3 = *(_DWORD *)(a1 + 15504);\n    if ( v3 >= 0 )\n    {\n      v4 = *(_DWORD *)(a1 + 15440) - v3;\n      v5 = 0;\n      if ( v4 > 1 )\n      {\n        do\n        {\n          if ( v5 >= 7 )\n            break;\n          v4 = (unsigned int)v4 >> 1;\n          ++v5;\n        }\n        while ( (unsigned int)v4 > 1 );\n      }\n      ++*(_DWORD *)(a1 + 4LL * v5 + 15472);\n    }\n    *(_DWORD *)(a1 + 15504) = *(_DWORD *)(a1 + 15440);\n  }\n  LevelEditorLayer::handleAction(a1, 1, *(cocos2d::CCArray **)(a1 + 14912));\n}", "assembly": "; \n; LevelEditorLayer::undoLastAction from 0x1403f3020 to 0x1403f309d (125 bytes)\n; \n; 4 xrefs:\n; > EditorUI::undoLastAction @ 0x1401b3be2\n; > EditorUI::handleEditorAction @ 0x1401c2313\n; > LevelEditorLayer::handleAction @ 0x1403f2f54\n; > <???> @ 0x140925448\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:31:48 +0000\n; \npush    rbx                                                            ; +0x0, 0x1403f3020\nsub     rsp, 20h                                                       ; +0x2, 0x1403f3022\nmov     rbx, rcx                                                       ; +0x6, 0x1403f3026\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x9, 0x1403f3029\nmov     rcx, rax                                                       ; +0xf, 0x1403f302f\nmov     rdx, [rax]                                                     ; +0x12, 0x1403f3032\ncall    qword ptr [rdx+0B0h]                                           ; +0x15, 0x1403f3035\ncmp     byte ptr [rax+9Dh], 0                                          ; +0x1b, 0x1403f303b\njnz     short loc_1403F3087                                            ; +0x22, 0x1403f3042\ninc     dword ptr [rbx+3C44h]                                          ; +0x24, 0x1403f3044\nmov     ecx, [rbx+3C90h]                                               ; +0x2a, 0x1403f304a\ntest    ecx, ecx                                                       ; +0x30, 0x1403f3050\njs      short loc_1403F307B                                            ; +0x32, 0x1403f3052\nmov     eax, [rbx+3C50h]                                               ; +0x34, 0x1403f3054\nsub     eax, ecx                                                       ; +0x3a, 0x1403f305a\nxor     ecx, ecx                                                       ; +0x3c, 0x1403f305c\ncmp     eax, 1                                                         ; +0x3e, 0x1403f305e\njle     short loc_1403F3071                                            ; +0x41, 0x1403f3061\ncmp     ecx, 7                                                         ; +0x43, 0x1403f3063\njge     short loc_1403F3071                                            ; +0x46, 0x1403f3066\nshr     eax, 1                                                         ; +0x48, 0x1403f3068\ninc     ecx                                                            ; +0x4a, 0x1403f306a\ncmp     eax, 1                                                         ; +0x4c, 0x1403f306c\nja      short loc_1403F3063                                            ; +0x4f, 0x1403f306f\nmovsxd  rax, ecx                                                       ; +0x51, 0x1403f3071\ninc     dword ptr [rbx+rax*4+3C70h]                                    ; +0x54, 0x1403f3074\nmov     eax, [rbx+3C50h]                                               ; +0x5b, 0x1403f307b\nmov     [rbx+3C90h], eax                                               ; +0x61, 0x1403f3081\nmov     r8, [rbx+3A40h]                                                ; +0x67, 0x1403f3087\nmov     dl, 1                                                          ; +0x6e, 0x1403f308e\nmov     rcx, rbx                                                       ; +0x70, 0x1403f3090\nadd     rsp, 20h                                                       ; +0x73, 0x1403f3093\npop     rbx                                                            ; +0x77, 0x1403f3097\njmp     LevelEditorLayer__handleAction                                 ; +0x78, 0x1403f3098", "xrefs": ["EditorUI::undoLastAction @ 0x1401b3be2", "EditorUI::handleEditorAction @ 0x1401c2313", "LevelEditorLayer::handleAction @ 0x1403f2f54", "<???> @ 0x140925448"], "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"}