{"type": "func", "start": 5369823488, "end": 5369823708, "name": "EditorUI::toggleSnap", "pseudocode": "// \n// EditorUI::toggleSnap from 0x140110100 to 0x1401101dc (220 bytes)\n// \n// 4 xrefs:\n// > EditorUI::init @ 0x1400e1852\n// > EditorUI::keyDown @ 0x140125c12\n// > EditorUI::init @ 0x1400dff55\n// > <???> @ 0x1406c8e98\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\n// Hidden C++ exception states: #wind=2\nvoid EditorUI::toggleSnap(EditorUI *a1, cocos2d::CCObject *a2)\n{\n  GameManager *v3; // rcx\n  bool v4; // bl\n  GameManager *v5; // rcx\n  ButtonSprite *v6; // rax\n  const char *v7; // rdx\n  void *v8; // [rsp+30h] [rbp+8h]\n  void *v9; // [rsp+30h] [rbp+8h]\n\n  v3 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v8 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00(v8);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v3 = (GameManager *)qword_1406C2ED8;\n  }\n  v4 = !GameManager::getGameVariable(v3, \"0008\");\n  v5 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v9 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00(v9);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v5 = (GameManager *)qword_1406C2ED8;\n  }\n  GameManager::setGameVariable(v5, \"0008\", v4);\n  v6 = (ButtonSprite *)a1->m_snapBtn->getNormalImage(a1->m_snapBtn);\n  v7 = \"GJ_button_01.png\";\n  if ( v4 )\n    v7 = \"GJ_button_02.png\";\n  ButtonSprite::updateBGImage(v6, v7);\n}", "assembly": "; \n; EditorUI::toggleSnap from 0x140110100 to 0x1401101dc (220 bytes)\n; \n; 4 xrefs:\n; > EditorUI::init @ 0x1400e1852\n; > EditorUI::keyDown @ 0x140125c12\n; > EditorUI::init @ 0x1400dff55\n; > <???> @ 0x1406c8e98\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_8], rbx                                               ; +0x0, 0x140110100\npush    rdi                                                            ; +0x5, 0x140110105\nsub     rsp, 20h                                                       ; +0x6, 0x140110106\nmov     rdi, rcx                                                       ; +0xa, 0x14011010a\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xd, 0x14011010d\ntest    rcx, rcx                                                       ; +0x14, 0x140110114\njnz     short loc_140110148                                            ; +0x17, 0x140110117\nmov     ecx, 668h; Size                                                ; +0x19, 0x140110119\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1e, 0x14011011e\nmov     [rsp+28h+arg_0], rax                                           ; +0x23, 0x140110123\nmov     rcx, rax                                                       ; +0x28, 0x140110128\ncall    sub_14017AB00                                                  ; +0x2b, 0x14011012b\nnop                                                                    ; +0x30, 0x140110130\nmov     cs:qword_1406C2ED8, rax                                        ; +0x31, 0x140110131\nmov     rdx, [rax]                                                     ; +0x38, 0x140110138\nmov     rcx, rax                                                       ; +0x3b, 0x14011013b\ncall    qword ptr [rdx+48h]                                            ; +0x3e, 0x14011013e\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x41, 0x140110141\nlea     rdx, a0008; \"0008\"                                             ; +0x48, 0x140110148\ncall    GameManager__getGameVariable                                   ; +0x4f, 0x14011014f\nmovzx   ebx, al                                                        ; +0x54, 0x140110154\nxor     bl, 1                                                          ; +0x57, 0x140110157\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x5a, 0x14011015a\ntest    rcx, rcx                                                       ; +0x61, 0x140110161\njnz     short loc_140110196                                            ; +0x64, 0x140110164\nmov     ecx, 668h; Size                                                ; +0x66, 0x140110166\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x6b, 0x14011016b\nmov     [rsp+28h+arg_0], rax                                           ; +0x70, 0x140110170\nmov     rcx, rax                                                       ; +0x75, 0x140110175\ncall    sub_14017AB00                                                  ; +0x78, 0x140110178\nnop                                                                    ; +0x7d, 0x14011017d\nmov     cs:qword_1406C2ED8, rax                                        ; +0x7e, 0x14011017e\nmov     r8, [rax]                                                      ; +0x85, 0x140110185\nmov     rcx, rax                                                       ; +0x88, 0x140110188\ncall    qword ptr [r8+48h]                                             ; +0x8b, 0x14011018b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x8f, 0x14011018f\nmovzx   r8d, bl                                                        ; +0x96, 0x140110196\nlea     rdx, a0008; \"0008\"                                             ; +0x9a, 0x14011019a\ncall    GameManager__setGameVariable                                   ; +0xa1, 0x1401101a1\nmov     rcx, [rdi+388h]                                                ; +0xa6, 0x1401101a6\nmov     rax, [rcx]                                                     ; +0xad, 0x1401101ad\ncall    qword ptr [rax+3A8h]                                           ; +0xb0, 0x1401101b0\nlea     rcx, aGjButton02Png; \"GJ_button_02.png\"                        ; +0xb6, 0x1401101b6\nlea     rdx, aGjButton01Png; \"GJ_button_01.png\"                        ; +0xbd, 0x1401101bd\ntest    bl, bl                                                         ; +0xc4, 0x1401101c4\ncmovnz  rdx, rcx                                                       ; +0xc6, 0x1401101c6\nmov     rcx, rax                                                       ; +0xca, 0x1401101ca\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xcd, 0x1401101cd\nadd     rsp, 20h                                                       ; +0xd2, 0x1401101d2\npop     rdi                                                            ; +0xd6, 0x1401101d6\njmp     ButtonSprite__updateBGImage                                    ; +0xd7, 0x1401101d7", "xrefs": ["EditorUI::init @ 0x1400e1852", "EditorUI::keyDown @ 0x140125c12", "EditorUI::init @ 0x1400dff55", "<???> @ 0x1406c8e98"], "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"}