{"type": "func", "start": 5373493136, "end": 5373493529, "name": "ShareLevelLayer::selectRating", "pseudocode": "// \n// ShareLevelLayer::selectRating from 0x14048ff90 to 0x140490119 (393 bytes)\n// \n// 5 xrefs:\n// > ShareLevelLayer::setupStars @ 0x14048ff3e\n// > ShareLevelLayer::setupStars @ 0x14048fcb8\n// > <???> @ 0x1406a6e34\n// > <???> @ 0x1406a6e68\n// > <???> @ 0x1406dc038\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 ShareLevelLayer::selectRating(ShareLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  int *p_m_starsRequested; // r14\n  int v4; // esi\n  unsigned int v5; // r15d\n  struct cocos2d::CCObject *v6; // rbx\n  ButtonSprite *v7; // rdi\n  int v8; // eax\n  const char *v9; // rdx\n  int v10; // eax\n  const char *CString; // rdi\n  cocos2d::CCString *v12; // rax\n  cocos2d::CCSprite *m_difficultySprite; // rcx\n  cocos2d::CCSprite_vtbl *v14; // rbx\n  cocos2d::CCSpriteFrameCache *v15; // rax\n  struct cocos2d::CCSpriteFrame *v16; // rax\n\n  p_m_starsRequested = &a1->m_starsRequested;\n  if ( a2 )\n    *p_m_starsRequested = a2->getTag(a2);\n  v4 = 0;\n  v5 = 0;\n  if ( cocos2d::CCArray::count(a1->m_starButtons) )\n  {\n    do\n    {\n      v6 = cocos2d::CCArray::objectAtIndex(a1->m_starButtons, v5);\n      v7 = (ButtonSprite *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v6->__vftable[13].copyWithZone)(v6);\n      v8 = v6->getTag(v6);\n      v9 = \"GJ_button_04.png\";\n      if ( *p_m_starsRequested == v8 )\n        v9 = \"GJ_button_01.png\";\n      ButtonSprite::updateBGImage(v7, v9);\n      ++v5;\n    }\n    while ( v5 < cocos2d::CCArray::count(a1->m_starButtons) );\n    p_m_starsRequested = &a1->m_starsRequested;\n  }\n  a1->m_level->m_starsRequested = *p_m_starsRequested;\n  v10 = *p_m_starsRequested;\n  if ( *p_m_starsRequested > 1 )\n  {\n    if ( v10 == 2 )\n    {\n      v4 = 1;\n    }\n    else if ( v10 == 3 )\n    {\n      v4 = 2;\n    }\n    else if ( v10 > 5 )\n    {\n      if ( v10 > 7 )\n      {\n        if ( v10 > 9 )\n        {\n          if ( v10 == 10 )\n            v4 = 6;\n        }\n        else\n        {\n          v4 = 5;\n        }\n      }\n      else\n      {\n        v4 = 4;\n      }\n    }\n    else\n    {\n      v4 = 3;\n    }\n    goto LABEL_23;\n  }\n  if ( v10 != 1 )\n  {\nLABEL_23:\n    v12 = cocos2d::CCString::createWithFormat(\"difficulty_%02d_btn_001.png\", v4);\n    CString = cocos2d::CCString::getCString(v12);\n    goto LABEL_24;\n  }\n  CString = \"difficulty_auto_btn_001.png\";\nLABEL_24:\n  m_difficultySprite = a1->m_difficultySprite;\n  v14 = m_difficultySprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v15 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(m_difficultySprite);\n  v16 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v15, CString);\n  v14->setDisplayFrame(a1->m_difficultySprite, v16);\n}", "assembly": "; \n; ShareLevelLayer::selectRating from 0x14048ff90 to 0x140490119 (393 bytes)\n; \n; 5 xrefs:\n; > ShareLevelLayer::setupStars @ 0x14048ff3e\n; > ShareLevelLayer::setupStars @ 0x14048fcb8\n; > <???> @ 0x1406a6e34\n; > <???> @ 0x1406a6e68\n; > <???> @ 0x1406dc038\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_18], rbx                                              ; +0x0, 0x14048ff90\npush    rbp                                                            ; +0x5, 0x14048ff95\npush    rsi                                                            ; +0x6, 0x14048ff96\npush    rdi                                                            ; +0x7, 0x14048ff97\nsub     rsp, 20h                                                       ; +0x8, 0x14048ff98\nmov     [rsp+38h+arg_8], r14                                           ; +0xc, 0x14048ff9c\nlea     r14, [rcx+280h]                                                ; +0x11, 0x14048ffa1\nmov     [rsp+38h+arg_10], r15                                          ; +0x18, 0x14048ffa8\nmov     rbp, rcx                                                       ; +0x1d, 0x14048ffad\ntest    rdx, rdx                                                       ; +0x20, 0x14048ffb0\njz      short loc_14048FFC1                                            ; +0x23, 0x14048ffb3\nmov     rax, [rdx]                                                     ; +0x25, 0x14048ffb5\nmov     rcx, rdx                                                       ; +0x28, 0x14048ffb8\ncall    qword ptr [rax+38h]                                            ; +0x2b, 0x14048ffbb\nmov     [r14], eax                                                     ; +0x2e, 0x14048ffbe\nmov     rcx, [rbp+288h]                                                ; +0x31, 0x14048ffc1\nxor     esi, esi                                                       ; +0x38, 0x14048ffc8\nmov     r15d, esi                                                      ; +0x3a, 0x14048ffca\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x3d, 0x14048ffcd\ntest    eax, eax                                                       ; +0x43, 0x14048ffd3\njz      short loc_140490052                                            ; +0x45, 0x14048ffd5\nmov     [rsp+38h+arg_0], r12                                           ; +0x47, 0x14048ffd7\nlea     r12, aGjButton01Png; \"GJ_button_01.png\"                        ; +0x4c, 0x14048ffdc\nnop     dword ptr [rax+00h]                                            ; +0x53, 0x14048ffe3\nnop     word ptr [rax+rax+00000000h]                                   ; +0x57, 0x14048ffe7\nmov     rcx, [rbp+288h]                                                ; +0x60, 0x14048fff0\nmov     edx, r15d                                                      ; +0x67, 0x14048fff7\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x6a, 0x14048fffa\nmov     rcx, rax                                                       ; +0x70, 0x140490000\nmov     rbx, rax                                                       ; +0x73, 0x140490003\nmov     rdx, [rax]                                                     ; +0x76, 0x140490006\ncall    qword ptr [rdx+3A8h]                                           ; +0x79, 0x140490009\nmov     rdx, [rbx]                                                     ; +0x7f, 0x14049000f\nmov     rcx, rbx                                                       ; +0x82, 0x140490012\nmov     rdi, rax                                                       ; +0x85, 0x140490015\ncall    qword ptr [rdx+38h]                                            ; +0x88, 0x140490018\ncmp     [r14], eax                                                     ; +0x8b, 0x14049001b\nlea     rdx, aGjButton04Png; \"GJ_button_04.png\"                        ; +0x8e, 0x14049001e\nmov     rcx, rdi                                                       ; +0x95, 0x140490025\ncmovz   rdx, r12                                                       ; +0x98, 0x140490028\ncall    ButtonSprite__updateBGImage                                    ; +0x9c, 0x14049002c\nmov     rcx, [rbp+288h]                                                ; +0xa1, 0x140490031\ninc     r15d                                                           ; +0xa8, 0x140490038\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xab, 0x14049003b\ncmp     r15d, eax                                                      ; +0xb1, 0x140490041\njb      short loc_14048FFF0                                            ; +0xb4, 0x140490044\nmov     r12, [rsp+38h+arg_0]                                           ; +0xb6, 0x140490046\nlea     r14, [rbp+280h]                                                ; +0xbb, 0x14049004b\nmov     eax, [r14]                                                     ; +0xc2, 0x140490052\nmov     rcx, [rbp+278h]                                                ; +0xc5, 0x140490055\nmov     r15, [rsp+38h+arg_10]                                          ; +0xcc, 0x14049005c\nmov     [rcx+3E8h], eax                                                ; +0xd1, 0x140490061\nmov     eax, [r14]                                                     ; +0xd7, 0x140490067\nmov     r14, [rsp+38h+arg_8]                                           ; +0xda, 0x14049006a\ncmp     eax, 1                                                         ; +0xdf, 0x14049006f\njg      short loc_14049007F                                            ; +0xe2, 0x140490072\njnz     short loc_1404900C2                                            ; +0xe4, 0x140490074\nlea     rdi, aDifficultyAuto; \"difficulty_auto_btn_001.png\"            ; +0xe6, 0x140490076\njmp     short loc_1404900DD                                            ; +0xed, 0x14049007d\ncmp     eax, 2                                                         ; +0xef, 0x14049007f\njnz     short loc_140490089                                            ; +0xf2, 0x140490082\nlea     esi, [rax-1]                                                   ; +0xf4, 0x140490084\njmp     short loc_1404900C2                                            ; +0xf7, 0x140490087\ncmp     eax, 3                                                         ; +0xf9, 0x140490089\njnz     short loc_140490093                                            ; +0xfc, 0x14049008c\nlea     esi, [rax-1]                                                   ; +0xfe, 0x14049008e\njmp     short loc_1404900C2                                            ; +0x101, 0x140490091\ncmp     eax, 5                                                         ; +0x103, 0x140490093\njg      short loc_14049009F                                            ; +0x106, 0x140490096\nmov     esi, 3                                                         ; +0x108, 0x140490098\njmp     short loc_1404900C2                                            ; +0x10d, 0x14049009d\ncmp     eax, 7                                                         ; +0x10f, 0x14049009f\njg      short loc_1404900AB                                            ; +0x112, 0x1404900a2\nmov     esi, 4                                                         ; +0x114, 0x1404900a4\njmp     short loc_1404900C2                                            ; +0x119, 0x1404900a9\ncmp     eax, 9                                                         ; +0x11b, 0x1404900ab\njg      short loc_1404900B7                                            ; +0x11e, 0x1404900ae\nmov     esi, 5                                                         ; +0x120, 0x1404900b0\njmp     short loc_1404900C2                                            ; +0x125, 0x1404900b5\ncmp     eax, 0Ah                                                       ; +0x127, 0x1404900b7\nmov     ecx, 6                                                         ; +0x12a, 0x1404900ba\ncmovz   esi, ecx                                                       ; +0x12f, 0x1404900bf\nmov     edx, esi                                                       ; +0x132, 0x1404900c2\nlea     rcx, aDifficulty02dB; \"difficulty_%02d_btn_001.png\"            ; +0x134, 0x1404900c4\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x13b, 0x1404900cb\nmov     rcx, rax                                                       ; +0x141, 0x1404900d1\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x144, 0x1404900d4\nmov     rdi, rax                                                       ; +0x14a, 0x1404900da\nmov     rcx, [rbp+290h]                                                ; +0x14d, 0x1404900dd\nmov     rbx, [rcx]                                                     ; +0x154, 0x1404900e4\ncall    cs:?sharedSpriteFrameCache@CCSpriteFrameCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(void) ; +0x157, 0x1404900e7\nmov     rcx, rax                                                       ; +0x15d, 0x1404900ed\nmov     rdx, rdi                                                       ; +0x160, 0x1404900f0\ncall    cs:?spriteFrameByName@CCSpriteFrameCache@cocos2d@@QEAAPEAVCCSpriteFrame@2@PEBD@Z; cocos2d::CCSpriteFrameCache::spriteFrameByName(char const *) ; +0x163, 0x1404900f3\nmov     rcx, [rbp+290h]                                                ; +0x169, 0x1404900f9\nmov     rdx, rax                                                       ; +0x170, 0x140490100\nmov     rax, [rbx+3E0h]                                                ; +0x173, 0x140490103\nmov     rbx, [rsp+38h+arg_18]                                          ; +0x17a, 0x14049010a\nadd     rsp, 20h                                                       ; +0x17f, 0x14049010f\npop     rdi                                                            ; +0x183, 0x140490113\npop     rsi                                                            ; +0x184, 0x140490114\npop     rbp                                                            ; +0x185, 0x140490115\njmp     rax                                                            ; +0x186, 0x140490116", "xrefs": ["ShareLevelLayer::setupStars @ 0x14048ff3e", "ShareLevelLayer::setupStars @ 0x14048fcb8", "<???> @ 0x1406a6e34", "<???> @ 0x1406a6e68", "<???> @ 0x1406dc038"], "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"}