{"type": "func", "start": 5372684560, "end": 5372685047, "name": "RateStarsLayer::selectRating", "pseudocode": "// \n// RateStarsLayer::selectRating from 0x1403ca910 to 0x1403caaf7 (487 bytes)\n// \n// 6 xrefs:\n// > RateStarsLayer::init @ 0x1403ca880\n// > RateStarsLayer::init @ 0x1403ca479\n// > <???> @ 0x14069badc\n// > <???> @ 0x14069bb18\n// > <???> @ 0x14069bb28\n// > <???> @ 0x1406d7a90\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 RateStarsLayer::selectRating(RateStarsLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // eax\n  int v4; // esi\n  unsigned int i; // r14d\n  struct cocos2d::CCObject *v6; // rbx\n  ButtonSprite *v7; // rdi\n  int v8; // eax\n  const char *v9; // rdx\n  CCMenuItemSpriteExtra *m_submitButton; // rcx\n  char v11; // al\n  cocos2d::CCNode *v12; // rbx\n  cocos2d::CCComponentContainer *m_pComponentContainer; // rcx\n  __int64 v14; // rcx\n  cocos2d::CCNode_vtbl *v15; // rcx\n  int m_starsRate; // eax\n  bool v17; // zf\n  __int16 v18; // [rsp+50h] [rbp+8h] BYREF\n  char v19; // [rsp+52h] [rbp+Ah]\n\n  if ( a2 )\n    v3 = a2->getTag(a2);\n  else\n    v3 = -1;\n  v4 = 0;\n  a1->m_starsRate = v3;\n  for ( i = 0; i < cocos2d::CCArray::count(a1->m_buttons); ++i )\n  {\n    v6 = cocos2d::CCArray::objectAtIndex(a1->m_buttons, i);\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 ( a1->m_starsRate == v8 )\n      v9 = \"GJ_button_01.png\";\n    ButtonSprite::updateBGImage(v7, v9);\n  }\n  m_submitButton = a1->m_submitButton;\n  if ( a1->m_starsRate == -1 )\n  {\n    v18 = -22874;\n    v11 = -90;\n  }\n  else\n  {\n    v18 = -1;\n    v11 = -1;\n  }\n  v19 = v11;\n  v12 = m_submitButton->getNormalImage(m_submitButton);\n  m_pComponentContainer = v12[1].m_pComponentContainer;\n  if ( m_pComponentContainer )\n    ((void (__fastcall *)(cocos2d::CCDictionary **, __int16 *))m_pComponentContainer[15].m_pComponents->__vftable)(\n      &m_pComponentContainer[15].m_pComponents,\n      &v18);\n  v14 = *(_QWORD *)&v12[1].m_bUseChildIndex;\n  if ( v14 )\n    (**(void (__fastcall ***)(__int64, __int16 *))(v14 + 320))(v14 + 320, &v18);\n  v15 = *(cocos2d::CCNode_vtbl **)&v12[2].m_uID;\n  if ( v15 || (v15 = v12[2].__vftable) != nullptr )\n    (*(void (__fastcall **)(__int64, __int16 *))v15->setVisible)((__int64)&v15->setVisible, &v18);\n  m_starsRate = a1->m_starsRate;\n  v17 = m_starsRate == 1;\n  if ( m_starsRate > 1 )\n  {\n    if ( m_starsRate == 2 )\n    {\n      v4 = 1;\n    }\n    else if ( m_starsRate == 3 )\n    {\n      v4 = 2;\n    }\n    else if ( m_starsRate > 5 )\n    {\n      if ( m_starsRate > 7 )\n      {\n        if ( m_starsRate > 9 )\n        {\n          if ( m_starsRate == 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    v17 = m_starsRate == 1;\n  }\n  if ( v17 )\n    v4 = -1;\n  GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v4, Short);\n}", "assembly": "; \n; RateStarsLayer::selectRating from 0x1403ca910 to 0x1403caaf7 (487 bytes)\n; \n; 6 xrefs:\n; > RateStarsLayer::init @ 0x1403ca880\n; > RateStarsLayer::init @ 0x1403ca479\n; > <???> @ 0x14069badc\n; > <???> @ 0x14069bb18\n; > <???> @ 0x14069bb28\n; > <???> @ 0x1406d7a90\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    rbp                                                            ; +0x0, 0x1403ca910\npush    rsi                                                            ; +0x2, 0x1403ca912\npush    r12                                                            ; +0x3, 0x1403ca913\nsub     rsp, 30h                                                       ; +0x5, 0x1403ca915\nmov     [rsp+48h+var_20], r14                                          ; +0x9, 0x1403ca919\nmov     rbp, rcx                                                       ; +0xe, 0x1403ca91e\nmov     r12d, 0FFFFFFFFh                                               ; +0x11, 0x1403ca921\ntest    rdx, rdx                                                       ; +0x17, 0x1403ca927\njz      short loc_1403CA937                                            ; +0x1a, 0x1403ca92a\nmov     rax, [rdx]                                                     ; +0x1c, 0x1403ca92c\nmov     rcx, rdx                                                       ; +0x1f, 0x1403ca92f\ncall    qword ptr [rax+38h]                                            ; +0x22, 0x1403ca932\njmp     short loc_1403CA93A                                            ; +0x25, 0x1403ca935\nmov     eax, r12d                                                      ; +0x27, 0x1403ca937\nmov     [rsp+48h+arg_8], rbx                                           ; +0x2a, 0x1403ca93a\nxor     esi, esi                                                       ; +0x2f, 0x1403ca93f\nmov     [rbp+2A4h], eax                                                ; +0x31, 0x1403ca941\nmov     r14d, esi                                                      ; +0x37, 0x1403ca947\nmov     rcx, [rbp+298h]                                                ; +0x3a, 0x1403ca94a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x41, 0x1403ca951\ntest    eax, eax                                                       ; +0x47, 0x1403ca957\njz      short loc_1403CA9D3                                            ; +0x49, 0x1403ca959\nmov     [rsp+48h+arg_10], rdi                                          ; +0x4b, 0x1403ca95b\nmov     [rsp+48h+var_28], r15                                          ; +0x50, 0x1403ca960\nlea     r15, aGjButton01Png; \"GJ_button_01.png\"                        ; +0x55, 0x1403ca965\nnop     dword ptr [rax+00h]                                            ; +0x5c, 0x1403ca96c\nmov     rcx, [rbp+298h]                                                ; +0x60, 0x1403ca970\nmov     edx, r14d                                                      ; +0x67, 0x1403ca977\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x6a, 0x1403ca97a\nmov     rcx, rax                                                       ; +0x70, 0x1403ca980\nmov     rbx, rax                                                       ; +0x73, 0x1403ca983\nmov     rdx, [rax]                                                     ; +0x76, 0x1403ca986\ncall    qword ptr [rdx+3A8h]                                           ; +0x79, 0x1403ca989\nmov     rdx, [rbx]                                                     ; +0x7f, 0x1403ca98f\nmov     rcx, rbx                                                       ; +0x82, 0x1403ca992\nmov     rdi, rax                                                       ; +0x85, 0x1403ca995\ncall    qword ptr [rdx+38h]                                            ; +0x88, 0x1403ca998\ncmp     [rbp+2A4h], eax                                                ; +0x8b, 0x1403ca99b\nlea     rdx, aGjButton04Png; \"GJ_button_04.png\"                        ; +0x91, 0x1403ca9a1\nmov     rcx, rdi                                                       ; +0x98, 0x1403ca9a8\ncmovz   rdx, r15                                                       ; +0x9b, 0x1403ca9ab\ncall    ButtonSprite__updateBGImage                                    ; +0x9f, 0x1403ca9af\nmov     rcx, [rbp+298h]                                                ; +0xa4, 0x1403ca9b4\ninc     r14d                                                           ; +0xab, 0x1403ca9bb\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xae, 0x1403ca9be\ncmp     r14d, eax                                                      ; +0xb4, 0x1403ca9c4\njb      short loc_1403CA970                                            ; +0xb7, 0x1403ca9c7\nmov     r15, [rsp+48h+var_28]                                          ; +0xb9, 0x1403ca9c9\nmov     rdi, [rsp+48h+arg_10]                                          ; +0xbe, 0x1403ca9ce\nmov     rcx, [rbp+290h]                                                ; +0xc3, 0x1403ca9d3\nmov     r14, [rsp+48h+var_20]                                          ; +0xca, 0x1403ca9da\ncmp     [rbp+2A4h], r12d                                               ; +0xcf, 0x1403ca9df\njnz     short loc_1403CA9FD                                            ; +0xd6, 0x1403ca9e6\nmovzx   eax, cs:word_140529BD0                                         ; +0xd8, 0x1403ca9e8\nmov     [rsp+48h+arg_0], ax                                            ; +0xdf, 0x1403ca9ef\nmovzx   eax, cs:byte_140529BD2                                         ; +0xe4, 0x1403ca9f4\njmp     short loc_1403CAA10                                            ; +0xeb, 0x1403ca9fb\nmovzx   eax, cs:word_140529BD4                                         ; +0xed, 0x1403ca9fd\nmov     [rsp+48h+arg_0], ax                                            ; +0xf4, 0x1403caa04\nmovzx   eax, cs:byte_140529BD6                                         ; +0xf9, 0x1403caa09\nmov     [rsp+48h+arg_2], al                                            ; +0x100, 0x1403caa10\nmov     rax, [rcx]                                                     ; +0x104, 0x1403caa14\ncall    qword ptr [rax+3A8h]                                           ; +0x107, 0x1403caa17\nmov     rbx, rax                                                       ; +0x10d, 0x1403caa1d\nmov     rcx, [rax+270h]                                                ; +0x110, 0x1403caa20\ntest    rcx, rcx                                                       ; +0x117, 0x1403caa27\njz      short loc_1403CAA3E                                            ; +0x11a, 0x1403caa2a\nadd     rcx, 170h                                                      ; +0x11c, 0x1403caa2c\nlea     rdx, [rsp+48h+arg_0]                                           ; +0x123, 0x1403caa33\nmov     r8, [rcx]                                                      ; +0x128, 0x1403caa38\ncall    qword ptr [r8]                                                 ; +0x12b, 0x1403caa3b\nmov     rcx, [rbx+278h]                                                ; +0x12e, 0x1403caa3e\ntest    rcx, rcx                                                       ; +0x135, 0x1403caa45\njz      short loc_1403CAA5B                                            ; +0x138, 0x1403caa48\nadd     rcx, 140h                                                      ; +0x13a, 0x1403caa4a\nlea     rdx, [rsp+48h+arg_0]                                           ; +0x141, 0x1403caa51\nmov     rax, [rcx]                                                     ; +0x146, 0x1403caa56\ncall    qword ptr [rax]                                                ; +0x149, 0x1403caa59\nmov     rcx, [rbx+288h]                                                ; +0x14b, 0x1403caa5b\ntest    rcx, rcx                                                       ; +0x152, 0x1403caa62\njnz     short loc_1403CAA73                                            ; +0x155, 0x1403caa65\nmov     rcx, [rbx+280h]                                                ; +0x157, 0x1403caa67\ntest    rcx, rcx                                                       ; +0x15e, 0x1403caa6e\njz      short loc_1403CAA84                                            ; +0x161, 0x1403caa71\nadd     rcx, 140h                                                      ; +0x163, 0x1403caa73\nlea     rdx, [rsp+48h+arg_0]                                           ; +0x16a, 0x1403caa7a\nmov     rax, [rcx]                                                     ; +0x16f, 0x1403caa7f\ncall    qword ptr [rax]                                                ; +0x172, 0x1403caa82\nmov     eax, [rbp+2A4h]                                                ; +0x174, 0x1403caa84\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x17a, 0x1403caa8a\ncmp     eax, 1                                                         ; +0x17f, 0x1403caa8f\njle     short loc_1403CAADA                                            ; +0x182, 0x1403caa92\ncmp     eax, 2                                                         ; +0x184, 0x1403caa94\njnz     short loc_1403CAA9E                                            ; +0x187, 0x1403caa97\nlea     esi, [rax-1]                                                   ; +0x189, 0x1403caa99\njmp     short loc_1403CAAD7                                            ; +0x18c, 0x1403caa9c\ncmp     eax, 3                                                         ; +0x18e, 0x1403caa9e\njnz     short loc_1403CAAA8                                            ; +0x191, 0x1403caaa1\nlea     esi, [rax-1]                                                   ; +0x193, 0x1403caaa3\njmp     short loc_1403CAAD7                                            ; +0x196, 0x1403caaa6\ncmp     eax, 5                                                         ; +0x198, 0x1403caaa8\njg      short loc_1403CAAB4                                            ; +0x19b, 0x1403caaab\nmov     esi, 3                                                         ; +0x19d, 0x1403caaad\njmp     short loc_1403CAAD7                                            ; +0x1a2, 0x1403caab2\ncmp     eax, 7                                                         ; +0x1a4, 0x1403caab4\njg      short loc_1403CAAC0                                            ; +0x1a7, 0x1403caab7\nmov     esi, 4                                                         ; +0x1a9, 0x1403caab9\njmp     short loc_1403CAAD7                                            ; +0x1ae, 0x1403caabe\ncmp     eax, 9                                                         ; +0x1b0, 0x1403caac0\njg      short loc_1403CAACC                                            ; +0x1b3, 0x1403caac3\nmov     esi, 5                                                         ; +0x1b5, 0x1403caac5\njmp     short loc_1403CAAD7                                            ; +0x1ba, 0x1403caaca\ncmp     eax, 0Ah                                                       ; +0x1bc, 0x1403caacc\nmov     ecx, 6                                                         ; +0x1bf, 0x1403caacf\ncmovz   esi, ecx                                                       ; +0x1c4, 0x1403caad4\ncmp     eax, 1                                                         ; +0x1c7, 0x1403caad7\nmov     rcx, [rbp+2C0h]                                                ; +0x1ca, 0x1403caada\ncmovz   esi, r12d                                                      ; +0x1d1, 0x1403caae1\nmov     edx, esi                                                       ; +0x1d5, 0x1403caae5\nxor     r8d, r8d                                                       ; +0x1d7, 0x1403caae7\nadd     rsp, 30h                                                       ; +0x1da, 0x1403caaea\npop     r12                                                            ; +0x1de, 0x1403caaee\npop     rsi                                                            ; +0x1e0, 0x1403caaf0\npop     rbp                                                            ; +0x1e1, 0x1403caaf1\njmp     GJDifficultySprite__updateDifficultyFrame                      ; +0x1e2, 0x1403caaf2", "xrefs": ["RateStarsLayer::init @ 0x1403ca880", "RateStarsLayer::init @ 0x1403ca479", "<???> @ 0x14069badc", "<???> @ 0x14069bb18", "<???> @ 0x14069bb28", "<???> @ 0x1406d7a90"], "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"}