{"type": "func", "start": 5371291632, "end": 5371292344, "name": "GJGarageLayer::getItems", "pseudocode": "// \n// GJGarageLayer::getItems from 0x1402767f0 to 0x140276ab8 (712 bytes)\n// \n// 3 xrefs:\n// > GJGarageLayer::setupPage @ 0x1402761e8\n// > GJGarageLayer::getItems_1 @ 0x1402767d0\n// > <???> @ 0x1406d0f8c\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=4\ncocos2d::CCArray *GJGarageLayer::getItems(GJGarageLayer *a1, int a2, int a3, IconType a4, int a5)\n{\n  GameManager *v8; // rcx\n  UnlockType v9; // r13d\n  __int64 v10; // rcx\n  cocos2d::CCArray *v11; // r14\n  int v12; // ecx\n  int v13; // r12d\n  unsigned int v14; // esi\n  GameManager *v15; // rcx\n  bool isIconUnlocked; // r15\n  GJItemIcon *BrowserItem; // r14\n  float v18; // xmm0_4\n  float v19; // xmm7_4\n  CCMenuItemSpriteExtra *v20; // rax\n  CCMenuItemSpriteExtra *v21; // rdi\n  CCMenuItemSpriteExtra_vtbl *v22; // rbx\n  __int64 v23; // rax\n  GJItemIcon_vtbl *v24; // rbx\n  float *v25; // rax\n  const cocos2d::CCPoint *v26; // rax\n  cocos2d::CCArray *v27; // rbx\n  struct cocos2d::CCSprite *v29; // [rsp+30h] [rbp-98h]\n  void *v30; // [rsp+38h] [rbp-90h]\n  CCMenuItemSpriteExtra *v31; // [rsp+40h] [rbp-88h]\n  void *v32; // [rsp+D0h] [rbp+8h]\n  cocos2d::CCArray *v33; // [rsp+D0h] [rbp+8h]\n  IconType v34; // [rsp+E8h] [rbp+20h] BYREF\n\n  v34 = a4;\n  *(_DWORD *)sub_14012CE70((__int64 *)&a1->m_iconPages, (int *)&v34) = a3;\n  if ( !qword_1406C2ED8 )\n  {\n    v32 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v32);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n  }\n  v9 = GameManager::iconTypeToUnlockType(v8, v34);\n  v11 = (cocos2d::CCArray *)cocos2d::CCArray::create(v10);\n  v33 = v11;\n  v29 = cocos2d::CCSprite::createWithSpriteFrameName(\"playerSquare_001.png\");\n  a1->m_currentIcon = nullptr;\n  v12 = 36 * a3;\n  v13 = 36 * a3 + 36;\n  if ( a2 < v13 )\n    v13 = a2;\n  v14 = v12 + 1;\n  if ( v12 + 1 <= v13 )\n  {\n    while ( 1 )\n    {\n      v15 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v30 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v30);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v15 = (GameManager *)qword_1406C2ED8;\n      }\n      isIconUnlocked = GameManager::isIconUnlocked(v15, v14, v34);\n      BrowserItem = GJItemIcon::createBrowserItem(v9, v14);\n      if ( BrowserItem )\n        break;\n      v27 = v33;\nLABEL_19:\n      if ( (int)++v14 > v13 )\n        return v27;\n    }\n    v18 = GJItemIcon::scaleForType(v9);\n    v19 = v18;\n    ((void (__fastcall *)(GJItemIcon *))BrowserItem->setScale_0)(BrowserItem);\n    v31 = (CCMenuItemSpriteExtra *)operator new(0x208u);\n    v20 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v31);\n    v21 = v20;\n    if ( v20 )\n    {\n      if ( CCMenuItemSpriteExtra::init(\n             v20,\n             BrowserItem,\n             nullptr,\n             a1,\n             (cocos2d::SEL_MenuHandler *)GJGarageLayer::onSelect) )\n      {\n        cocos2d::CCObject::autorelease(v21);\nLABEL_14:\n        v22 = v21->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n        v23 = (__int64)v29->getContentSize(v29);\n        v22->setContentSize(v21, (const cocos2d::CCSize *)v23);\n        v24 = BrowserItem->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n        v21->getContentSize(v21);\n        v25 = (float *)v21->getContentSize(v21);\n        cocos2d::CCPoint::CCPoint(v18, *v25 * 0.5);\n        v24->setPosition_0(BrowserItem, v26);\n        v21->setTag(v21, v14);\n        LODWORD(v21->m_startPosition.x) = v34;\n        v27 = v33;\n        cocos2d::CCArray::addObject(v33, v21);\n        if ( v14 == a5 )\n          a1->m_currentIcon = v21;\n        if ( !isIconUnlocked )\n          GJItemIcon::changeToLockedState(BrowserItem, 1.0 / v19);\n        goto LABEL_19;\n      }\n      ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v21->~CCMenuItemSpriteExtra)(v21, 1);\n    }\n    v21 = nullptr;\n    goto LABEL_14;\n  }\n  return v11;\n}", "assembly": "; \n; GJGarageLayer::getItems from 0x1402767f0 to 0x140276ab8 (712 bytes)\n; \n; 3 xrefs:\n; > GJGarageLayer::setupPage @ 0x1402761e8\n; > GJGarageLayer::getItems_1 @ 0x1402767d0\n; > <???> @ 0x1406d0f8c\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     rax, rsp                                                       ; +0x0, 0x1402767f0\nmov     [rax+10h], rbx                                                 ; +0x3, 0x1402767f3\nmov     [rax+20h], r9d                                                 ; +0x7, 0x1402767f7\npush    rbp                                                            ; +0xb, 0x1402767fb\npush    rsi                                                            ; +0xc, 0x1402767fc\npush    rdi                                                            ; +0xd, 0x1402767fd\npush    r12                                                            ; +0xe, 0x1402767fe\npush    r13                                                            ; +0x10, 0x140276800\npush    r14                                                            ; +0x12, 0x140276802\npush    r15                                                            ; +0x14, 0x140276804\nsub     rsp, 90h                                                       ; +0x16, 0x140276806\nmovaps  xmmword ptr [rax-48h], xmm6                                    ; +0x1d, 0x14027680d\nmovaps  xmmword ptr [rax-58h], xmm7                                    ; +0x21, 0x140276811\nmovaps  xmmword ptr [rax-68h], xmm8                                    ; +0x25, 0x140276815\nmovaps  xmmword ptr [rax-78h], xmm9                                    ; +0x2a, 0x14027681a\nmov     ebx, r8d                                                       ; +0x2f, 0x14027681f\nmov     edi, edx                                                       ; +0x32, 0x140276822\nmov     rbp, rcx                                                       ; +0x34, 0x140276824\nadd     rcx, 208h                                                      ; +0x37, 0x140276827\nlea     rdx, [rax+20h]                                                 ; +0x3e, 0x14027682e\ncall    sub_14012CE70                                                  ; +0x42, 0x140276832\nmov     [rax], ebx                                                     ; +0x47, 0x140276837\ncmp     cs:qword_1406C2ED8, 0                                          ; +0x49, 0x140276839\njnz     short loc_14027686E                                            ; +0x51, 0x140276841\nmov     ecx, 668h; Size                                                ; +0x53, 0x140276843\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x58, 0x140276848\nmov     [rsp+0C8h+arg_0], rax                                          ; +0x5d, 0x14027684d\nmov     rcx, rax                                                       ; +0x65, 0x140276855\ncall    sub_14017AB00                                                  ; +0x68, 0x140276858\nnop                                                                    ; +0x6d, 0x14027685d\nmov     cs:qword_1406C2ED8, rax                                        ; +0x6e, 0x14027685e\nmov     rdx, [rax]                                                     ; +0x75, 0x140276865\nmov     rcx, rax                                                       ; +0x78, 0x140276868\ncall    qword ptr [rdx+48h]                                            ; +0x7b, 0x14027686b\nmov     edx, [rsp+0C8h+arg_18]                                         ; +0x7e, 0x14027686e\ncall    GameManager__iconTypeToUnlockType                              ; +0x85, 0x140276875\nmov     r13d, eax                                                      ; +0x8a, 0x14027687a\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x8d, 0x14027687d\nmov     r14, rax                                                       ; +0x93, 0x140276883\nmov     [rsp+0C8h+arg_0], rax                                          ; +0x96, 0x140276886\nlea     rcx, aPlayersquare00; \"playerSquare_001.png\"                   ; +0x9e, 0x14027688e\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0xa5, 0x140276895\nmov     [rsp+0C8h+var_98], rax                                         ; +0xab, 0x14027689b\nmov     qword ptr [rbp+228h], 0                                        ; +0xb0, 0x1402768a0\nlea     ecx, [rbx+rbx*8]                                               ; +0xbb, 0x1402768ab\nlea     ecx, ds:0[rcx*4]                                               ; +0xbe, 0x1402768ae\nlea     r12d, [rcx+24h]                                                ; +0xc5, 0x1402768b5\ncmp     edi, r12d                                                      ; +0xc9, 0x1402768b9\ncmovl   r12d, edi                                                      ; +0xcc, 0x1402768bc\nlea     esi, [rcx+1]                                                   ; +0xd0, 0x1402768c0\ncmp     esi, r12d                                                      ; +0xd3, 0x1402768c3\njg      loc_140276A86                                                  ; +0xd6, 0x1402768c6\nmovss   xmm9, cs:dword_140622B08                                       ; +0xdc, 0x1402768cc\nmovss   xmm8, cs:flt_140622C24                                         ; +0xe5, 0x1402768d5\nxchg    ax, ax                                                         ; +0xee, 0x1402768de\nlea     rbx, GJGarageLayer__onSelect                                   ; +0xf0, 0x1402768e0\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xf7, 0x1402768e7\ntest    rcx, rcx                                                       ; +0xfe, 0x1402768ee\njnz     short loc_140276922                                            ; +0x101, 0x1402768f1\nmov     ecx, 668h; Size                                                ; +0x103, 0x1402768f3\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x108, 0x1402768f8\nmov     [rsp+0C8h+var_90], rax                                         ; +0x10d, 0x1402768fd\nmov     rcx, rax                                                       ; +0x112, 0x140276902\ncall    sub_14017AB00                                                  ; +0x115, 0x140276905\nnop                                                                    ; +0x11a, 0x14027690a\nmov     cs:qword_1406C2ED8, rax                                        ; +0x11b, 0x14027690b\nmov     rdx, [rax]                                                     ; +0x122, 0x140276912\nmov     rcx, rax                                                       ; +0x125, 0x140276915\ncall    qword ptr [rdx+48h]                                            ; +0x128, 0x140276918\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x12b, 0x14027691b\nmov     r8d, [rsp+0C8h+arg_18]                                         ; +0x132, 0x140276922\nmov     edx, esi                                                       ; +0x13a, 0x14027692a\ncall    GameManager__isIconUnlocked                                    ; +0x13c, 0x14027692c\nmovzx   r15d, al                                                       ; +0x141, 0x140276931\nmov     edx, esi                                                       ; +0x145, 0x140276935\nmov     ecx, r13d                                                      ; +0x147, 0x140276937\ncall    GJItemIcon__createBrowserItem                                  ; +0x14a, 0x14027693a\nmov     r14, rax                                                       ; +0x14f, 0x14027693f\ntest    rax, rax                                                       ; +0x152, 0x140276942\njz      loc_140276A6E                                                  ; +0x155, 0x140276945\nmov     ecx, r13d                                                      ; +0x15b, 0x14027694b\ncall    GJItemIcon__scaleForType                                       ; +0x15e, 0x14027694e\nmovaps  xmm7, xmm0                                                     ; +0x163, 0x140276953\nmov     rdx, [r14]                                                     ; +0x166, 0x140276956\nmovaps  xmm1, xmm0                                                     ; +0x169, 0x140276959\nmov     rcx, r14                                                       ; +0x16c, 0x14027695c\ncall    qword ptr [rdx+0A0h]                                           ; +0x16f, 0x14027695f\nmov     ecx, 208h; Size                                                ; +0x175, 0x140276965\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x17a, 0x14027696a\nmov     [rsp+0C8h+var_88], rax                                         ; +0x17f, 0x14027696f\nmov     rcx, rax                                                       ; +0x184, 0x140276974\ncall    CCMenuItemSpriteExtra__CCMenuItemSpriteExtra                   ; +0x187, 0x140276977\nmov     rdi, rax                                                       ; +0x18c, 0x14027697c\ntest    rax, rax                                                       ; +0x18f, 0x14027697f\njz      short loc_1402769B4                                            ; +0x192, 0x140276982\nmov     [rsp+0C8h+var_A8], rbx                                         ; +0x194, 0x140276984\nmov     r9, rbp                                                        ; +0x199, 0x140276989\nxor     r8d, r8d                                                       ; +0x19c, 0x14027698c\nmov     rdx, r14                                                       ; +0x19f, 0x14027698f\nmov     rcx, rax                                                       ; +0x1a2, 0x140276992\ncall    CCMenuItemSpriteExtra__init                                    ; +0x1a5, 0x140276995\nmov     rcx, rdi                                                       ; +0x1aa, 0x14027699a\ntest    al, al                                                         ; +0x1ad, 0x14027699d\njz      short loc_1402769A9                                            ; +0x1af, 0x14027699f\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x1b1, 0x1402769a1\njmp     short loc_1402769B6                                            ; +0x1b7, 0x1402769a7\nmov     rax, [rdi]                                                     ; +0x1b9, 0x1402769a9\nmov     edx, 1                                                         ; +0x1bc, 0x1402769ac\ncall    qword ptr [rax+8]                                              ; +0x1c1, 0x1402769b1\nxor     edi, edi                                                       ; +0x1c4, 0x1402769b4\nmov     rbx, [rdi]                                                     ; +0x1c6, 0x1402769b6\nmov     rcx, [rsp+0C8h+var_98]                                         ; +0x1c9, 0x1402769b9\nmov     rax, [rcx]                                                     ; +0x1ce, 0x1402769be\ncall    qword ptr [rax+130h]                                           ; +0x1d1, 0x1402769c1\nmov     rdx, rax                                                       ; +0x1d7, 0x1402769c7\nmov     rcx, rdi                                                       ; +0x1da, 0x1402769ca\ncall    qword ptr [rbx+128h]                                           ; +0x1dd, 0x1402769cd\nmov     rbx, [r14]                                                     ; +0x1e3, 0x1402769d3\nmov     rax, [rdi]                                                     ; +0x1e6, 0x1402769d6\nmov     rcx, rdi                                                       ; +0x1e9, 0x1402769d9\ncall    qword ptr [rax+130h]                                           ; +0x1ec, 0x1402769dc\nmovss   xmm6, dword ptr [rax+4]                                        ; +0x1f2, 0x1402769e2\nmov     rax, [rdi]                                                     ; +0x1f7, 0x1402769e7\nmov     rcx, rdi                                                       ; +0x1fa, 0x1402769ea\ncall    qword ptr [rax+130h]                                           ; +0x1fd, 0x1402769ed\nmulss   xmm6, xmm9                                                     ; +0x203, 0x1402769f3\nmovss   xmm1, dword ptr [rax]                                          ; +0x208, 0x1402769f8\nmulss   xmm1, xmm9                                                     ; +0x20c, 0x1402769fc\nmovaps  xmm2, xmm6                                                     ; +0x211, 0x140276a01\nlea     rcx, [rsp+0C8h+var_80]                                         ; +0x214, 0x140276a04\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x219, 0x140276a09\nmov     rdx, rax                                                       ; +0x21f, 0x140276a0f\nmov     rcx, r14                                                       ; +0x222, 0x140276a12\ncall    qword ptr [rbx+0B8h]                                           ; +0x225, 0x140276a15\nmov     rax, [rdi]                                                     ; +0x22b, 0x140276a1b\nmov     edx, esi                                                       ; +0x22e, 0x140276a1e\nmov     rcx, rdi                                                       ; +0x230, 0x140276a20\ncall    qword ptr [rax+40h]                                            ; +0x233, 0x140276a23\nmov     eax, [rsp+0C8h+arg_18]                                         ; +0x236, 0x140276a26\nmov     [rdi+200h], eax                                                ; +0x23d, 0x140276a2d\nmov     rdx, rdi                                                       ; +0x243, 0x140276a33\nmov     rbx, [rsp+0C8h+arg_0]                                          ; +0x246, 0x140276a36\nmov     rcx, rbx                                                       ; +0x24e, 0x140276a3e\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x251, 0x140276a41\ncmp     esi, [rsp+0C8h+arg_20]                                         ; +0x257, 0x140276a47\njnz     short loc_140276A57                                            ; +0x25e, 0x140276a4e\nmov     [rbp+228h], rdi                                                ; +0x260, 0x140276a50\ntest    r15b, r15b                                                     ; +0x267, 0x140276a57\njnz     short loc_140276A76                                            ; +0x26a, 0x140276a5a\nmovaps  xmm1, xmm8                                                     ; +0x26c, 0x140276a5c\ndivss   xmm1, xmm7                                                     ; +0x270, 0x140276a60\nmov     rcx, r14                                                       ; +0x274, 0x140276a64\ncall    GJItemIcon__changeToLockedState                                ; +0x277, 0x140276a67\njmp     short loc_140276A76                                            ; +0x27c, 0x140276a6c\nmov     rbx, [rsp+0C8h+arg_0]                                          ; +0x27e, 0x140276a6e\ninc     esi                                                            ; +0x286, 0x140276a76\ncmp     esi, r12d                                                      ; +0x288, 0x140276a78\njle     loc_1402768E0                                                  ; +0x28b, 0x140276a7b\nmov     rax, rbx                                                       ; +0x291, 0x140276a81\njmp     short loc_140276A89                                            ; +0x294, 0x140276a84\nmov     rax, r14                                                       ; +0x296, 0x140276a86\nlea     r11, [rsp+0C8h+var_38]                                         ; +0x299, 0x140276a89\nmov     rbx, [r11+48h]                                                 ; +0x2a1, 0x140276a91\nmovaps  xmm6, xmmword ptr [r11-10h]                                    ; +0x2a5, 0x140276a95\nmovaps  xmm7, [rsp+0C8h+var_58]                                        ; +0x2aa, 0x140276a9a\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x2af, 0x140276a9f\nmovaps  xmm9, xmmword ptr [r11-40h]                                    ; +0x2b4, 0x140276aa4\nmov     rsp, r11                                                       ; +0x2b9, 0x140276aa9\npop     r15                                                            ; +0x2bc, 0x140276aac\npop     r14                                                            ; +0x2be, 0x140276aae\npop     r13                                                            ; +0x2c0, 0x140276ab0\npop     r12                                                            ; +0x2c2, 0x140276ab2\npop     rdi                                                            ; +0x2c4, 0x140276ab4\npop     rsi                                                            ; +0x2c5, 0x140276ab5\npop     rbp                                                            ; +0x2c6, 0x140276ab6\nretn                                                                   ; +0x2c7, 0x140276ab7", "xrefs": ["GJGarageLayer::setupPage @ 0x1402761e8", "GJGarageLayer::getItems_1 @ 0x1402767d0", "<???> @ 0x1406d0f8c"], "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"}