{"type": "func", "start": 5370492304, "end": 5370492568, "name": "EditorUI::toggleSnap", "pseudocode": "// \n// EditorUI::toggleSnap from 0x1401b3590 to 0x1401b3698 (264 bytes)\n// \n// 4 xrefs:\n// > EditorUI::init @ 0x1401ac320\n// > EditorUI::handleEditorAction @ 0x1401c2952\n// > EditorUI::init @ 0x1401aa652\n// > <???> @ 0x14091a030\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:27:56 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall EditorUI::toggleSnap(__int64 a1)\n{\n  __int64 v2; // rcx\n  unsigned __int8 v3; // bl\n  __int64 v4; // rcx\n  __int64 v5; // rax\n  const char *v6; // rdx\n  _QWORD *v7; // rbx\n  bool hasSoundsForAction; // al\n  void *v9; // [rsp+30h] [rbp+8h]\n  void *v10; // [rsp+30h] [rbp+8h]\n\n  v2 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v9 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v9);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v2 = qword_14090BFD0;\n  }\n  v3 = GameManager::getGameVariable(v2, \"0008\") ^ 1;\n  v4 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v10 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v10);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v4 = qword_14090BFD0;\n  }\n  GameManager::setGameVariable(v4, \"0008\", v3);\n  v5 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1024) + 952LL))(*(_QWORD *)(a1 + 1024));\n  v6 = \"GJ_button_01.png\";\n  if ( v3 )\n    v6 = \"GJ_button_02.png\";\n  ButtonSprite::updateBGImage(v5, v6);\n  v7 = (_QWORD *)EditorSFXManager::sharedState();\n  hasSoundsForAction = EditorSFXManager::hasSoundsForAction(v7, 190);\n  EditorSFXManager::playAction((__int64)v7, hasSoundsForAction + 189);\n}", "assembly": "; \n; EditorUI::toggleSnap from 0x1401b3590 to 0x1401b3698 (264 bytes)\n; \n; 4 xrefs:\n; > EditorUI::init @ 0x1401ac320\n; > EditorUI::handleEditorAction @ 0x1401c2952\n; > EditorUI::init @ 0x1401aa652\n; > <???> @ 0x14091a030\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:27:56 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1401b3590\npush    rdi                                                            ; +0x5, 0x1401b3595\nsub     rsp, 20h                                                       ; +0x6, 0x1401b3596\nmov     rdi, rcx                                                       ; +0xa, 0x1401b359a\nmov     rcx, cs:qword_14090BFD0                                        ; +0xd, 0x1401b359d\ntest    rcx, rcx                                                       ; +0x14, 0x1401b35a4\njnz     short loc_1401B35DB                                            ; +0x17, 0x1401b35a7\nmov     ecx, 6E8h; Size                                                ; +0x19, 0x1401b35a9\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1e, 0x1401b35ae\nmov     [rsp+28h+arg_0], rax                                           ; +0x23, 0x1401b35b3\nmov     rcx, rax                                                       ; +0x28, 0x1401b35b8\ncall    GameManager__GameManager                                       ; +0x2b, 0x1401b35bb\nnop                                                                    ; +0x30, 0x1401b35c0\nmov     cs:qword_14090BFD0, rax                                        ; +0x31, 0x1401b35c1\nmov     rcx, [rax]                                                     ; +0x38, 0x1401b35c8\nmov     rdx, [rcx+48h]                                                 ; +0x3b, 0x1401b35cb\nmov     rcx, rax                                                       ; +0x3f, 0x1401b35cf\ncall    rdx                                                            ; +0x42, 0x1401b35d2\nmov     rcx, cs:qword_14090BFD0                                        ; +0x44, 0x1401b35d4\nlea     rdx, a0008; \"0008\"                                             ; +0x4b, 0x1401b35db\ncall    GameManager__getGameVariable                                   ; +0x52, 0x1401b35e2\nmovzx   ebx, al                                                        ; +0x57, 0x1401b35e7\nxor     bl, 1                                                          ; +0x5a, 0x1401b35ea\nmov     rcx, cs:qword_14090BFD0                                        ; +0x5d, 0x1401b35ed\ntest    rcx, rcx                                                       ; +0x64, 0x1401b35f4\njnz     short loc_1401B362C                                            ; +0x67, 0x1401b35f7\nmov     ecx, 6E8h; Size                                                ; +0x69, 0x1401b35f9\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x6e, 0x1401b35fe\nmov     [rsp+28h+arg_0], rax                                           ; +0x73, 0x1401b3603\nmov     rcx, rax                                                       ; +0x78, 0x1401b3608\ncall    GameManager__GameManager                                       ; +0x7b, 0x1401b360b\nnop                                                                    ; +0x80, 0x1401b3610\nmov     cs:qword_14090BFD0, rax                                        ; +0x81, 0x1401b3611\nmov     rcx, [rax]                                                     ; +0x88, 0x1401b3618\nmov     r8, [rcx+48h]                                                  ; +0x8b, 0x1401b361b\nmov     rcx, rax                                                       ; +0x8f, 0x1401b361f\ncall    r8                                                             ; +0x92, 0x1401b3622\nmov     rcx, cs:qword_14090BFD0                                        ; +0x95, 0x1401b3625\nmovzx   r8d, bl                                                        ; +0x9c, 0x1401b362c\nlea     rdx, a0008; \"0008\"                                             ; +0xa0, 0x1401b3630\ncall    GameManager__setGameVariable                                   ; +0xa7, 0x1401b3637\nmov     rcx, [rdi+400h]                                                ; +0xac, 0x1401b363c\nmov     rax, [rcx]                                                     ; +0xb3, 0x1401b3643\ncall    qword ptr [rax+3B8h]                                           ; +0xb6, 0x1401b3646\nlea     rcx, aGjButton02Png; \"GJ_button_02.png\"                        ; +0xbc, 0x1401b364c\nlea     rdx, aGjButton01Png; \"GJ_button_01.png\"                        ; +0xc3, 0x1401b3653\ntest    bl, bl                                                         ; +0xca, 0x1401b365a\ncmovnz  rdx, rcx                                                       ; +0xcc, 0x1401b365c\nmov     rcx, rax                                                       ; +0xd0, 0x1401b3660\ncall    ButtonSprite__updateBGImage                                    ; +0xd3, 0x1401b3663\ncall    EditorSFXManager__sharedState                                  ; +0xd8, 0x1401b3668\nmov     rbx, rax                                                       ; +0xdd, 0x1401b366d\nmov     edx, 0BEh                                                      ; +0xe0, 0x1401b3670\nmov     rcx, rax                                                       ; +0xe5, 0x1401b3675\ncall    EditorSFXManager__hasSoundsForAction                           ; +0xe8, 0x1401b3678\nmovzx   edx, al                                                        ; +0xed, 0x1401b367d\nadd     edx, 0BDh                                                      ; +0xf0, 0x1401b3680\nmov     rcx, rbx                                                       ; +0xf6, 0x1401b3686\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xf9, 0x1401b3689\nadd     rsp, 20h                                                       ; +0xfe, 0x1401b368e\npop     rdi                                                            ; +0x102, 0x1401b3692\njmp     EditorSFXManager__playAction                                   ; +0x103, 0x1401b3693", "xrefs": ["EditorUI::init @ 0x1401ac320", "EditorUI::handleEditorAction @ 0x1401c2952", "EditorUI::init @ 0x1401aa652", "<???> @ 0x14091a030"], "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"}