{"type": "func", "start": 5369898592, "end": 5369899094, "name": "EditorUI::applySpecialOffset", "pseudocode": "// \n// EditorUI::applySpecialOffset from 0x140122660 to 0x140122856 (502 bytes)\n// \n// 7 xrefs:\n// > EditorUI::findSnapObject_1 @ 0x14012345a\n// > EditorUI::findSnapObject_1 @ 0x14012364c\n// > EditorUI::ccTouchEnded @ 0x1401249d3\n// > <???> @ 0x1406703e8\n// > <???> @ 0x140670424\n// > <???> @ 0x140670434\n// > <???> @ 0x1406c9804\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\ncocos2d::CCPoint EditorUI::applySpecialOffset(EditorUI *a1, cocos2d::CCPoint a2, GameObject *a3, cocos2d::CCPoint a4)\n{\n  __int64 v8; // r9\n  float *v9; // rax\n  float *v10; // rbx\n  float m_gridSize; // xmm8_4\n  float v12; // xmm7_4\n  float v13; // xmm0_4\n  const struct cocos2d::CCPoint *v14; // rbx\n  float v15; // xmm3_4\n  float v16; // xmm3_4\n  cocos2d::CCPoint v18; // [rsp+20h] [rbp-58h] BYREF\n  cocos2d::CCPoint v19; // [rsp+28h] [rbp-50h] BYREF\n  float v20; // [rsp+88h] [rbp+10h] BYREF\n  float v21; // [rsp+8Ch] [rbp+14h]\n  cocos2d::CCPoint v22; // [rsp+98h] [rbp+20h] BYREF\n  const struct cocos2d::CCPoint *v23; // [rsp+A0h] [rbp+28h]\n\n  if ( EditorUI::isSpecialSnapObject(a1, *(_DWORD *)(*(_QWORD *)&a4 + 1036LL)) )\n  {\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 200LL))(v8);\n    cocos2d::CCPoint::CCPoint(&v18);\n    v10 = v9;\n    m_gridSize = a1->m_editorLayer->m_drawGridLayer->m_gridSize;\n    v12 = floorf(*v9 / m_gridSize);\n    v13 = (float)(floorf(v10[1] / m_gridSize) + 0.5) * m_gridSize;\n    cocos2d::CCPoint::CCPoint(&v19, (float)(v12 + 0.5) * m_gridSize, v13);\n    EditorUI::getLimitedPosition(a1, (cocos2d::CCPoint)&v20);\n    v14 = v23;\n    if ( !cocos2d::CCPoint::equals(v23) )\n      cocos2d::CCPoint::operator=(&v20, v14);\n    (*(void (__fastcall **)(cocos2d::CCPoint))(**(_QWORD **)&a4 + 200LL))(a4);\n    cocos2d::CCPoint::CCPoint(&v22);\n    v15 = fabs(*(float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);\n    if ( v15 > 0.0 )\n    {\n      if ( fabs((float)(v22.x + v15) - v20) < fabs((float)(v22.x - v15) - v20) )\n        v15 = -v15;\n      *(float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = v15;\n    }\n    v16 = fabs(*((float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable\n               + 1));\n    if ( v16 > 0.0 )\n    {\n      if ( fabs((float)(v22.y + v16) - v21) < fabs((float)(v22.y - v16) - v21) )\n        v16 = -v16;\n      *((float *)&a3->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable\n      + 1) = v16;\n    }\n  }\n  cocos2d::CCPoint::CCPoint(*(cocos2d::CCPoint **)&a2);\n  return a2;\n}", "assembly": "; \n; EditorUI::applySpecialOffset from 0x140122660 to 0x140122856 (502 bytes)\n; \n; 7 xrefs:\n; > EditorUI::findSnapObject_1 @ 0x14012345a\n; > EditorUI::findSnapObject_1 @ 0x14012364c\n; > EditorUI::ccTouchEnded @ 0x1401249d3\n; > <???> @ 0x1406703e8\n; > <???> @ 0x140670424\n; > <???> @ 0x140670434\n; > <???> @ 0x1406c9804\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_10], rbp                                              ; +0x0, 0x140122660\npush    rsi                                                            ; +0x5, 0x140122665\npush    rdi                                                            ; +0x6, 0x140122666\npush    r14                                                            ; +0x7, 0x140122667\nsub     rsp, 60h                                                       ; +0x9, 0x140122669\nmov     rbp, rdx                                                       ; +0xd, 0x14012266d\nmov     rsi, r9                                                        ; +0x10, 0x140122670\nmov     edx, [r9+40Ch]                                                 ; +0x13, 0x140122673\nmov     rdi, r8                                                        ; +0x1a, 0x14012267a\nmov     r14, rcx                                                       ; +0x1d, 0x14012267d\ncall    EditorUI__isSpecialSnapObject                                  ; +0x20, 0x140122680\ntest    al, al                                                         ; +0x25, 0x140122685\njz      loc_140122836                                                  ; +0x27, 0x140122687\nmov     rax, [r9]                                                      ; +0x2d, 0x14012268d\nmov     rcx, r9                                                        ; +0x30, 0x140122690\nmov     [rsp+78h+arg_0], rbx                                           ; +0x33, 0x140122693\nmovaps  [rsp+78h+var_28], xmm6                                         ; +0x3b, 0x14012269b\nmovaps  [rsp+78h+var_38], xmm7                                         ; +0x40, 0x1401226a0\nmovaps  [rsp+78h+var_48], xmm8                                         ; +0x45, 0x1401226a5\ncall    qword ptr [rax+0C8h]                                           ; +0x4b, 0x1401226ab\nmov     rdx, rax                                                       ; +0x51, 0x1401226b1\nlea     rcx, [rsp+78h+var_58]                                          ; +0x54, 0x1401226b4\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x59, 0x1401226b9\nmov     rcx, [r14+500h]                                                ; +0x5f, 0x1401226bf\nmov     rbx, rax                                                       ; +0x66, 0x1401226c6\nmovss   xmm0, dword ptr [rax]                                          ; +0x69, 0x1401226c9\nmov     rdx, [rcx+38C8h]                                               ; +0x6d, 0x1401226cd\nmovss   xmm8, dword ptr [rdx+27Ch]                                     ; +0x74, 0x1401226d4\ndivss   xmm0, xmm8; X                                                  ; +0x7d, 0x1401226dd\ncall    floorf                                                         ; +0x82, 0x1401226e2\nmovaps  xmm7, xmm0                                                     ; +0x87, 0x1401226e7\nmovss   xmm0, dword ptr [rbx+4]                                        ; +0x8a, 0x1401226ea\naddss   xmm7, cs:dword_140622B08                                       ; +0x8f, 0x1401226ef\ndivss   xmm0, xmm8; X                                                  ; +0x97, 0x1401226f7\nmulss   xmm7, xmm8                                                     ; +0x9c, 0x1401226fc\ncall    floorf                                                         ; +0xa1, 0x140122701\naddss   xmm0, cs:dword_140622B08                                       ; +0xa6, 0x140122706\nmovaps  xmm1, xmm7                                                     ; +0xae, 0x14012270e\nlea     rcx, [rsp+78h+var_50]                                          ; +0xb1, 0x140122711\nmulss   xmm0, xmm8                                                     ; +0xb6, 0x140122716\nmovaps  xmm2, xmm0                                                     ; +0xbb, 0x14012271b\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0xbe, 0x14012271e\nlea     rdx, [rsp+78h+arg_8]                                           ; +0xc4, 0x140122724\nmov     rcx, r14                                                       ; +0xcc, 0x14012272c\nmov     r8, rax                                                        ; +0xcf, 0x14012272f\ncall    EditorUI__getLimitedPosition                                   ; +0xd2, 0x140122732\nmov     rbx, [rsp+78h+arg_20]                                          ; +0xd7, 0x140122737\nlea     rdx, dword_1406C1AA8                                           ; +0xdf, 0x14012273f\nmov     rcx, rbx                                                       ; +0xe6, 0x140122746\ncall    cs:?equals@CCPoint@cocos2d@@QEBA_NAEBV12@@Z; cocos2d::CCPoint::equals(cocos2d::CCPoint const &) ; +0xe9, 0x140122749\nmovaps  xmm8, [rsp+78h+var_48]                                         ; +0xef, 0x14012274f\nmovaps  xmm7, [rsp+78h+var_38]                                         ; +0xf5, 0x140122755\ntest    al, al                                                         ; +0xfa, 0x14012275a\njnz     short loc_14012276F                                            ; +0xfc, 0x14012275c\nmov     rdx, rbx                                                       ; +0xfe, 0x14012275e\nlea     rcx, [rsp+78h+arg_8]                                           ; +0x101, 0x140122761\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x109, 0x140122769\nmov     rax, [rsi]                                                     ; +0x10f, 0x14012276f\nmov     rcx, rsi                                                       ; +0x112, 0x140122772\ncall    qword ptr [rax+0C8h]                                           ; +0x115, 0x140122775\nmov     rdx, rax                                                       ; +0x11b, 0x14012277b\nlea     rcx, [rsp+78h+arg_18]                                          ; +0x11e, 0x14012277e\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x126, 0x140122786\nmovss   xmm3, dword ptr [rdi]                                          ; +0x12c, 0x14012278c\nxorps   xmm6, xmm6                                                     ; +0x130, 0x140122790\nmovss   xmm4, dword ptr cs:xmmword_1406243C0                           ; +0x133, 0x140122793\nmovss   xmm5, dword ptr cs:xmmword_1406243F0                           ; +0x13b, 0x14012279b\nandps   xmm3, xmm4                                                     ; +0x143, 0x1401227a3\ncomiss  xmm3, xmm6                                                     ; +0x146, 0x1401227a6\nmov     rbx, [rsp+78h+arg_0]                                           ; +0x149, 0x1401227a9\njbe     short loc_1401227EB                                            ; +0x151, 0x1401227b1\nmovss   xmm2, [rsp+78h+arg_18]                                         ; +0x153, 0x1401227b3\nmovaps  xmm1, xmm2                                                     ; +0x15c, 0x1401227bc\nsubss   xmm2, xmm3                                                     ; +0x15f, 0x1401227bf\naddss   xmm1, xmm3                                                     ; +0x163, 0x1401227c3\nsubss   xmm2, [rsp+78h+arg_8]                                          ; +0x167, 0x1401227c7\nsubss   xmm1, [rsp+78h+arg_8]                                          ; +0x170, 0x1401227d0\nandps   xmm2, xmm4                                                     ; +0x179, 0x1401227d9\nandps   xmm1, xmm4                                                     ; +0x17c, 0x1401227dc\ncomiss  xmm1, xmm2                                                     ; +0x17f, 0x1401227df\njnb     short loc_1401227E7                                            ; +0x182, 0x1401227e2\nxorps   xmm3, xmm5                                                     ; +0x184, 0x1401227e4\nmovss   dword ptr [rdi], xmm3                                          ; +0x187, 0x1401227e7\nmovss   xmm3, dword ptr [rdi+4]                                        ; +0x18b, 0x1401227eb\nandps   xmm3, xmm4                                                     ; +0x190, 0x1401227f0\ncomiss  xmm3, xmm6                                                     ; +0x193, 0x1401227f3\nmovaps  xmm6, [rsp+78h+var_28]                                         ; +0x196, 0x1401227f6\njbe     short loc_140122836                                            ; +0x19b, 0x1401227fb\nmovss   xmm2, [rsp+78h+arg_1C]                                         ; +0x19d, 0x1401227fd\nmovaps  xmm1, xmm2                                                     ; +0x1a6, 0x140122806\nsubss   xmm2, xmm3                                                     ; +0x1a9, 0x140122809\naddss   xmm1, xmm3                                                     ; +0x1ad, 0x14012280d\nsubss   xmm2, [rsp+78h+arg_C]                                          ; +0x1b1, 0x140122811\nsubss   xmm1, [rsp+78h+arg_C]                                          ; +0x1ba, 0x14012281a\nandps   xmm2, xmm4                                                     ; +0x1c3, 0x140122823\nandps   xmm1, xmm4                                                     ; +0x1c6, 0x140122826\ncomiss  xmm1, xmm2                                                     ; +0x1c9, 0x140122829\njnb     short loc_140122831                                            ; +0x1cc, 0x14012282c\nxorps   xmm3, xmm5                                                     ; +0x1ce, 0x14012282e\nmovss   dword ptr [rdi+4], xmm3                                        ; +0x1d1, 0x140122831\nmov     rdx, rdi                                                       ; +0x1d6, 0x140122836\nmov     rcx, rbp                                                       ; +0x1d9, 0x140122839\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x1dc, 0x14012283c\nmov     rax, rbp                                                       ; +0x1e2, 0x140122842\nmov     rbp, [rsp+78h+arg_10]                                          ; +0x1e5, 0x140122845\nadd     rsp, 60h                                                       ; +0x1ed, 0x14012284d\npop     r14                                                            ; +0x1f1, 0x140122851\npop     rdi                                                            ; +0x1f3, 0x140122853\npop     rsi                                                            ; +0x1f4, 0x140122854\nretn                                                                   ; +0x1f5, 0x140122855", "xrefs": ["EditorUI::findSnapObject_1 @ 0x14012345a", "EditorUI::findSnapObject_1 @ 0x14012364c", "EditorUI::ccTouchEnded @ 0x1401249d3", "<???> @ 0x1406703e8", "<???> @ 0x140670424", "<???> @ 0x140670434", "<???> @ 0x1406c9804"], "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"}