{"type": "func", "start": 5372681360, "end": 5372681691, "name": "RateLevelLayer::selectRating", "pseudocode": "// \n// RateLevelLayer::selectRating from 0x1403c9c90 to 0x1403c9ddb (331 bytes)\n// \n// 3 xrefs:\n// > RateLevelLayer::init @ 0x1403c9c61\n// > RateLevelLayer::init @ 0x1403c994b\n// > <???> @ 0x1406d7a3c\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 RateLevelLayer::selectRating(RateLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // eax\n  unsigned int i; // ebx\n  int *p_m_unknown2; // rcx\n  void (__fastcall *v6)(int *, __int16 *); // r8\n  __int16 *v7; // rdx\n  CCMenuItemSpriteExtra *m_submitButton; // rcx\n  char v9; // al\n  cocos2d::CCNode *v10; // rbx\n  cocos2d::CCComponentContainer *m_pComponentContainer; // rcx\n  __int64 v12; // rcx\n  cocos2d::CCNode_vtbl *v13; // rcx\n  _BYTE v14[3]; // [rsp+30h] [rbp+8h] BYREF\n\n  if ( a2 )\n    v3 = a2->getTag(a2);\n  else\n    v3 = -1;\n  a1->m_levelRate = v3;\n  for ( i = 0; i < cocos2d::CCArray::count(a1->m_difficulties); ++i )\n  {\n    p_m_unknown2 = &cocos2d::CCArray::objectAtIndex(a1->m_difficulties, i)[5].m_unknown2;\n    v6 = **(void (__fastcall ***)(int *, __int16 *))p_m_unknown2;\n    if ( a1->m_levelRate == i )\n    {\n      v7 = &word_140529BCC;\n    }\n    else\n    {\n      memset(v14, 125, sizeof(v14));\n      v7 = (__int16 *)v14;\n    }\n    v6(p_m_unknown2, v7);\n  }\n  m_submitButton = a1->m_submitButton;\n  if ( a1->m_levelRate == -1 )\n  {\n    *(_WORD *)v14 = -22874;\n    v9 = -90;\n  }\n  else\n  {\n    *(_WORD *)v14 = -1;\n    v9 = -1;\n  }\n  v14[2] = v9;\n  v10 = m_submitButton->getNormalImage(m_submitButton);\n  m_pComponentContainer = v10[1].m_pComponentContainer;\n  if ( m_pComponentContainer )\n    ((void (__fastcall *)(cocos2d::CCDictionary **, _BYTE *))m_pComponentContainer[15].m_pComponents->__vftable)(\n      &m_pComponentContainer[15].m_pComponents,\n      v14);\n  v12 = *(_QWORD *)&v10[1].m_bUseChildIndex;\n  if ( v12 )\n    (**(void (__fastcall ***)(__int64, _BYTE *))(v12 + 320))(v12 + 320, v14);\n  v13 = *(cocos2d::CCNode_vtbl **)&v10[2].m_uID;\n  if ( v13 || (v13 = v10[2].__vftable) != nullptr )\n    (*(void (__fastcall **)(__int64, _BYTE *))v13->setVisible)((__int64)&v13->setVisible, v14);\n}", "assembly": "; \n; RateLevelLayer::selectRating from 0x1403c9c90 to 0x1403c9ddb (331 bytes)\n; \n; 3 xrefs:\n; > RateLevelLayer::init @ 0x1403c9c61\n; > RateLevelLayer::init @ 0x1403c994b\n; > <???> @ 0x1406d7a3c\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_8], rbx                                               ; +0x0, 0x1403c9c90\npush    rdi                                                            ; +0x5, 0x1403c9c95\nsub     rsp, 20h                                                       ; +0x6, 0x1403c9c96\nmov     rdi, rcx                                                       ; +0xa, 0x1403c9c9a\ntest    rdx, rdx                                                       ; +0xd, 0x1403c9c9d\njz      short loc_1403C9CAD                                            ; +0x10, 0x1403c9ca0\nmov     rax, [rdx]                                                     ; +0x12, 0x1403c9ca2\nmov     rcx, rdx                                                       ; +0x15, 0x1403c9ca5\ncall    qword ptr [rax+38h]                                            ; +0x18, 0x1403c9ca8\njmp     short loc_1403C9CB2                                            ; +0x1b, 0x1403c9cab\nmov     eax, 0FFFFFFFFh                                                ; +0x1d, 0x1403c9cad\nmov     [rdi+28Ch], eax                                                ; +0x22, 0x1403c9cb2\nxor     ebx, ebx                                                       ; +0x28, 0x1403c9cb8\nmov     rcx, [rdi+280h]                                                ; +0x2a, 0x1403c9cba\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x31, 0x1403c9cc1\ntest    eax, eax                                                       ; +0x37, 0x1403c9cc7\njz      short loc_1403C9D24                                            ; +0x39, 0x1403c9cc9\nnop     dword ptr [rax+rax+00h]                                        ; +0x3b, 0x1403c9ccb\nmov     rcx, [rdi+280h]                                                ; +0x40, 0x1403c9cd0\nmov     edx, ebx                                                       ; +0x47, 0x1403c9cd7\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x49, 0x1403c9cd9\nlea     rcx, [rax+140h]                                                ; +0x4f, 0x1403c9cdf\nmov     rax, [rcx]                                                     ; +0x56, 0x1403c9ce6\nmov     r8, [rax]                                                      ; +0x59, 0x1403c9ce9\ncmp     [rdi+28Ch], ebx                                                ; +0x5c, 0x1403c9cec\njz      short loc_1403C9D07                                            ; +0x62, 0x1403c9cf2\nmov     [rsp+28h+arg_0], 7D7Dh                                         ; +0x64, 0x1403c9cf4\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x6b, 0x1403c9cfb\nmov     [rsp+28h+arg_2], 7Dh ; '}'                                     ; +0x70, 0x1403c9d00\njmp     short loc_1403C9D0E                                            ; +0x75, 0x1403c9d05\nlea     rdx, word_140529BCC                                            ; +0x77, 0x1403c9d07\ncall    r8                                                             ; +0x7e, 0x1403c9d0e\nmov     rcx, [rdi+280h]                                                ; +0x81, 0x1403c9d11\ninc     ebx                                                            ; +0x88, 0x1403c9d18\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x8a, 0x1403c9d1a\ncmp     ebx, eax                                                       ; +0x90, 0x1403c9d20\njb      short loc_1403C9CD0                                            ; +0x92, 0x1403c9d22\ncmp     dword ptr [rdi+28Ch], 0FFFFFFFFh                               ; +0x94, 0x1403c9d24\nmov     rcx, [rdi+278h]                                                ; +0x9b, 0x1403c9d2b\njnz     short loc_1403C9D49                                            ; +0xa2, 0x1403c9d32\nmovzx   eax, cs:word_140529BC8                                         ; +0xa4, 0x1403c9d34\nmov     [rsp+28h+arg_0], ax                                            ; +0xab, 0x1403c9d3b\nmovzx   eax, cs:byte_140529BCA                                         ; +0xb0, 0x1403c9d40\njmp     short loc_1403C9D5C                                            ; +0xb7, 0x1403c9d47\nmovzx   eax, cs:word_140529BCC                                         ; +0xb9, 0x1403c9d49\nmov     [rsp+28h+arg_0], ax                                            ; +0xc0, 0x1403c9d50\nmovzx   eax, cs:byte_140529BCE                                         ; +0xc5, 0x1403c9d55\nmov     [rsp+28h+arg_2], al                                            ; +0xcc, 0x1403c9d5c\nmov     rax, [rcx]                                                     ; +0xd0, 0x1403c9d60\ncall    qword ptr [rax+3A8h]                                           ; +0xd3, 0x1403c9d63\nmov     rbx, rax                                                       ; +0xd9, 0x1403c9d69\nmov     rcx, [rax+270h]                                                ; +0xdc, 0x1403c9d6c\ntest    rcx, rcx                                                       ; +0xe3, 0x1403c9d73\njz      short loc_1403C9D8A                                            ; +0xe6, 0x1403c9d76\nadd     rcx, 170h                                                      ; +0xe8, 0x1403c9d78\nlea     rdx, [rsp+28h+arg_0]                                           ; +0xef, 0x1403c9d7f\nmov     r8, [rcx]                                                      ; +0xf4, 0x1403c9d84\ncall    qword ptr [r8]                                                 ; +0xf7, 0x1403c9d87\nmov     rcx, [rbx+278h]                                                ; +0xfa, 0x1403c9d8a\ntest    rcx, rcx                                                       ; +0x101, 0x1403c9d91\njz      short loc_1403C9DA7                                            ; +0x104, 0x1403c9d94\nadd     rcx, 140h                                                      ; +0x106, 0x1403c9d96\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x10d, 0x1403c9d9d\nmov     rax, [rcx]                                                     ; +0x112, 0x1403c9da2\ncall    qword ptr [rax]                                                ; +0x115, 0x1403c9da5\nmov     rcx, [rbx+288h]                                                ; +0x117, 0x1403c9da7\ntest    rcx, rcx                                                       ; +0x11e, 0x1403c9dae\njnz     short loc_1403C9DBF                                            ; +0x121, 0x1403c9db1\nmov     rcx, [rbx+280h]                                                ; +0x123, 0x1403c9db3\ntest    rcx, rcx                                                       ; +0x12a, 0x1403c9dba\njz      short loc_1403C9DD0                                            ; +0x12d, 0x1403c9dbd\nadd     rcx, 140h                                                      ; +0x12f, 0x1403c9dbf\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x136, 0x1403c9dc6\nmov     rax, [rcx]                                                     ; +0x13b, 0x1403c9dcb\ncall    qword ptr [rax]                                                ; +0x13e, 0x1403c9dce\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x140, 0x1403c9dd0\nadd     rsp, 20h                                                       ; +0x145, 0x1403c9dd5\npop     rdi                                                            ; +0x149, 0x1403c9dd9\nretn                                                                   ; +0x14a, 0x1403c9dda", "xrefs": ["RateLevelLayer::init @ 0x1403c9c61", "RateLevelLayer::init @ 0x1403c994b", "<???> @ 0x1406d7a3c"], "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"}