{"type": "func", "start": 5372678816, "end": 5372679222, "name": "RateDemonLayer::onRate", "pseudocode": "// \n// RateDemonLayer::onRate from 0x1403c92a0 to 0x1403c9436 (406 bytes)\n// \n// 2 xrefs:\n// > RateDemonLayer::init @ 0x1403c9024\n// > <???> @ 0x1406d79dc\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=2\nvoid RateDemonLayer::onRate(RateDemonLayer *a1, cocos2d::CCObject *a2)\n{\n  GameLevelManager *v3; // rcx\n  __int64 v4; // rax\n  UploadActionPopup *m_popup; // rax\n  UploadActionPopup *v6; // rax\n  _BOOL8 v7; // rdx\n  RateLevelDelegate *m_delegate; // rcx\n  __int128 v9; // [rsp+20h] [rbp-28h] BYREF\n  __int64 v10; // [rsp+30h] [rbp-18h]\n  __int64 v11; // [rsp+38h] [rbp-10h]\n  void *v12; // [rsp+50h] [rbp+8h]\n  void *v13; // [rsp+50h] [rbp+8h]\n\n  if ( a1->m_demonRate != -1 )\n  {\n    v3 = (GameLevelManager *)qword_1406C2EC0;\n    if ( !qword_1406C2EC0 )\n    {\n      v12 = operator new(0x3D0u);\n      qword_1406C2EC0 = sub_140141280((__int64)v12);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n      v3 = (GameLevelManager *)qword_1406C2EC0;\n    }\n    if ( GameLevelManager::rateDemon(v3, a1->m_levelID, a1->m_demonRate, a1->m_moderator) )\n    {\n      if ( !a1->m_moderator )\n      {\nLABEL_12:\n        a1->setKeypadEnabled(a1, 0);\n        LOBYTE(v7) = 1;\n        a1->removeFromParentAndCleanup(a1, v7);\n        m_delegate = a1->m_delegate;\n        if ( m_delegate )\n          m_delegate->rateLevelClosed(m_delegate);\n        return;\n      }\n      v4 = qword_1406C2EC0;\n      if ( !qword_1406C2EC0 )\n      {\n        v13 = operator new(0x3D0u);\n        qword_1406C2EC0 = sub_140141280((__int64)v13);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n        v4 = qword_1406C2EC0;\n      }\n      *(_QWORD *)(v4 + 808) = &a1->UploadActionDelegate;\n      m_popup = a1->m_popup;\n      if ( m_popup )\n        m_popup->m_delegate = nullptr;\n      v9 = 0;\n      *(_QWORD *)&v9 = sub_14003AA10(0x20u);\n      v10 = 17;\n      v11 = 31;\n      strcpy((char *)v9, \"Sending rating...\");\n      v6 = (UploadActionPopup *)UploadActionPopup::create((__int64)&a1->UploadPopupDelegate, (__int64)&v9);\n      a1->m_popup = v6;\n      v6->show(v6);\n    }\n    if ( a1->m_moderator )\n      return;\n    goto LABEL_12;\n  }\n}", "assembly": "; \n; RateDemonLayer::onRate from 0x1403c92a0 to 0x1403c9436 (406 bytes)\n; \n; 2 xrefs:\n; > RateDemonLayer::init @ 0x1403c9024\n; > <???> @ 0x1406d79dc\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, 0x1403c92a0\npush    rdi                                                            ; +0x5, 0x1403c92a5\nsub     rsp, 40h                                                       ; +0x6, 0x1403c92a6\nmov     rdi, rcx                                                       ; +0xa, 0x1403c92aa\ncmp     dword ptr [rcx+2ACh], 0FFFFFFFFh                               ; +0xd, 0x1403c92ad\njz      loc_1403C942B                                                  ; +0x14, 0x1403c92b4\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x1a, 0x1403c92ba\ntest    rcx, rcx                                                       ; +0x21, 0x1403c92c1\njnz     short loc_1403C92F5                                            ; +0x24, 0x1403c92c4\nmov     ecx, 3D0h; Size                                                ; +0x26, 0x1403c92c6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x2b, 0x1403c92cb\nmov     [rsp+48h+arg_0], rax                                           ; +0x30, 0x1403c92d0\nmov     rcx, rax                                                       ; +0x35, 0x1403c92d5\ncall    sub_140141280                                                  ; +0x38, 0x1403c92d8\nnop                                                                    ; +0x3d, 0x1403c92dd\nmov     cs:qword_1406C2EC0, rax                                        ; +0x3e, 0x1403c92de\nmov     rdx, [rax]                                                     ; +0x45, 0x1403c92e5\nmov     rcx, rax                                                       ; +0x48, 0x1403c92e8\ncall    qword ptr [rdx+48h]                                            ; +0x4b, 0x1403c92eb\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x4e, 0x1403c92ee\nmovzx   r9d, byte ptr [rdi+2B0h]                                       ; +0x55, 0x1403c92f5\nmov     r8d, [rdi+2ACh]                                                ; +0x5d, 0x1403c92fd\nmov     edx, [rdi+2A8h]                                                ; +0x64, 0x1403c9304\ncall    GameLevelManager__rateDemon                                    ; +0x6a, 0x1403c930a\ntest    al, al                                                         ; +0x6f, 0x1403c930f\njz      loc_1403C93F5                                                  ; +0x71, 0x1403c9311\ncmp     byte ptr [rdi+2B0h], 0                                         ; +0x77, 0x1403c9317\njz      loc_1403C93FE                                                  ; +0x7e, 0x1403c931e\nlea     rbx, [rdi+280h]                                                ; +0x84, 0x1403c9324\nmov     rax, cs:qword_1406C2EC0                                        ; +0x8b, 0x1403c932b\ntest    rax, rax                                                       ; +0x92, 0x1403c9332\njnz     short loc_1403C9366                                            ; +0x95, 0x1403c9335\nmov     ecx, 3D0h; Size                                                ; +0x97, 0x1403c9337\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x9c, 0x1403c933c\nmov     [rsp+48h+arg_0], rax                                           ; +0xa1, 0x1403c9341\nmov     rcx, rax                                                       ; +0xa6, 0x1403c9346\ncall    sub_140141280                                                  ; +0xa9, 0x1403c9349\nnop                                                                    ; +0xae, 0x1403c934e\nmov     cs:qword_1406C2EC0, rax                                        ; +0xaf, 0x1403c934f\nmov     rdx, [rax]                                                     ; +0xb6, 0x1403c9356\nmov     rcx, rax                                                       ; +0xb9, 0x1403c9359\ncall    qword ptr [rdx+48h]                                            ; +0xbc, 0x1403c935c\nmov     rax, cs:qword_1406C2EC0                                        ; +0xbf, 0x1403c935f\nmov     [rax+328h], rbx                                                ; +0xc6, 0x1403c9366\nmov     rax, [rdi+2B8h]                                                ; +0xcd, 0x1403c936d\nxor     ecx, ecx                                                       ; +0xd4, 0x1403c9374\ntest    rax, rax                                                       ; +0xd6, 0x1403c9376\njz      short loc_1403C9382                                            ; +0xd9, 0x1403c9379\nmov     [rax+278h], rcx                                                ; +0xdb, 0x1403c937b\nxorps   xmm0, xmm0                                                     ; +0xe2, 0x1403c9382\nmovups  [rsp+48h+var_28], xmm0                                         ; +0xe5, 0x1403c9385\nmov     [rsp+48h+var_18], rcx                                          ; +0xea, 0x1403c938a\nmov     [rsp+48h+var_10], 0Fh                                          ; +0xef, 0x1403c938f\nmov     ecx, 20h ; ' '                                                 ; +0xf8, 0x1403c9398\ncall    sub_14003AA10                                                  ; +0xfd, 0x1403c939d\nmov     qword ptr [rsp+48h+var_28], rax                                ; +0x102, 0x1403c93a2\nmov     [rsp+48h+var_18], 11h                                          ; +0x107, 0x1403c93a7\nmov     [rsp+48h+var_10], 1Fh                                          ; +0x110, 0x1403c93b0\nmovups  xmm0, cs:xmmword_140586540                                     ; +0x119, 0x1403c93b9\nmovups  xmmword ptr [rax], xmm0                                        ; +0x120, 0x1403c93c0\nmovzx   edx, cs:byte_140586550                                         ; +0x123, 0x1403c93c3\nmov     [rax+10h], dl                                                  ; +0x12a, 0x1403c93ca\nmov     byte ptr [rax+11h], 0                                          ; +0x12d, 0x1403c93cd\nlea     rdx, [rsp+48h+var_28]                                          ; +0x131, 0x1403c93d1\nlea     rcx, [rdi+278h]                                                ; +0x136, 0x1403c93d6\ncall    UploadActionPopup__create                                      ; +0x13d, 0x1403c93dd\nmov     [rdi+2B8h], rax                                                ; +0x142, 0x1403c93e2\nmov     rdx, [rax]                                                     ; +0x149, 0x1403c93e9\nmov     rcx, rax                                                       ; +0x14c, 0x1403c93ec\ncall    qword ptr [rdx+410h]                                           ; +0x14f, 0x1403c93ef\ncmp     byte ptr [rdi+2B0h], 0                                         ; +0x155, 0x1403c93f5\njnz     short loc_1403C942B                                            ; +0x15c, 0x1403c93fc\nmov     rax, [rdi]                                                     ; +0x15e, 0x1403c93fe\nxor     edx, edx                                                       ; +0x161, 0x1403c9401\nmov     rcx, rdi                                                       ; +0x163, 0x1403c9403\ncall    qword ptr [rax+3D0h]                                           ; +0x166, 0x1403c9406\nmov     rax, [rdi]                                                     ; +0x16c, 0x1403c940c\nmov     dl, 1                                                          ; +0x16f, 0x1403c940f\nmov     rcx, rdi                                                       ; +0x171, 0x1403c9411\ncall    qword ptr [rax+1F8h]                                           ; +0x174, 0x1403c9414\nmov     rcx, [rdi+2C0h]                                                ; +0x17a, 0x1403c941a\ntest    rcx, rcx                                                       ; +0x181, 0x1403c9421\njz      short loc_1403C942B                                            ; +0x184, 0x1403c9424\nmov     rax, [rcx]                                                     ; +0x186, 0x1403c9426\ncall    qword ptr [rax]                                                ; +0x189, 0x1403c9429\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x18b, 0x1403c942b\nadd     rsp, 40h                                                       ; +0x190, 0x1403c9430\npop     rdi                                                            ; +0x194, 0x1403c9434\nretn                                                                   ; +0x195, 0x1403c9435", "xrefs": ["RateDemonLayer::init @ 0x1403c9024", "<???> @ 0x1406d79dc"], "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"}