{"type": "func", "start": 3022482, "end": 3022618, "name": "BoomScrollLayer::pageNumberForPosition", "pseudocode": "// \n// BoomScrollLayer::pageNumberForPosition from 0x2e1e92 to 0x2e1f1a (136 bytes)\n// \n// 4 xrefs:\n// > BoomScrollLayer::updateDots @ 0x2e1fc6\n// > BoomScrollLayer::moveToPageEnded @ 0x2e2100\n// > BoomScrollLayer::ccTouchEnded @ 0x2e275e\n// > BoomScrollLayer::ccTouchMoved @ 0x2e2b0a\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\nint BoomScrollLayer::pageNumberForPosition(BoomScrollLayer *a1, cocos2d::CCPoint a2)\n{\n  float v3; // s17\n  float v4; // s16\n  int v5; // r4\n\n  v3 = *(float *)((int (__fastcall *)(ExtendedLayer *, _DWORD, _DWORD))a1->m_extendedLayer->getPosition)(\n                   a1->m_extendedLayer,\n                   LODWORD(a2.x),\n                   LODWORD(a2.y));\n  v4 = (float)-v3 / (float)(a1->getContentSize(a1)->width - a1->m_pageOffset);\n  v5 = (int)ceilf(v4);\n  if ( (float)((float)v5 - v4) >= 0.5 )\n    --v5;\n  if ( !a1->m_looped )\n  {\n    v5 &= ~(v5 >> 31);\n    if ( BoomScrollLayer::getTotalPages(a1) - 1 <= v5 )\n      return BoomScrollLayer::getTotalPages(a1) - 1;\n  }\n  return v5;\n}", "assembly": "; \n; BoomScrollLayer::pageNumberForPosition from 0x2e1e92 to 0x2e1f1a (136 bytes)\n; \n; 4 xrefs:\n; > BoomScrollLayer::updateDots @ 0x2e1fc6\n; > BoomScrollLayer::moveToPageEnded @ 0x2e2100\n; > BoomScrollLayer::ccTouchEnded @ 0x2e275e\n; > BoomScrollLayer::ccTouchMoved @ 0x2e2b0a\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\nPUSH            {R3-R5,LR}                                             ; +0x0, 0x2e1e92\nMOV             R5, R0                                                 ; +0x2, 0x2e1e94\nLDR.W           R0, [R0,#0x180]                                        ; +0x4, 0x2e1e96\nVPUSH           {D8}                                                   ; +0x8, 0x2e1e9a\nLDR             R3, [R0]                                               ; +0xc, 0x2e1e9e\nLDR             R3, [R3,#0x60]                                         ; +0xe, 0x2e1ea0\nBLX             R3                                                     ; +0x10, 0x2e1ea2\nLDR             R3, [R5]                                               ; +0x12, 0x2e1ea4\nLDR.W           R3, [R3,#0x9C]                                         ; +0x14, 0x2e1ea6\nVLDR            S17, [R0]                                              ; +0x18, 0x2e1eaa\nMOV             R0, R5                                                 ; +0x1c, 0x2e1eae\nBLX             R3                                                     ; +0x1e, 0x2e1eb0\nVLDR            S16, [R5,#0x1D0]                                       ; +0x20, 0x2e1eb2\nVNEG.F32        S17, S17                                               ; +0x24, 0x2e1eb6\nVLDR            S15, [R0]                                              ; +0x28, 0x2e1eba\nVSUB.F32        S16, S15, S16                                          ; +0x2c, 0x2e1ebe\nVDIV.F32        S16, S17, S16                                          ; +0x30, 0x2e1ec2\nVMOV            R0, S16; x                                             ; +0x34, 0x2e1ec6\nBLX             ceilf                                                  ; +0x38, 0x2e1eca\nLDRB.W          R3, [R5,#0x14C]                                        ; +0x3c, 0x2e1ece\nVMOV            S15, R0                                                ; +0x40, 0x2e1ed2\nVCVT.S32.F32    S15, S15                                               ; +0x44, 0x2e1ed6\nVMOV            R4, S15                                                ; +0x48, 0x2e1eda\nVCVT.F32.S32    S15, S15                                               ; +0x4c, 0x2e1ede\nVSUB.F32        S16, S15, S16                                          ; +0x50, 0x2e1ee2\nVMOV.F32        S15, #0.5                                              ; +0x54, 0x2e1ee6\nVCMPE.F32       S16, S15                                               ; +0x58, 0x2e1eea\nVMRS            APSR_nzcv, FPSCR                                       ; +0x5c, 0x2e1eee\nIT GE                                                                  ; +0x60, 0x2e1ef2\nADDGE.W         R4, R4, #0xFFFFFFFF                                    ; +0x62, 0x2e1ef4\nCBNZ            R3, loc_2E1F12                                         ; +0x66, 0x2e1ef8\nMOV             R0, R5; this                                           ; +0x68, 0x2e1efa\nBIC.W           R4, R4, R4,ASR#31                                      ; +0x6a, 0x2e1efc\nBL              _ZN15BoomScrollLayer13getTotalPagesEv; BoomScrollLayer::getTotalPages(void) ; +0x6e, 0x2e1f00\nSUBS            R0, #1                                                 ; +0x72, 0x2e1f04\nCMP             R0, R4                                                 ; +0x74, 0x2e1f06\nBGT             loc_2E1F12                                             ; +0x76, 0x2e1f08\nMOV             R0, R5; this                                           ; +0x78, 0x2e1f0a\nBL              _ZN15BoomScrollLayer13getTotalPagesEv; BoomScrollLayer::getTotalPages(void) ; +0x7a, 0x2e1f0c\nSUBS            R4, R0, #1                                             ; +0x7e, 0x2e1f10\nVPOP            {D8}                                                   ; +0x80, 0x2e1f12\nMOV             R0, R4                                                 ; +0x84, 0x2e1f16\nPOP             {R3-R5,PC}                                             ; +0x86, 0x2e1f18", "xrefs": ["BoomScrollLayer::updateDots @ 0x2e1fc6", "BoomScrollLayer::moveToPageEnded @ 0x2e2100", "BoomScrollLayer::ccTouchEnded @ 0x2e275e", "BoomScrollLayer::ccTouchMoved @ 0x2e2b0a"], "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"}