{"type": "func", "start": 4300236800, "end": 4300237232, "name": "GJRateLevelLayer::onCustomButton", "pseudocode": "// \n// GJRateLevelLayer::onCustomButton from 0x100506800 to 0x1005069b0 (432 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x10095a1f0\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 __fastcall GJRateLevelLayer::onCustomButton(GJRateLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  int v2; // eax\n  UploadActionPopup *v3; // r14\n  int v4; // r14d\n  GameLevelManager *v5; // rax\n  UploadActionPopup *m_uploadPopup; // rax\n  _QWORD v7[2]; // [rsp+8h] [rbp-48h] BYREF\n  void *__p; // [rsp+18h] [rbp-38h]\n  __int128 v9[3]; // [rsp+20h] [rbp-30h] BYREF\n\n  v2 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);\n  if ( v2 != -4 )\n  {\n    if ( v2 != -2 )\n      return;\n    __p = operator new(0x28u);\n    v7[0] = 41;\n    v7[1] = 33;\n    strcpy((char *)__p, \"Do you want to unrate this level?\");\n    v3 = (UploadActionPopup *)FLAlertLayer::create_1(\n                                (int)a1 + 968,\n                                (int)\"Unrate Level\",\n                                (__int64)v7,\n                                (int)\"Cancel\",\n                                (int)\"Unrate\",\n                                COERCE_DOUBLE(1136525312));\n    if ( (v7[0] & 1) != 0 )\n      operator delete(__p);\n    ButtonSprite::updateBGImage(v3->m_button2, \"GJ_button_06.png\");\n    ((void (__fastcall *)(UploadActionPopup *, __int64))v3->setTag)(v3, 4294967293LL);\n    goto LABEL_6;\n  }\n  v4 = (int)((float (__fastcall *)(GJRateLevelLayer *, __int64))a1->getValue)(a1, 0xFFFFFFFFLL);\n  if ( v4 > 0 && a1->m_featureState > 0 )\n  {\n    v5 = GameLevelManager::sharedState();\n    if ( GameLevelManager::updateLevelRankAdmin(v5, a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed, v4) )\n    {\n      GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;\n      m_uploadPopup = a1->m_uploadPopup;\n      if ( m_uploadPopup )\n        m_uploadPopup->m_delegate = nullptr;\n      strcpy((char *)v9, \" Updating rank...\");\n      v3 = (UploadActionPopup *)UploadActionPopup::create((__int64)&a1->UploadPopupDelegate, v9);\n      a1->m_uploadPopup = v3;\n      if ( (v9[0] & 1) != 0 )\n      {\n        operator delete(*(void **)&v9[1]);\n        v3 = a1->m_uploadPopup;\n      }\nLABEL_6:\n      ((void (__fastcall *)(UploadActionPopup *))v3->show)(v3);\n    }\n  }\n}", "assembly": "; \n; GJRateLevelLayer::onCustomButton from 0x100506800 to 0x1005069b0 (432 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x10095a1f0\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, 0x100506800\nmov     rbp, rsp                                                       ; +0x1, 0x100506801\npush    r15                                                            ; +0x4, 0x100506804\npush    r14                                                            ; +0x6, 0x100506806\npush    rbx                                                            ; +0x8, 0x100506808\nsub     rsp, 38h                                                       ; +0x9, 0x100506809\nmov     rbx, rdi                                                       ; +0xd, 0x10050680d\nmov     rax, [rsi]                                                     ; +0x10, 0x100506810\nmov     rdi, rsi                                                       ; +0x13, 0x100506813\ncall    qword ptr [rax+40h]                                            ; +0x16, 0x100506816\ncmp     eax, 0FFFFFFFCh                                                ; +0x19, 0x100506819\njz      loc_1005068DC                                                  ; +0x1c, 0x10050681c\ncmp     eax, 0FFFFFFFEh                                                ; +0x22, 0x100506822\njnz     loc_1005069A5                                                  ; +0x25, 0x100506825\nadd     rbx, 3C8h                                                      ; +0x2b, 0x10050682b\nmov     edi, 28h ; '('; __sz                                           ; +0x32, 0x100506832\ncall    __Znwm; operator new(ulong)                                    ; +0x37, 0x100506837\nlea     r15, [rbp+__p]                                                 ; +0x3c, 0x10050683c\nmov     [rbp+__p], rax                                                 ; +0x40, 0x100506840\nmov     [rbp+var_48], 29h ; ')'                                        ; +0x44, 0x100506844\nmov     [rbp+var_40], 21h ; '!'                                        ; +0x4c, 0x10050684c\nmovups  xmm0, xmmword ptr cs:aDoYouWantToUnr+10h; \"nrate this level?\"  ; +0x54, 0x100506854\nmovups  xmmword ptr [rax+10h], xmm0                                    ; +0x5b, 0x10050685b\nmovups  xmm0, xmmword ptr cs:aDoYouWantToUnr; \"Do you want to unrate this level?\" ; +0x5f, 0x10050685f\nmovups  xmmword ptr [rax], xmm0                                        ; +0x66, 0x100506866\nmov     word ptr [rax+20h], 3Fh ; '?'                                  ; +0x69, 0x100506869\nlea     rsi, aUnrateLevel; \"Unrate Level\"                              ; +0x6f, 0x10050686f\nlea     rcx, aCancel; \"Cancel\"                                         ; +0x76, 0x100506876\nlea     r8, aUnrate; \"Unrate\"                                          ; +0x7d, 0x10050687d\nlea     rdx, [rbp+var_48]                                              ; +0x84, 0x100506884\nmovss   xmm0, cs:dword_1008152BC                                       ; +0x88, 0x100506888\nmov     rdi, rbx                                                       ; +0x90, 0x100506890\ncall    FLAlertLayer__create_1                                         ; +0x93, 0x100506893\nmov     r14, rax                                                       ; +0x98, 0x100506898\ntest    byte ptr [rbp+var_48], 1                                       ; +0x9b, 0x10050689b\njz      short loc_1005068AA                                            ; +0x9f, 0x10050689f\nmov     rdi, [rbp+__p]; __p                                            ; +0xa1, 0x1005068a1\ncall    __ZdlPv; operator delete(void *)                               ; +0xa5, 0x1005068a5\nmov     rdi, [r14+258h]                                                ; +0xaa, 0x1005068aa\nlea     rsi, aGjButton06Png; \"GJ_button_06.png\"                        ; +0xb1, 0x1005068b1\ncall    ButtonSprite__updateBGImage                                    ; +0xb8, 0x1005068b8\nmov     rax, [r14]                                                     ; +0xbd, 0x1005068bd\nmov     rdi, r14                                                       ; +0xc0, 0x1005068c0\nmov     esi, 0FFFFFFFDh                                                ; +0xc3, 0x1005068c3\ncall    qword ptr [rax+48h]                                            ; +0xc8, 0x1005068c8\nmov     rax, [r14]                                                     ; +0xcb, 0x1005068cb\nmov     rdi, r14                                                       ; +0xce, 0x1005068ce\ncall    qword ptr [rax+508h]                                           ; +0xd1, 0x1005068d1\njmp     loc_1005069A5                                                  ; +0xd7, 0x1005068d7\nmov     rax, [rbx]                                                     ; +0xdc, 0x1005068dc\nmov     rdi, rbx                                                       ; +0xdf, 0x1005068df\nmov     esi, 0FFFFFFFFh                                                ; +0xe2, 0x1005068e2\ncall    qword ptr [rax+598h]                                           ; +0xe7, 0x1005068e7\ncvttss2si r14d, xmm0                                                   ; +0xed, 0x1005068ed\ntest    r14d, r14d                                                     ; +0xf2, 0x1005068f2\njle     loc_1005069A5                                                  ; +0xf5, 0x1005068f5\ncmp     dword ptr [rbx+410h], 0                                        ; +0xfb, 0x1005068fb\njle     loc_1005069A5                                                  ; +0x102, 0x100506902\ncall    GameLevelManager__sharedState                                  ; +0x108, 0x100506908\nmov     rcx, [rbx+3D0h]                                                ; +0x10d, 0x10050690d\nmov     esi, [rcx+148h]                                                ; +0x114, 0x100506914\nsub     esi, [rcx+14Ch]                                                ; +0x11a, 0x10050691a\nmov     rdi, rax                                                       ; +0x120, 0x100506920\nmov     edx, r14d                                                      ; +0x123, 0x100506923\ncall    GameLevelManager__updateLevelRankAdmin                         ; +0x126, 0x100506926\ntest    al, al                                                         ; +0x12b, 0x10050692b\njz      short loc_1005069A5                                            ; +0x12d, 0x10050692d\ncall    GameLevelManager__sharedState                                  ; +0x12f, 0x10050692f\nlea     rcx, [rbx+3B8h]                                                ; +0x134, 0x100506934\nmov     [rax+328h], rcx                                                ; +0x13b, 0x10050693b\nmov     rax, [rbx+400h]                                                ; +0x142, 0x100506942\ntest    rax, rax                                                       ; +0x149, 0x100506949\njz      short loc_100506959                                            ; +0x14c, 0x10050694c\nmov     qword ptr [rax+278h], 0                                        ; +0x14e, 0x10050694e\nlea     rdi, [rbx+3B0h]                                                ; +0x159, 0x100506959\nmov     [rbp+var_30], 20h ; ' '                                        ; +0x160, 0x100506960\nmovups  xmm0, xmmword ptr cs:aUpdatingRank; \"Updating rank...\"         ; +0x164, 0x100506964\nmovups  xmmword ptr [rbp+var_30+1], xmm0                               ; +0x16b, 0x10050696b\nmov     [rbp+var_30+11h], 0                                            ; +0x16f, 0x10050696f\nlea     rsi, [rbp+var_30]                                              ; +0x173, 0x100506973\ncall    UploadActionPopup__create                                      ; +0x177, 0x100506977\nmov     r14, rax                                                       ; +0x17c, 0x10050697c\nmov     [rbx+400h], rax                                                ; +0x17f, 0x10050697f\ntest    [rbp+var_30], 1                                                ; +0x186, 0x100506986\njz      loc_1005068CB                                                  ; +0x18a, 0x10050698a\nmov     rdi, qword ptr [rbp+var_30+10h]; __p                           ; +0x190, 0x100506990\ncall    __ZdlPv; operator delete(void *)                               ; +0x194, 0x100506994\nmov     r14, [rbx+400h]                                                ; +0x199, 0x100506999\njmp     loc_1005068CB                                                  ; +0x1a0, 0x1005069a0\nadd     rsp, 38h                                                       ; +0x1a5, 0x1005069a5\npop     rbx                                                            ; +0x1a9, 0x1005069a9\npop     r14                                                            ; +0x1aa, 0x1005069aa\npop     r15                                                            ; +0x1ac, 0x1005069ac\npop     rbp                                                            ; +0x1ae, 0x1005069ae\nretn                                                                   ; +0x1af, 0x1005069af", "xrefs": ["<???> @ 0x10095a1f0"], "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"}