{"type": "func", "start": 3023208, "end": 3023570, "name": "BoomScrollLayer::setupDynamicScrolling", "pseudocode": "// \n// BoomScrollLayer::setupDynamicScrolling from 0x2e2168 to 0x2e22d2 (362 bytes)\n// \n// 1 xrefs:\n// > BoomScrollLayer::init @ 0x2e2d94\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\nvoid BoomScrollLayer::setupDynamicScrolling(BoomScrollLayer *a1, cocos2d::CCArray *a2, DynamicScrollDelegate *a3)\n{\n  cocos2d::CCArray *m_dynamicObjects; // r0\n  cocos2d::CCArray *m_pages; // r0\n  int Object; // r9\n  void (__fastcall *v8)(int, cocos2d::CCPoint *); // r10\n  int v9; // r9\n  void (__fastcall *v10)(int, cocos2d::CCPoint *); // r10\n  int v11; // r9\n  void (__fastcall *v12)(int, cocos2d::CCPoint *); // r10\n  DynamicScrollDelegate *m_dynamicDelegate; // r5\n  void (__fastcall *updatePageWithObject)(DynamicScrollDelegate *__hidden, cocos2d::CCObject *, cocos2d::CCObject *); // r9\n  int v15; // r10\n  int v16; // r0\n  int v17; // r3\n  DynamicScrollDelegate *v18; // r5\n  void (__fastcall *v19)(DynamicScrollDelegate *__hidden, cocos2d::CCObject *, cocos2d::CCObject *); // r9\n  cocos2d::CCObject *v20; // r10\n  cocos2d::CCObject *v21; // r0\n  DynamicScrollDelegate *v22; // r5\n  void (__fastcall *v23)(DynamicScrollDelegate *__hidden, cocos2d::CCObject *, cocos2d::CCObject *); // r9\n  cocos2d::CCObject *v24; // r10\n  cocos2d::CCObject *v25; // r0\n  unsigned int v26; // r5\n  int v27; // r5\n  cocos2d::CCPoint v29; // [sp+4h] [bp-Ch] BYREF\n  int v30; // [sp+Ch] [bp-4h]\n\n  LODWORD(v29.x) = a2;\n  LODWORD(v29.y) = a3;\n  a1->m_dynamicDelegate = a3;\n  m_dynamicObjects = a1->m_dynamicObjects;\n  if ( m_dynamicObjects )\n    cocos2d::CCObject::release(m_dynamicObjects);\n  a1->m_dynamicObjects = a2;\n  cocos2d::CCObject::retain(a2);\n  m_pages = a1->m_pages;\n  a1->m_dynamic = 1;\n  Object = cocos2d::CCArray::lastObject(m_pages);\n  v8 = *(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)Object + 92);\n  BoomScrollLayer::getRelativePosForPage(&v29, a1, -1);\n  v8(Object, &v29);\n  v9 = cocos2d::CCArray::objectAtIndex(a1->m_pages, 0);\n  v10 = *(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v9 + 92);\n  BoomScrollLayer::getRelativePosForPage(&v29, a1, 0);\n  v10(v9, &v29);\n  v11 = cocos2d::CCArray::objectAtIndex(a1->m_pages, 1u);\n  v12 = *(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v11 + 92);\n  BoomScrollLayer::getRelativePosForPage(&v29, a1, 1);\n  v12(v11, &v29);\n  m_dynamicDelegate = a1->m_dynamicDelegate;\n  updatePageWithObject = m_dynamicDelegate->updatePageWithObject;\n  v15 = cocos2d::CCArray::lastObject(a1->m_pages);\n  v16 = cocos2d::CCArray::lastObject(a1->m_dynamicObjects);\n  ((void (__fastcall *)(DynamicScrollDelegate *, int, int, int, BoomScrollLayer *, _DWORD, _DWORD, int))updatePageWithObject)(\n    m_dynamicDelegate,\n    v15,\n    v16,\n    v17,\n    a1,\n    LODWORD(v29.x),\n    LODWORD(v29.y),\n    v30);\n  v18 = a1->m_dynamicDelegate;\n  v19 = v18->updatePageWithObject;\n  v20 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a1->m_pages, 0);\n  v21 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a1->m_dynamicObjects, 0);\n  v19(v18, v20, v21);\n  v22 = a1->m_dynamicDelegate;\n  v23 = v22->updatePageWithObject;\n  v24 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a1->m_pages, 1u);\n  v25 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a1->m_dynamicObjects, 1u);\n  v23(v22, v24, v25);\n  if ( cocos2d::CCArray::count(a1->m_dynamicObjects) <= 2u )\n  {\n    a1->m_dynamic = 0;\n    a1->m_looped = 0;\n    while ( 1 )\n    {\n      v26 = cocos2d::CCArray::count(a1->m_pages);\n      if ( v26 <= cocos2d::CCArray::count(a2) )\n        break;\n      v27 = cocos2d::CCArray::lastObject(a1->m_pages);\n      cocos2d::CCArray::removeLastObject(a1->m_pages, 1);\n      (*(void (__fastcall **)(int))(*(_DWORD *)v27 + 260))(v27);\n    }\n  }\n}", "assembly": "; \n; BoomScrollLayer::setupDynamicScrolling from 0x2e2168 to 0x2e22d2 (362 bytes)\n; \n; 1 xrefs:\n; > BoomScrollLayer::init @ 0x2e2d94\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.W          {R0-R10,LR}                                            ; +0x0, 0x2e2168\nMOV             R4, R0                                                 ; +0x4, 0x2e216c\nLDR             R3, =(__stack_chk_guard_ptr - 0x2E217A)                ; +0x6, 0x2e216e\nMOV             R8, R1                                                 ; +0x8, 0x2e2170\nSTR.W           R2, [R0,#0x150]                                        ; +0xa, 0x2e2172\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0xe, 0x2e2176\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x10, 0x2e2178\nLDR.W           R0, [R0,#0x154]; this                                  ; +0x12, 0x2e217a\nLDR             R1, [R3]                                               ; +0x16, 0x2e217e\nMOV             R7, R3                                                 ; +0x18, 0x2e2180\nSTR             R1, [SP,#0x10+var_4]                                   ; +0x1a, 0x2e2182\nCBZ             R0, loc_2E218A                                         ; +0x1c, 0x2e2184\nBL              _ZN7cocos2d8CCObject7releaseEv; cocos2d::CCObject::release(void) ; +0x1e, 0x2e2186\nMOV             R0, R8; this                                           ; +0x22, 0x2e218a\nSTR.W           R8, [R4,#0x154]                                        ; +0x24, 0x2e218c\nBL              _ZN7cocos2d8CCObject6retainEv; cocos2d::CCObject::retain(void) ; +0x28, 0x2e2190\nMOVS            R6, #1                                                 ; +0x2c, 0x2e2194\nLDR.W           R0, [R4,#0x168]; this                                  ; +0x2e, 0x2e2196\nADD             R5, SP, #0x10+var_C                                    ; +0x32, 0x2e219a\nSTRB.W          R6, [R4,#0x158]                                        ; +0x34, 0x2e219c\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0x38, 0x2e21a0\nMOV.W           R2, #0xFFFFFFFF                                        ; +0x3c, 0x2e21a4\nMOV             R1, R4; int                                            ; +0x40, 0x2e21a8\nLDR             R3, [R0]                                               ; +0x42, 0x2e21aa\nMOV             R9, R0                                                 ; +0x44, 0x2e21ac\nMOV             R0, R5; this                                           ; +0x46, 0x2e21ae\nLDR.W           R10, [R3,#0x5C]                                        ; +0x48, 0x2e21b0\nBL              _ZN15BoomScrollLayer21getRelativePosForPageEi; BoomScrollLayer::getRelativePosForPage(int) ; +0x4c, 0x2e21b4\nMOV             R0, R9                                                 ; +0x50, 0x2e21b8\nMOV             R1, R5                                                 ; +0x52, 0x2e21ba\nBLX             R10                                                    ; +0x54, 0x2e21bc\nMOVS            R1, #0; unsigned int                                   ; +0x56, 0x2e21be\nLDR.W           R0, [R4,#0x168]; this                                  ; +0x58, 0x2e21c0\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x5c, 0x2e21c4\nMOVS            R2, #0                                                 ; +0x60, 0x2e21c8\nMOV             R1, R4; int                                            ; +0x62, 0x2e21ca\nLDR             R3, [R0]                                               ; +0x64, 0x2e21cc\nMOV             R9, R0                                                 ; +0x66, 0x2e21ce\nMOV             R0, R5; this                                           ; +0x68, 0x2e21d0\nLDR.W           R10, [R3,#0x5C]                                        ; +0x6a, 0x2e21d2\nBL              _ZN15BoomScrollLayer21getRelativePosForPageEi; BoomScrollLayer::getRelativePosForPage(int) ; +0x6e, 0x2e21d6\nMOV             R0, R9                                                 ; +0x72, 0x2e21da\nMOV             R1, R5                                                 ; +0x74, 0x2e21dc\nBLX             R10                                                    ; +0x76, 0x2e21de\nMOV             R1, R6; unsigned int                                   ; +0x78, 0x2e21e0\nLDR.W           R0, [R4,#0x168]; this                                  ; +0x7a, 0x2e21e2\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x7e, 0x2e21e6\nMOV             R2, R6                                                 ; +0x82, 0x2e21ea\nMOV             R1, R4; int                                            ; +0x84, 0x2e21ec\nLDR             R3, [R0]                                               ; +0x86, 0x2e21ee\nMOV             R9, R0                                                 ; +0x88, 0x2e21f0\nMOV             R0, R5; this                                           ; +0x8a, 0x2e21f2\nLDR.W           R10, [R3,#0x5C]                                        ; +0x8c, 0x2e21f4\nBL              _ZN15BoomScrollLayer21getRelativePosForPageEi; BoomScrollLayer::getRelativePosForPage(int) ; +0x90, 0x2e21f8\nMOV             R1, R5                                                 ; +0x94, 0x2e21fc\nMOV             R0, R9                                                 ; +0x96, 0x2e21fe\nBLX             R10                                                    ; +0x98, 0x2e2200\nLDR.W           R5, [R4,#0x150]                                        ; +0x9a, 0x2e2202\nLDR.W           R0, [R4,#0x168]; this                                  ; +0x9e, 0x2e2206\nLDR             R3, [R5]                                               ; +0xa2, 0x2e220a\nLDR.W           R9, [R3]                                               ; +0xa4, 0x2e220c\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0xa8, 0x2e2210\nMOV             R10, R0                                                ; +0xac, 0x2e2214\nLDR.W           R0, [R4,#0x154]; this                                  ; +0xae, 0x2e2216\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0xb2, 0x2e221a\nMOV             R1, R10                                                ; +0xb6, 0x2e221e\nMOV             R2, R0                                                 ; +0xb8, 0x2e2220\nMOV             R0, R5                                                 ; +0xba, 0x2e2222\nBLX             R9                                                     ; +0xbc, 0x2e2224\nLDR.W           R5, [R4,#0x150]                                        ; +0xbe, 0x2e2226\nMOVS            R1, #0; unsigned int                                   ; +0xc2, 0x2e222a\nLDR.W           R0, [R4,#0x168]; this                                  ; +0xc4, 0x2e222c\nLDR             R3, [R5]                                               ; +0xc8, 0x2e2230\nLDR.W           R9, [R3]                                               ; +0xca, 0x2e2232\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xce, 0x2e2236\nMOVS            R1, #0; unsigned int                                   ; +0xd2, 0x2e223a\nMOV             R10, R0                                                ; +0xd4, 0x2e223c\nLDR.W           R0, [R4,#0x154]; this                                  ; +0xd6, 0x2e223e\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xda, 0x2e2242\nMOV             R1, R10                                                ; +0xde, 0x2e2246\nMOV             R2, R0                                                 ; +0xe0, 0x2e2248\nMOV             R0, R5                                                 ; +0xe2, 0x2e224a\nBLX             R9                                                     ; +0xe4, 0x2e224c\nLDR.W           R5, [R4,#0x150]                                        ; +0xe6, 0x2e224e\nMOV             R1, R6; unsigned int                                   ; +0xea, 0x2e2252\nLDR.W           R0, [R4,#0x168]; this                                  ; +0xec, 0x2e2254\nLDR             R3, [R5]                                               ; +0xf0, 0x2e2258\nLDR.W           R9, [R3]                                               ; +0xf2, 0x2e225a\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xf6, 0x2e225e\nMOV             R1, R6; unsigned int                                   ; +0xfa, 0x2e2262\nMOV             R10, R0                                                ; +0xfc, 0x2e2264\nLDR.W           R0, [R4,#0x154]; this                                  ; +0xfe, 0x2e2266\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x102, 0x2e226a\nMOV             R1, R10                                                ; +0x106, 0x2e226e\nMOV             R2, R0                                                 ; +0x108, 0x2e2270\nMOV             R0, R5                                                 ; +0x10a, 0x2e2272\nBLX             R9                                                     ; +0x10c, 0x2e2274\nLDR.W           R0, [R4,#0x154]; this                                  ; +0x10e, 0x2e2276\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x112, 0x2e227a\nCMP             R0, #2                                                 ; +0x116, 0x2e227e\nBHI             loc_2E22C0                                             ; +0x118, 0x2e2280\nMOVS            R3, #0                                                 ; +0x11a, 0x2e2282\nSTRB.W          R3, [R4,#0x158]                                        ; +0x11c, 0x2e2284\nSTRB.W          R3, [R4,#0x14C]                                        ; +0x120, 0x2e2288\nLDR.W           R0, [R4,#0x168]; this                                  ; +0x124, 0x2e228c\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x128, 0x2e2290\nMOV             R5, R0                                                 ; +0x12c, 0x2e2294\nMOV             R0, R8; this                                           ; +0x12e, 0x2e2296\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x130, 0x2e2298\nCMP             R5, R0                                                 ; +0x134, 0x2e229c\nBLS             loc_2E22C0                                             ; +0x136, 0x2e229e\nLDR.W           R0, [R4,#0x168]; this                                  ; +0x138, 0x2e22a0\nBL              _ZN7cocos2d7CCArray10lastObjectEv; cocos2d::CCArray::lastObject(void) ; +0x13c, 0x2e22a4\nMOVS            R1, #1; bool                                           ; +0x140, 0x2e22a8\nMOV             R5, R0                                                 ; +0x142, 0x2e22aa\nLDR.W           R0, [R4,#0x168]; this                                  ; +0x144, 0x2e22ac\nBL              _ZN7cocos2d7CCArray16removeLastObjectEb; cocos2d::CCArray::removeLastObject(bool) ; +0x148, 0x2e22b0\nLDR             R3, [R5]                                               ; +0x14c, 0x2e22b4\nMOV             R0, R5                                                 ; +0x14e, 0x2e22b6\nLDR.W           R3, [R3,#0x104]                                        ; +0x150, 0x2e22b8\nBLX             R3                                                     ; +0x154, 0x2e22bc\nB               loc_2E228C                                             ; +0x156, 0x2e22be\nLDR             R2, [SP,#0x10+var_4]                                   ; +0x158, 0x2e22c0\nLDR             R3, [R7]                                               ; +0x15a, 0x2e22c2\nCMP             R2, R3                                                 ; +0x15c, 0x2e22c4\nBEQ             loc_2E22CC                                             ; +0x15e, 0x2e22c6\nBLX             __stack_chk_fail                                       ; +0x160, 0x2e22c8\nADD             SP, SP, #0x10                                          ; +0x164, 0x2e22cc\nPOP.W           {R4-R10,PC}                                            ; +0x166, 0x2e22ce", "xrefs": ["BoomScrollLayer::init @ 0x2e2d94"], "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"}