{"type": "func", "start": 5371816128, "end": 5371816615, "name": "GJRateLevelLayer::selectRating", "pseudocode": "// \n// GJRateLevelLayer::selectRating from 0x1402f68c0 to 0x1402f6aa7 (487 bytes)\n// \n// 6 xrefs:\n// > GJRateLevelLayer::init @ 0x1402f540c\n// > GJRateLevelLayer::init @ 0x1402f4c88\n// > <???> @ 0x140690618\n// > <???> @ 0x140690654\n// > <???> @ 0x140690664\n// > <???> @ 0x1406d4028\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 GJRateLevelLayer::selectRating(GJRateLevelLayer *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_stars; // 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_stars = v3;\n  for ( i = 0; i < cocos2d::CCArray::count(a1->m_starButtons); ++i )\n  {\n    v6 = cocos2d::CCArray::objectAtIndex(a1->m_starButtons, 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_stars == v8 )\n      v9 = \"GJ_button_01.png\";\n    ButtonSprite::updateBGImage(v7, v9);\n  }\n  m_submitButton = a1->m_submitButton;\n  if ( a1->m_stars == -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_stars = a1->m_stars;\n  v17 = m_stars == 1;\n  if ( m_stars > 1 )\n  {\n    if ( m_stars == 2 )\n    {\n      v4 = 1;\n    }\n    else if ( m_stars == 3 )\n    {\n      v4 = 2;\n    }\n    else if ( m_stars > 5 )\n    {\n      if ( m_stars > 7 )\n      {\n        if ( m_stars > 9 )\n        {\n          if ( m_stars == 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_stars == 1;\n  }\n  if ( v17 )\n    v4 = -1;\n  GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v4, Short);\n}", "assembly": "; \n; GJRateLevelLayer::selectRating from 0x1402f68c0 to 0x1402f6aa7 (487 bytes)\n; \n; 6 xrefs:\n; > GJRateLevelLayer::init @ 0x1402f540c\n; > GJRateLevelLayer::init @ 0x1402f4c88\n; > <???> @ 0x140690618\n; > <???> @ 0x140690654\n; > <???> @ 0x140690664\n; > <???> @ 0x1406d4028\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, 0x1402f68c0\npush    rsi                                                            ; +0x2, 0x1402f68c2\npush    r12                                                            ; +0x3, 0x1402f68c3\nsub     rsp, 30h                                                       ; +0x5, 0x1402f68c5\nmov     [rsp+48h+var_20], r14                                          ; +0x9, 0x1402f68c9\nmov     rbp, rcx                                                       ; +0xe, 0x1402f68ce\nmov     r12d, 0FFFFFFFFh                                               ; +0x11, 0x1402f68d1\ntest    rdx, rdx                                                       ; +0x17, 0x1402f68d7\njz      short loc_1402F68E7                                            ; +0x1a, 0x1402f68da\nmov     rax, [rdx]                                                     ; +0x1c, 0x1402f68dc\nmov     rcx, rdx                                                       ; +0x1f, 0x1402f68df\ncall    qword ptr [rax+38h]                                            ; +0x22, 0x1402f68e2\njmp     short loc_1402F68EA                                            ; +0x25, 0x1402f68e5\nmov     eax, r12d                                                      ; +0x27, 0x1402f68e7\nmov     [rsp+48h+arg_8], rbx                                           ; +0x2a, 0x1402f68ea\nxor     esi, esi                                                       ; +0x2f, 0x1402f68ef\nmov     [rbp+3E8h], eax                                                ; +0x31, 0x1402f68f1\nmov     r14d, esi                                                      ; +0x37, 0x1402f68f7\nmov     rcx, [rbp+3E0h]                                                ; +0x3a, 0x1402f68fa\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x41, 0x1402f6901\ntest    eax, eax                                                       ; +0x47, 0x1402f6907\njz      short loc_1402F6983                                            ; +0x49, 0x1402f6909\nmov     [rsp+48h+arg_10], rdi                                          ; +0x4b, 0x1402f690b\nmov     [rsp+48h+var_28], r15                                          ; +0x50, 0x1402f6910\nlea     r15, aGjButton01Png; \"GJ_button_01.png\"                        ; +0x55, 0x1402f6915\nnop     dword ptr [rax+00h]                                            ; +0x5c, 0x1402f691c\nmov     rcx, [rbp+3E0h]                                                ; +0x60, 0x1402f6920\nmov     edx, r14d                                                      ; +0x67, 0x1402f6927\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x6a, 0x1402f692a\nmov     rcx, rax                                                       ; +0x70, 0x1402f6930\nmov     rbx, rax                                                       ; +0x73, 0x1402f6933\nmov     rdx, [rax]                                                     ; +0x76, 0x1402f6936\ncall    qword ptr [rdx+3A8h]                                           ; +0x79, 0x1402f6939\nmov     rdx, [rbx]                                                     ; +0x7f, 0x1402f693f\nmov     rcx, rbx                                                       ; +0x82, 0x1402f6942\nmov     rdi, rax                                                       ; +0x85, 0x1402f6945\ncall    qword ptr [rdx+38h]                                            ; +0x88, 0x1402f6948\ncmp     [rbp+3E8h], eax                                                ; +0x8b, 0x1402f694b\nlea     rdx, aGjButton04Png; \"GJ_button_04.png\"                        ; +0x91, 0x1402f6951\nmov     rcx, rdi                                                       ; +0x98, 0x1402f6958\ncmovz   rdx, r15                                                       ; +0x9b, 0x1402f695b\ncall    ButtonSprite__updateBGImage                                    ; +0x9f, 0x1402f695f\nmov     rcx, [rbp+3E0h]                                                ; +0xa4, 0x1402f6964\ninc     r14d                                                           ; +0xab, 0x1402f696b\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xae, 0x1402f696e\ncmp     r14d, eax                                                      ; +0xb4, 0x1402f6974\njb      short loc_1402F6920                                            ; +0xb7, 0x1402f6977\nmov     r15, [rsp+48h+var_28]                                          ; +0xb9, 0x1402f6979\nmov     rdi, [rsp+48h+arg_10]                                          ; +0xbe, 0x1402f697e\nmov     rcx, [rbp+3D8h]                                                ; +0xc3, 0x1402f6983\nmov     r14, [rsp+48h+var_20]                                          ; +0xca, 0x1402f698a\ncmp     [rbp+3E8h], r12d                                               ; +0xcf, 0x1402f698f\njnz     short loc_1402F69AD                                            ; +0xd6, 0x1402f6996\nmovzx   eax, cs:word_140529B2C                                         ; +0xd8, 0x1402f6998\nmov     [rsp+48h+arg_0], ax                                            ; +0xdf, 0x1402f699f\nmovzx   eax, cs:byte_140529B2E                                         ; +0xe4, 0x1402f69a4\njmp     short loc_1402F69C0                                            ; +0xeb, 0x1402f69ab\nmovzx   eax, cs:word_140529B34                                         ; +0xed, 0x1402f69ad\nmov     [rsp+48h+arg_0], ax                                            ; +0xf4, 0x1402f69b4\nmovzx   eax, cs:byte_140529B36                                         ; +0xf9, 0x1402f69b9\nmov     [rsp+48h+arg_2], al                                            ; +0x100, 0x1402f69c0\nmov     rax, [rcx]                                                     ; +0x104, 0x1402f69c4\ncall    qword ptr [rax+3A8h]                                           ; +0x107, 0x1402f69c7\nmov     rbx, rax                                                       ; +0x10d, 0x1402f69cd\nmov     rcx, [rax+270h]                                                ; +0x110, 0x1402f69d0\ntest    rcx, rcx                                                       ; +0x117, 0x1402f69d7\njz      short loc_1402F69EE                                            ; +0x11a, 0x1402f69da\nadd     rcx, 170h                                                      ; +0x11c, 0x1402f69dc\nlea     rdx, [rsp+48h+arg_0]                                           ; +0x123, 0x1402f69e3\nmov     r8, [rcx]                                                      ; +0x128, 0x1402f69e8\ncall    qword ptr [r8]                                                 ; +0x12b, 0x1402f69eb\nmov     rcx, [rbx+278h]                                                ; +0x12e, 0x1402f69ee\ntest    rcx, rcx                                                       ; +0x135, 0x1402f69f5\njz      short loc_1402F6A0B                                            ; +0x138, 0x1402f69f8\nadd     rcx, 140h                                                      ; +0x13a, 0x1402f69fa\nlea     rdx, [rsp+48h+arg_0]                                           ; +0x141, 0x1402f6a01\nmov     rax, [rcx]                                                     ; +0x146, 0x1402f6a06\ncall    qword ptr [rax]                                                ; +0x149, 0x1402f6a09\nmov     rcx, [rbx+288h]                                                ; +0x14b, 0x1402f6a0b\ntest    rcx, rcx                                                       ; +0x152, 0x1402f6a12\njnz     short loc_1402F6A23                                            ; +0x155, 0x1402f6a15\nmov     rcx, [rbx+280h]                                                ; +0x157, 0x1402f6a17\ntest    rcx, rcx                                                       ; +0x15e, 0x1402f6a1e\njz      short loc_1402F6A34                                            ; +0x161, 0x1402f6a21\nadd     rcx, 140h                                                      ; +0x163, 0x1402f6a23\nlea     rdx, [rsp+48h+arg_0]                                           ; +0x16a, 0x1402f6a2a\nmov     rax, [rcx]                                                     ; +0x16f, 0x1402f6a2f\ncall    qword ptr [rax]                                                ; +0x172, 0x1402f6a32\nmov     eax, [rbp+3E8h]                                                ; +0x174, 0x1402f6a34\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x17a, 0x1402f6a3a\ncmp     eax, 1                                                         ; +0x17f, 0x1402f6a3f\njle     short loc_1402F6A8A                                            ; +0x182, 0x1402f6a42\ncmp     eax, 2                                                         ; +0x184, 0x1402f6a44\njnz     short loc_1402F6A4E                                            ; +0x187, 0x1402f6a47\nlea     esi, [rax-1]                                                   ; +0x189, 0x1402f6a49\njmp     short loc_1402F6A87                                            ; +0x18c, 0x1402f6a4c\ncmp     eax, 3                                                         ; +0x18e, 0x1402f6a4e\njnz     short loc_1402F6A58                                            ; +0x191, 0x1402f6a51\nlea     esi, [rax-1]                                                   ; +0x193, 0x1402f6a53\njmp     short loc_1402F6A87                                            ; +0x196, 0x1402f6a56\ncmp     eax, 5                                                         ; +0x198, 0x1402f6a58\njg      short loc_1402F6A64                                            ; +0x19b, 0x1402f6a5b\nmov     esi, 3                                                         ; +0x19d, 0x1402f6a5d\njmp     short loc_1402F6A87                                            ; +0x1a2, 0x1402f6a62\ncmp     eax, 7                                                         ; +0x1a4, 0x1402f6a64\njg      short loc_1402F6A70                                            ; +0x1a7, 0x1402f6a67\nmov     esi, 4                                                         ; +0x1a9, 0x1402f6a69\njmp     short loc_1402F6A87                                            ; +0x1ae, 0x1402f6a6e\ncmp     eax, 9                                                         ; +0x1b0, 0x1402f6a70\njg      short loc_1402F6A7C                                            ; +0x1b3, 0x1402f6a73\nmov     esi, 5                                                         ; +0x1b5, 0x1402f6a75\njmp     short loc_1402F6A87                                            ; +0x1ba, 0x1402f6a7a\ncmp     eax, 0Ah                                                       ; +0x1bc, 0x1402f6a7c\nmov     ecx, 6                                                         ; +0x1bf, 0x1402f6a7f\ncmovz   esi, ecx                                                       ; +0x1c4, 0x1402f6a84\ncmp     eax, 1                                                         ; +0x1c7, 0x1402f6a87\nmov     rcx, [rbp+400h]                                                ; +0x1ca, 0x1402f6a8a\ncmovz   esi, r12d                                                      ; +0x1d1, 0x1402f6a91\nmov     edx, esi                                                       ; +0x1d5, 0x1402f6a95\nxor     r8d, r8d                                                       ; +0x1d7, 0x1402f6a97\nadd     rsp, 30h                                                       ; +0x1da, 0x1402f6a9a\npop     r12                                                            ; +0x1de, 0x1402f6a9e\npop     rsi                                                            ; +0x1e0, 0x1402f6aa0\npop     rbp                                                            ; +0x1e1, 0x1402f6aa1\njmp     GJDifficultySprite__updateDifficultyFrame                      ; +0x1e2, 0x1402f6aa2", "xrefs": ["GJRateLevelLayer::init @ 0x1402f540c", "GJRateLevelLayer::init @ 0x1402f4c88", "<???> @ 0x140690618", "<???> @ 0x140690654", "<???> @ 0x140690664", "<???> @ 0x1406d4028"], "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"}