{"type": "func", "start": 5371811024, "end": 5371811652, "name": "GJRateLevelLayer::onCustomButton", "pseudocode": "// \n// GJRateLevelLayer::onCustomButton from 0x1402f54d0 to 0x1402f5744 (628 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x140586b48\n// > <???> @ 0x1406d3fe0\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\n// Hidden C++ exception states: #wind=3\nvoid GJRateLevelLayer::onCustomButton(GJRateLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // eax\n  int v4; // ebx\n  __int64 v5; // rax\n  FLAlertLayer *v6; // rbx\n  void (__fastcall **v7)(UploadActionPopup *); // rdx\n  UploadActionPopup *v8; // rcx\n  __int64 v9; // rax\n  UploadActionPopup *m_uploadPopup; // rcx\n  UploadActionPopup *v11; // rax\n  __int128 v12; // [rsp+50h] [rbp-48h] BYREF\n  __int64 v13; // [rsp+60h] [rbp-38h]\n  __int64 v14; // [rsp+68h] [rbp-30h]\n  char v15[40]; // [rsp+70h] [rbp-28h] BYREF\n  void *v16; // [rsp+A8h] [rbp+10h]\n  void *v17; // [rsp+A8h] [rbp+10h]\n\n  v3 = a2->getTag(a2);\n  if ( v3 != -4 )\n  {\n    if ( v3 != -2 )\n      return;\n    v4 = (_DWORD)a1 + 960;\n    if ( !a1 )\n      v4 = 0;\n    v12 = 0;\n    *(_QWORD *)&v12 = sub_14003AA10(0x30u);\n    v13 = 33;\n    v14 = 47;\n    strcpy((char *)v12, \"Do you want to unrate this level?\");\n    v5 = sub_14003BDB0((__int64)v15, (__int64)&v12);\n    v6 = FLAlertLayer::create(\n           v4,\n           (int)\"Unrate Level\",\n           v5,\n           (__int64)\"Cancel\",\n           (__int64)\"Unrate\",\n           1136525312,\n           0,\n           0,\n           1065353216);\n    sub_14003A830((__int64)&v12);\n    ButtonSprite::updateBGImage(v6->m_button2, \"GJ_button_06.png\");\n    v6->setTag(v6, -3);\n    v7 = (void (__fastcall **)(UploadActionPopup *))v6->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v8 = (UploadActionPopup *)v6;\n    goto LABEL_15;\n  }\n  if ( (int)a1->getValue(a1, -1) > 0 && a1->m_featureState > 0 )\n  {\n    v9 = qword_1406C2EC0;\n    if ( !qword_1406C2EC0 )\n    {\n      v16 = operator new(0x3D0u);\n      qword_1406C2EC0 = sub_140141280((__int64)v16);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n      v9 = qword_1406C2EC0;\n    }\n    if ( !v9 )\n    {\n      v17 = operator new(0x3D0u);\n      qword_1406C2EC0 = sub_140141280((__int64)v17);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n      v9 = qword_1406C2EC0;\n    }\n    *(_QWORD *)(v9 + 808) = &a1->UploadActionDelegate;\n    m_uploadPopup = a1->m_uploadPopup;\n    if ( m_uploadPopup )\n      m_uploadPopup->m_delegate = nullptr;\n    v12 = 0;\n    *(_QWORD *)&v12 = sub_14003AA10(0x20u);\n    v13 = 16;\n    v14 = 31;\n    strcpy((char *)v12, \"Updating rank...\");\n    v11 = (UploadActionPopup *)UploadActionPopup::create((__int64)&a1->UploadPopupDelegate, (__int64)&v12);\n    a1->m_uploadPopup = v11;\n    v7 = (void (__fastcall **)(UploadActionPopup *))v11->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v8 = v11;\nLABEL_15:\n    v7[130](v8);\n  }\n}", "assembly": "; \n; GJRateLevelLayer::onCustomButton from 0x1402f54d0 to 0x1402f5744 (628 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x140586b48\n; > <???> @ 0x1406d3fe0\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_0], rbx                                               ; +0x0, 0x1402f54d0\npush    rdi                                                            ; +0x5, 0x1402f54d5\nsub     rsp, 90h                                                       ; +0x6, 0x1402f54d6\nmov     rdi, rcx                                                       ; +0xd, 0x1402f54dd\nmov     rax, [rdx]                                                     ; +0x10, 0x1402f54e0\nmov     rcx, rdx                                                       ; +0x13, 0x1402f54e3\ncall    qword ptr [rax+38h]                                            ; +0x16, 0x1402f54e6\ncmp     eax, 0FFFFFFFCh                                                ; +0x19, 0x1402f54e9\njz      loc_1402F5608                                                  ; +0x1c, 0x1402f54ec\ncmp     eax, 0FFFFFFFEh                                                ; +0x22, 0x1402f54f2\njnz     loc_1402F5733                                                  ; +0x25, 0x1402f54f5\nlea     rbx, [rdi+3C0h]                                                ; +0x2b, 0x1402f54fb\nxor     eax, eax                                                       ; +0x32, 0x1402f5502\ntest    rdi, rdi                                                       ; +0x34, 0x1402f5504\ncmovz   rbx, rax                                                       ; +0x37, 0x1402f5507\nxorps   xmm0, xmm0                                                     ; +0x3b, 0x1402f550b\nmovups  [rsp+98h+var_48], xmm0                                         ; +0x3e, 0x1402f550e\nmov     [rsp+98h+var_38], rax                                          ; +0x43, 0x1402f5513\nmov     [rsp+98h+var_30], 0Fh                                          ; +0x48, 0x1402f5518\nlea     ecx, [rax+30h]                                                 ; +0x51, 0x1402f5521\ncall    sub_14003AA10                                                  ; +0x54, 0x1402f5524\nmov     qword ptr [rsp+98h+var_48], rax                                ; +0x59, 0x1402f5529\nmov     [rsp+98h+var_38], 21h ; '!'                                    ; +0x5e, 0x1402f552e\nmov     [rsp+98h+var_30], 2Fh ; '/'                                    ; +0x67, 0x1402f5537\nmovups  xmm0, cs:xmmword_1405864D0                                     ; +0x70, 0x1402f5540\nmovups  xmmword ptr [rax], xmm0                                        ; +0x77, 0x1402f5547\nmovups  xmm1, cs:xmmword_1405864E0                                     ; +0x7a, 0x1402f554a\nmovups  xmmword ptr [rax+10h], xmm1                                    ; +0x81, 0x1402f5551\nmovzx   ecx, cs:byte_1405864F0                                         ; +0x85, 0x1402f5555\nmov     [rax+20h], cl                                                  ; +0x8c, 0x1402f555c\nmov     byte ptr [rax+21h], 0                                          ; +0x8f, 0x1402f555f\nlea     rax, [rsp+98h+var_48]                                          ; +0x93, 0x1402f5563\nmov     [rsp+98h+arg_8], rax                                           ; +0x98, 0x1402f5568\nlea     rdx, [rsp+98h+var_48]                                          ; +0xa0, 0x1402f5570\nlea     rcx, [rsp+98h+var_28]                                          ; +0xa5, 0x1402f5575\ncall    sub_14003BDB0                                                  ; +0xaa, 0x1402f557a\nmovss   xmm0, cs:flt_140622C24                                         ; +0xaf, 0x1402f557f\nmovss   [rsp+98h+var_58], xmm0                                         ; +0xb7, 0x1402f5587\nxorps   xmm1, xmm1                                                     ; +0xbd, 0x1402f558d\nmovss   [rsp+98h+var_60], xmm1                                         ; +0xc0, 0x1402f5590\nmov     [rsp+98h+var_68], 0                                            ; +0xc6, 0x1402f5596\nmovss   xmm0, cs:dword_140623478                                       ; +0xcb, 0x1402f559b\nmovss   [rsp+98h+var_70], xmm0                                         ; +0xd3, 0x1402f55a3\nlea     rcx, aUnrate; \"Unrate\"                                         ; +0xd9, 0x1402f55a9\nmov     [rsp+98h+var_78], rcx                                          ; +0xe0, 0x1402f55b0\nlea     r9, aCancel; \"Cancel\"                                          ; +0xe5, 0x1402f55b5\nmov     r8, rax                                                        ; +0xec, 0x1402f55bc\nlea     rdx, aUnrateLevel; \"Unrate Level\"                              ; +0xef, 0x1402f55bf\nmov     rcx, rbx                                                       ; +0xf6, 0x1402f55c6\ncall    FLAlertLayer__create                                           ; +0xf9, 0x1402f55c9\nmov     rbx, rax                                                       ; +0xfe, 0x1402f55ce\nlea     rcx, [rsp+98h+var_48]                                          ; +0x101, 0x1402f55d1\ncall    sub_14003A830                                                  ; +0x106, 0x1402f55d6\nlea     rdx, aGjButton06Png; \"GJ_button_06.png\"                        ; +0x10b, 0x1402f55db\nmov     rcx, [rbx+258h]                                                ; +0x112, 0x1402f55e2\ncall    ButtonSprite__updateBGImage                                    ; +0x119, 0x1402f55e9\nmov     r8, [rbx]                                                      ; +0x11e, 0x1402f55ee\nmov     edx, 0FFFFFFFDh                                                ; +0x121, 0x1402f55f1\nmov     rcx, rbx                                                       ; +0x126, 0x1402f55f6\ncall    qword ptr [r8+40h]                                             ; +0x129, 0x1402f55f9\nmov     rdx, [rbx]                                                     ; +0x12d, 0x1402f55fd\nmov     rcx, rbx                                                       ; +0x130, 0x1402f5600\njmp     loc_1402F572D                                                  ; +0x133, 0x1402f5603\nmov     rax, [rdi]                                                     ; +0x138, 0x1402f5608\nmov     edx, 0FFFFFFFFh                                                ; +0x13b, 0x1402f560b\nmov     rcx, rdi                                                       ; +0x140, 0x1402f5610\ncall    qword ptr [rax+470h]                                           ; +0x143, 0x1402f5613\ncvttss2si eax, xmm0                                                    ; +0x149, 0x1402f5619\ntest    eax, eax                                                       ; +0x14d, 0x1402f561d\njle     loc_1402F5733                                                  ; +0x14f, 0x1402f561f\ncmp     dword ptr [rdi+408h], 0                                        ; +0x155, 0x1402f5625\njle     loc_1402F5733                                                  ; +0x15c, 0x1402f562c\nmov     rax, cs:qword_1406C2EC0                                        ; +0x162, 0x1402f5632\ntest    rax, rax                                                       ; +0x169, 0x1402f5639\njnz     short loc_1402F5670                                            ; +0x16c, 0x1402f563c\nmov     ecx, 3D0h; Size                                                ; +0x16e, 0x1402f563e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x173, 0x1402f5643\nmov     [rsp+98h+arg_8], rax                                           ; +0x178, 0x1402f5648\nmov     rcx, rax                                                       ; +0x180, 0x1402f5650\ncall    sub_140141280                                                  ; +0x183, 0x1402f5653\nnop                                                                    ; +0x188, 0x1402f5658\nmov     cs:qword_1406C2EC0, rax                                        ; +0x189, 0x1402f5659\nmov     rdx, [rax]                                                     ; +0x190, 0x1402f5660\nmov     rcx, rax                                                       ; +0x193, 0x1402f5663\ncall    qword ptr [rdx+48h]                                            ; +0x196, 0x1402f5666\nmov     rax, cs:qword_1406C2EC0                                        ; +0x199, 0x1402f5669\nlea     rbx, [rdi+3B0h]                                                ; +0x1a0, 0x1402f5670\ntest    rax, rax                                                       ; +0x1a7, 0x1402f5677\njnz     short loc_1402F56AE                                            ; +0x1aa, 0x1402f567a\nmov     ecx, 3D0h; Size                                                ; +0x1ac, 0x1402f567c\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1b1, 0x1402f5681\nmov     [rsp+98h+arg_8], rax                                           ; +0x1b6, 0x1402f5686\nmov     rcx, rax                                                       ; +0x1be, 0x1402f568e\ncall    sub_140141280                                                  ; +0x1c1, 0x1402f5691\nnop                                                                    ; +0x1c6, 0x1402f5696\nmov     cs:qword_1406C2EC0, rax                                        ; +0x1c7, 0x1402f5697\nmov     rdx, [rax]                                                     ; +0x1ce, 0x1402f569e\nmov     rcx, rax                                                       ; +0x1d1, 0x1402f56a1\ncall    qword ptr [rdx+48h]                                            ; +0x1d4, 0x1402f56a4\nmov     rax, cs:qword_1406C2EC0                                        ; +0x1d7, 0x1402f56a7\nmov     [rax+328h], rbx                                                ; +0x1de, 0x1402f56ae\nmov     rcx, [rdi+3F8h]                                                ; +0x1e5, 0x1402f56b5\nxor     eax, eax                                                       ; +0x1ec, 0x1402f56bc\ntest    rcx, rcx                                                       ; +0x1ee, 0x1402f56be\njz      short loc_1402F56CA                                            ; +0x1f1, 0x1402f56c1\nmov     [rcx+278h], rax                                                ; +0x1f3, 0x1402f56c3\nxorps   xmm0, xmm0                                                     ; +0x1fa, 0x1402f56ca\nmovups  [rsp+98h+var_48], xmm0                                         ; +0x1fd, 0x1402f56cd\nmov     [rsp+98h+var_38], rax                                          ; +0x202, 0x1402f56d2\nmov     [rsp+98h+var_30], 0Fh                                          ; +0x207, 0x1402f56d7\nmov     ecx, 20h ; ' '                                                 ; +0x210, 0x1402f56e0\ncall    sub_14003AA10                                                  ; +0x215, 0x1402f56e5\nmov     qword ptr [rsp+98h+var_48], rax                                ; +0x21a, 0x1402f56ea\nmov     [rsp+98h+var_38], 10h                                          ; +0x21f, 0x1402f56ef\nmov     [rsp+98h+var_30], 1Fh                                          ; +0x228, 0x1402f56f8\nmovups  xmm0, cs:xmmword_1405864A8                                     ; +0x231, 0x1402f5701\nmovups  xmmword ptr [rax], xmm0                                        ; +0x238, 0x1402f5708\nmov     byte ptr [rax+10h], 0                                          ; +0x23b, 0x1402f570b\nlea     rdx, [rsp+98h+var_48]                                          ; +0x23f, 0x1402f570f\nlea     rcx, [rdi+3A8h]                                                ; +0x244, 0x1402f5714\ncall    UploadActionPopup__create                                      ; +0x24b, 0x1402f571b\nmov     [rdi+3F8h], rax                                                ; +0x250, 0x1402f5720\nmov     rdx, [rax]                                                     ; +0x257, 0x1402f5727\nmov     rcx, rax                                                       ; +0x25a, 0x1402f572a\ncall    qword ptr [rdx+410h]                                           ; +0x25d, 0x1402f572d\nmov     rbx, [rsp+98h+arg_0]                                           ; +0x263, 0x1402f5733\nadd     rsp, 90h                                                       ; +0x26b, 0x1402f573b\npop     rdi                                                            ; +0x272, 0x1402f5742\nretn                                                                   ; +0x273, 0x1402f5743", "xrefs": ["<???> @ 0x140586b48", "<???> @ 0x1406d3fe0"], "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"}