{"type": "func", "start": 4895620, "end": 4896042, "name": "GJOptionsLayer::goToPage", "pseudocode": "// \n// GJOptionsLayer::goToPage from 0x4ab384 to 0x4ab52a (422 bytes)\n// \n// 3 xrefs:\n// > GJOptionsLayer::init @ 0x4ab766\n// > GJOptionsLayer::onNextPage @ 0x4ab808\n// > GJOptionsLayer::onPrevPage @ 0x4ab812\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 GJOptionsLayer::goToPage(GJOptionsLayer *a1, int a2)\n{\n  int m_maxPage; // r6\n  int m_page; // r1\n  cocos2d::CCDictionary *m_values; // r8\n  char *v6; // r0\n  cocos2d::CCArray *v7; // r10\n  cocos2d::CCDictionary *v8; // r8\n  char *v9; // r0\n  int v10; // r8\n  unsigned int i; // r8\n  int v12; // r0\n  cocos2d::CCDictionary *v13; // r8\n  char *v14; // r0\n  cocos2d::CCArray *v15; // r10\n  cocos2d::CCDictionary *v16; // r8\n  char *v17; // r0\n  int v18; // r7\n  unsigned int j; // r8\n  int v20; // r0\n  CCMenuItemSpriteExtra *m_prevButton; // r0\n  std::string v22; // [sp+8h] [bp-8h] BYREF\n\n  if ( a2 > a1->m_maxPage )\n  {\n    m_maxPage = 0;\n  }\n  else\n  {\n    m_maxPage = a2 & ~(a2 >> 31);\n    if ( a2 < 0 )\n      m_maxPage = a1->m_maxPage;\n  }\n  m_page = a1->m_page;\n  if ( m_page != m_maxPage )\n  {\n    m_values = a1->m_values;\n    v6 = (char *)GJOptionsLayer::objectKey(a1, m_page);\n    sub_776584((int)&v22, v6);\n    v7 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(m_values, &v22);\n    sub_774008(&v22);\n    if ( v7 )\n    {\n      for ( i = 0; i < cocos2d::CCArray::count(v7); ++i )\n      {\n        v12 = cocos2d::CCArray::objectAtIndex(v7, i);\n        (*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v12 + 164))(v12, 0);\n      }\n    }\n    v8 = a1->m_values;\n    v9 = (char *)GJOptionsLayer::layerKey(a1, a1->m_page);\n    sub_776584((int)&v22, v9);\n    v10 = cocos2d::CCDictionary::objectForKey(v8, &v22);\n    sub_774008(&v22);\n    if ( v10 )\n      (*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v10 + 164))(v10, 0);\n    v13 = a1->m_values;\n    v14 = (char *)GJOptionsLayer::objectKey(a1, m_maxPage);\n    sub_776584((int)&v22, v14);\n    v15 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v13, &v22);\n    sub_774008(&v22);\n    if ( v15 )\n    {\n      for ( j = 0; j < cocos2d::CCArray::count(v15); ++j )\n      {\n        v20 = cocos2d::CCArray::objectAtIndex(v15, j);\n        (*(void (__fastcall **)(int, int))(*(_DWORD *)v20 + 164))(v20, 1);\n      }\n    }\n    v16 = a1->m_values;\n    v17 = (char *)GJOptionsLayer::layerKey(a1, m_maxPage);\n    sub_776584((int)&v22, v17);\n    v18 = cocos2d::CCDictionary::objectForKey(v16, &v22);\n    sub_774008(&v22);\n    if ( v18 )\n      (*(void (__fastcall **)(int, int))(*(_DWORD *)v18 + 164))(v18, 1);\n    m_prevButton = a1->m_prevButton;\n    a1->m_page = m_maxPage;\n    m_prevButton->setVisible(m_prevButton, m_maxPage > 0);\n    a1->m_nextButton->setVisible(a1->m_nextButton, a1->m_page < a1->m_maxPage);\n  }\n}", "assembly": "; \n; GJOptionsLayer::goToPage from 0x4ab384 to 0x4ab52a (422 bytes)\n; \n; 3 xrefs:\n; > GJOptionsLayer::init @ 0x4ab766\n; > GJOptionsLayer::onNextPage @ 0x4ab808\n; > GJOptionsLayer::onPrevPage @ 0x4ab812\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, 0x4ab384\nMOV             R5, R0                                                 ; +0x4, 0x4ab388\nLDR             R3, =(__stack_chk_guard_ptr - 0x4AB392)                ; +0x6, 0x4ab38a\nMOV             R6, R1                                                 ; +0x8, 0x4ab38c\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0xa, 0x4ab38e\nLDR             R3, [R3]; __stack_chk_guard                            ; +0xc, 0x4ab390\nLDR             R2, [R3]                                               ; +0xe, 0x4ab392\nMOV             R9, R3                                                 ; +0x10, 0x4ab394\nSTR             R2, [SP,#0x10+var_4]                                   ; +0x12, 0x4ab396\nLDR.W           R2, [R0,#0x2B8]                                        ; +0x14, 0x4ab398\nCMP             R1, R2                                                 ; +0x18, 0x4ab39c\nBGT             loc_4AB3AA                                             ; +0x1a, 0x4ab39e\nBICS.W          R6, R6, R1,ASR#32                                      ; +0x1c, 0x4ab3a0\nIT CS                                                                  ; +0x20, 0x4ab3a4\nMOVCS           R6, R2                                                 ; +0x22, 0x4ab3a6\nB               loc_4AB3AC                                             ; +0x24, 0x4ab3a8\nMOVS            R6, #0                                                 ; +0x26, 0x4ab3aa\nLDR.W           R1, [R5,#0x2AC]; int                                   ; +0x28, 0x4ab3ac\nCMP             R1, R6                                                 ; +0x2c, 0x4ab3b0\nBEQ.W           loc_4AB516                                             ; +0x2e, 0x4ab3b2\nMOV             R0, R5; this                                           ; +0x32, 0x4ab3b6\nLDR.W           R8, [R5,#0x2C4]                                        ; +0x34, 0x4ab3b8\nBL              _ZN14GJOptionsLayer9objectKeyEi; GJOptionsLayer::objectKey(int) ; +0x38, 0x4ab3bc\nADD             R4, SP, #0x10+var_8                                    ; +0x3c, 0x4ab3c0\nADD             R7, SP, #0x10+var_C                                    ; +0x3e, 0x4ab3c2\nMOV             R2, R7                                                 ; +0x40, 0x4ab3c4\nMOV             R1, R0; char *                                         ; +0x42, 0x4ab3c6\nMOV             R0, R4; int                                            ; +0x44, 0x4ab3c8\nBL              sub_776584                                             ; +0x46, 0x4ab3ca\nMOV             R0, R8                                                 ; +0x4a, 0x4ab3ce\nMOV             R1, R4                                                 ; +0x4c, 0x4ab3d0\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x4e, 0x4ab3d2\nMOV             R10, R0                                                ; +0x52, 0x4ab3d6\nMOV             R0, R4                                                 ; +0x54, 0x4ab3d8\nBL              sub_774008                                             ; +0x56, 0x4ab3da\nCMP.W           R10, #0                                                ; +0x5a, 0x4ab3de\nBNE             loc_4AB422                                             ; +0x5e, 0x4ab3e2\nLDR.W           R1, [R5,#0x2AC]; int                                   ; +0x60, 0x4ab3e4\nMOV             R0, R5; this                                           ; +0x64, 0x4ab3e8\nLDR.W           R8, [R5,#0x2C4]                                        ; +0x66, 0x4ab3ea\nBL              _ZN14GJOptionsLayer8layerKeyEi; GJOptionsLayer::layerKey(int) ; +0x6a, 0x4ab3ee\nMOV             R2, R7                                                 ; +0x6e, 0x4ab3f2\nMOV             R1, R0; char *                                         ; +0x70, 0x4ab3f4\nMOV             R0, R4; int                                            ; +0x72, 0x4ab3f6\nBL              sub_776584                                             ; +0x74, 0x4ab3f8\nMOV             R0, R8                                                 ; +0x78, 0x4ab3fc\nMOV             R1, R4                                                 ; +0x7a, 0x4ab3fe\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x7c, 0x4ab400\nMOV             R8, R0                                                 ; +0x80, 0x4ab404\nMOV             R0, R4                                                 ; +0x82, 0x4ab406\nBL              sub_774008                                             ; +0x84, 0x4ab408\nCMP.W           R8, #0                                                 ; +0x88, 0x4ab40c\nBEQ             loc_4AB448                                             ; +0x8c, 0x4ab410\nLDR.W           R3, [R8]                                               ; +0x8e, 0x4ab412\nMOV             R0, R8                                                 ; +0x92, 0x4ab416\nMOVS            R1, #0                                                 ; +0x94, 0x4ab418\nLDR.W           R3, [R3,#0xA4]                                         ; +0x96, 0x4ab41a\nBLX             R3                                                     ; +0x9a, 0x4ab41e\nB               loc_4AB448                                             ; +0x9c, 0x4ab420\nMOV.W           R8, #0                                                 ; +0x9e, 0x4ab422\nMOV             R0, R10; this                                          ; +0xa2, 0x4ab426\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xa4, 0x4ab428\nCMP             R8, R0                                                 ; +0xa8, 0x4ab42c\nBCS             loc_4AB3E4                                             ; +0xaa, 0x4ab42e\nMOV             R1, R8; unsigned int                                   ; +0xac, 0x4ab430\nMOV             R0, R10; this                                          ; +0xae, 0x4ab432\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xb0, 0x4ab434\nMOVS            R1, #0                                                 ; +0xb4, 0x4ab438\nADD.W           R8, R8, #1                                             ; +0xb6, 0x4ab43a\nLDR             R3, [R0]                                               ; +0xba, 0x4ab43e\nLDR.W           R3, [R3,#0xA4]                                         ; +0xbc, 0x4ab440\nBLX             R3                                                     ; +0xc0, 0x4ab444\nB               loc_4AB426                                             ; +0xc2, 0x4ab446\nMOV             R1, R6; int                                            ; +0xc4, 0x4ab448\nMOV             R0, R5; this                                           ; +0xc6, 0x4ab44a\nLDR.W           R8, [R5,#0x2C4]                                        ; +0xc8, 0x4ab44c\nBL              _ZN14GJOptionsLayer9objectKeyEi; GJOptionsLayer::objectKey(int) ; +0xcc, 0x4ab450\nMOV             R2, R7                                                 ; +0xd0, 0x4ab454\nMOV             R1, R0; char *                                         ; +0xd2, 0x4ab456\nMOV             R0, R4; int                                            ; +0xd4, 0x4ab458\nBL              sub_776584                                             ; +0xd6, 0x4ab45a\nMOV             R0, R8                                                 ; +0xda, 0x4ab45e\nMOV             R1, R4                                                 ; +0xdc, 0x4ab460\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0xde, 0x4ab462\nMOV             R10, R0                                                ; +0xe2, 0x4ab466\nMOV             R0, R4                                                 ; +0xe4, 0x4ab468\nBL              sub_774008                                             ; +0xe6, 0x4ab46a\nCMP.W           R10, #0                                                ; +0xea, 0x4ab46e\nBNE             loc_4AB4AA                                             ; +0xee, 0x4ab472\nMOV             R1, R6; int                                            ; +0xf0, 0x4ab474\nMOV             R0, R5; this                                           ; +0xf2, 0x4ab476\nLDR.W           R8, [R5,#0x2C4]                                        ; +0xf4, 0x4ab478\nBL              _ZN14GJOptionsLayer8layerKeyEi; GJOptionsLayer::layerKey(int) ; +0xf8, 0x4ab47c\nMOV             R2, R7                                                 ; +0xfc, 0x4ab480\nMOV             R1, R0; char *                                         ; +0xfe, 0x4ab482\nMOV             R0, R4; int                                            ; +0x100, 0x4ab484\nBL              sub_776584                                             ; +0x102, 0x4ab486\nMOV             R0, R8                                                 ; +0x106, 0x4ab48a\nMOV             R1, R4                                                 ; +0x108, 0x4ab48c\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x10a, 0x4ab48e\nMOV             R7, R0                                                 ; +0x10e, 0x4ab492\nMOV             R0, R4                                                 ; +0x110, 0x4ab494\nBL              sub_774008                                             ; +0x112, 0x4ab496\nCBZ             R7, loc_4AB4D0                                         ; +0x116, 0x4ab49a\nLDR             R3, [R7]                                               ; +0x118, 0x4ab49c\nMOV             R0, R7                                                 ; +0x11a, 0x4ab49e\nMOVS            R1, #1                                                 ; +0x11c, 0x4ab4a0\nLDR.W           R3, [R3,#0xA4]                                         ; +0x11e, 0x4ab4a2\nBLX             R3                                                     ; +0x122, 0x4ab4a6\nB               loc_4AB4D0                                             ; +0x124, 0x4ab4a8\nMOV.W           R8, #0                                                 ; +0x126, 0x4ab4aa\nMOV             R0, R10; this                                          ; +0x12a, 0x4ab4ae\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x12c, 0x4ab4b0\nCMP             R8, R0                                                 ; +0x130, 0x4ab4b4\nBCS             loc_4AB474                                             ; +0x132, 0x4ab4b6\nMOV             R1, R8; unsigned int                                   ; +0x134, 0x4ab4b8\nMOV             R0, R10; this                                          ; +0x136, 0x4ab4ba\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x138, 0x4ab4bc\nMOVS            R1, #1                                                 ; +0x13c, 0x4ab4c0\nADD.W           R8, R8, #1                                             ; +0x13e, 0x4ab4c2\nLDR             R3, [R0]                                               ; +0x142, 0x4ab4c6\nLDR.W           R3, [R3,#0xA4]                                         ; +0x144, 0x4ab4c8\nBLX             R3                                                     ; +0x148, 0x4ab4cc\nB               loc_4AB4AE                                             ; +0x14a, 0x4ab4ce\nLDR.W           R0, [R5,#0x2CC]                                        ; +0x14c, 0x4ab4d0\nCMP             R6, #0                                                 ; +0x150, 0x4ab4d4\nSTR.W           R6, [R5,#0x2AC]                                        ; +0x152, 0x4ab4d6\nITE LE                                                                 ; +0x156, 0x4ab4da\nMOVLE           R1, #0                                                 ; +0x158, 0x4ab4dc\nMOVGT           R1, #1                                                 ; +0x15a, 0x4ab4de\nLDR             R3, [R0]                                               ; +0x15c, 0x4ab4e0\nLDR.W           R3, [R3,#0xA4]                                         ; +0x15e, 0x4ab4e2\nBLX             R3                                                     ; +0x162, 0x4ab4e6\nLDR.W           R0, [R5,#0x2D0]                                        ; +0x164, 0x4ab4e8\nLDR.W           R1, [R5,#0x2AC]                                        ; +0x168, 0x4ab4ec\nLDR.W           R2, [R5,#0x2B8]                                        ; +0x16c, 0x4ab4f0\nLDR             R3, [R0]                                               ; +0x170, 0x4ab4f4\nCMP             R1, R2                                                 ; +0x172, 0x4ab4f6\nLDR.W           R3, [R3,#0xA4]                                         ; +0x174, 0x4ab4f8\nITE GE                                                                 ; +0x178, 0x4ab4fc\nMOVGE           R1, #0                                                 ; +0x17a, 0x4ab4fe\nMOVLT           R1, #1                                                 ; +0x17c, 0x4ab500\nBLX             R3                                                     ; +0x17e, 0x4ab502\nB               loc_4AB516                                             ; +0x180, 0x4ab504\nB               loc_4AB508                                             ; +0x182, 0x4ab506\nMOV             R0, R4                                                 ; +0x184, 0x4ab508\nBL              sub_774008                                             ; +0x186, 0x4ab50a\nBL              __cxa_end_cleanup                                      ; +0x18a, 0x4ab50e\nB               loc_4AB508                                             ; +0x18e, 0x4ab512\nB               loc_4AB508                                             ; +0x190, 0x4ab514\nLDR             R2, [SP,#0x10+var_4]                                   ; +0x192, 0x4ab516\nLDR.W           R3, [R9]                                               ; +0x194, 0x4ab518\nCMP             R2, R3                                                 ; +0x198, 0x4ab51c\nBEQ             loc_4AB524                                             ; +0x19a, 0x4ab51e\nBLX             __stack_chk_fail                                       ; +0x19c, 0x4ab520\nADD             SP, SP, #0x10                                          ; +0x1a0, 0x4ab524\nPOP.W           {R4-R10,PC}                                            ; +0x1a2, 0x4ab526", "xrefs": ["GJOptionsLayer::init @ 0x4ab766", "GJOptionsLayer::onNextPage @ 0x4ab808", "GJOptionsLayer::onPrevPage @ 0x4ab812"], "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"}