{"type": "func", "start": 5372081808, "end": 5372082448, "name": "MessagesProfilePage::deleteSelected", "pseudocode": "// \n// MessagesProfilePage::deleteSelected from 0x140337690 to 0x140337910 (640 bytes)\n// \n// 2 xrefs:\n// > MessagesProfilePage::FLAlert_Clicked @ 0x140337932\n// > <???> @ 0x1406d527c\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=5\nvoid MessagesProfilePage::deleteSelected(MessagesProfilePage *a1)\n{\n  std::string *p_m_messageKey; // rbx\n  GameLevelManager *v3; // rcx\n  __int64 v4; // rcx\n  cocos2d::CCArray *StoredOnlineLevels; // rbx\n  cocos2d::CCArray *v6; // r15\n  int v7; // esi\n  cocos2d::ccArray *data; // rdi\n  __int64 num; // rax\n  struct cocos2d::CCObject **arr; // rdi\n  struct cocos2d::CCObject **i; // r14\n  struct cocos2d::CCObject *v12; // rbx\n  MessageListDelegate *v13; // rbx\n  GameLevelManager *v14; // rcx\n  UploadActionDelegate *v15; // rax\n  UploadActionPopup *v16; // rax\n  GJAccountManager *v17; // rax\n  int v18; // ebx\n  __int64 v19; // rcx\n  struct cocos2d::CCObject *v20; // rax\n  int v21; // ecx\n  __int128 v22; // [rsp+20h] [rbp-48h] BYREF\n  __int64 v23; // [rsp+30h] [rbp-38h]\n  __int64 v24; // [rsp+38h] [rbp-30h]\n  void *v25; // [rsp+70h] [rbp+8h]\n  void *v26; // [rsp+70h] [rbp+8h]\n  void *v27; // [rsp+70h] [rbp+8h]\n\n  p_m_messageKey = &a1->m_messageKey;\n  if ( a1->m_messageKey.m_data.m_capacity > 0xF )\n    p_m_messageKey = (std::string *)p_m_messageKey->m_data.m_bigStorage;\n  v3 = (GameLevelManager *)qword_1406C2EC0;\n  if ( !qword_1406C2EC0 )\n  {\n    v25 = operator new(0x3D0u);\n    qword_1406C2EC0 = sub_140141280((__int64)v25);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    v3 = (GameLevelManager *)qword_1406C2EC0;\n  }\n  StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v3, p_m_messageKey->m_data.m_smallStorage._Elems);\n  if ( StoredOnlineLevels )\n  {\n    v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);\n    v7 = 0;\n    data = StoredOnlineLevels->data;\n    num = data->num;\n    if ( (_DWORD)num )\n    {\n      arr = data->arr;\n      for ( i = &arr[num - 1]; arr <= i; ++arr )\n      {\n        v12 = *arr;\n        if ( !*arr )\n          break;\n        if ( BYTE2(v12[8].m_nTag) )\n        {\n          cocos2d::CCArray::addObject(v6, *arr);\n          if ( !LOBYTE(v12[8].m_nTag) )\n          {\n            LOBYTE(v12[8].m_nTag) = 1;\n            ++v7;\n          }\n        }\n      }\n    }\n    if ( cocos2d::CCArray::count(v6) )\n    {\n      v13 = &a1->MessageListDelegate;\n      if ( !a1 )\n        v13 = nullptr;\n      v14 = (GameLevelManager *)qword_1406C2EC0;\n      if ( !qword_1406C2EC0 )\n      {\n        v26 = operator new(0x3D0u);\n        qword_1406C2EC0 = sub_140141280((__int64)v26);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n        v14 = (GameLevelManager *)qword_1406C2EC0;\n      }\n      v14->m_messageListDelegate = v13;\n      v15 = &a1->UploadActionDelegate;\n      if ( !a1 )\n        v15 = nullptr;\n      v14->m_uploadActionDelegate = v15;\n      if ( GameLevelManager::deleteUserMessages(v14, nullptr, v6, a1->m_sentMessages) )\n      {\n        v22 = 0;\n        *(_QWORD *)&v22 = sub_14003AA10(0x20u);\n        v23 = 20;\n        v24 = 31;\n        strcpy((char *)v22, \"Deleting Messages...\");\n        v16 = (UploadActionPopup *)UploadActionPopup::create((__int64)&a1->UploadPopupDelegate, (__int64)&v22);\n        a1->m_actionPopup = v16;\n        v16->show(v16);\n      }\n      if ( v7 > 0 )\n      {\n        v17 = GJAccountManager::sharedState();\n        v18 = v17->m_accountID - v17->m_unkInt1;\n        v19 = qword_1406C2EC0;\n        if ( !qword_1406C2EC0 )\n        {\n          v27 = operator new(0x3D0u);\n          qword_1406C2EC0 = sub_140141280((__int64)v27);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n          v19 = qword_1406C2EC0;\n        }\n        v20 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v19 + 600), v18);\n        if ( v20 )\n        {\n          v21 = v20[13].m_uReference - v7;\n          if ( v21 < 0 )\n            v21 = 0;\n          v20[13].m_uReference = v21;\n        }\n      }\n      a1->m_toggledAll = 0;\n      CCMenuItemToggler::toggle(a1->m_toggleAllToggler, 0);\n    }\n  }\n}", "assembly": "; \n; MessagesProfilePage::deleteSelected from 0x140337690 to 0x140337910 (640 bytes)\n; \n; 2 xrefs:\n; > MessagesProfilePage::FLAlert_Clicked @ 0x140337932\n; > <???> @ 0x1406d527c\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, 0x140337690\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x140337695\npush    rsi                                                            ; +0xa, 0x14033769a\npush    rdi                                                            ; +0xb, 0x14033769b\npush    r12                                                            ; +0xc, 0x14033769c\npush    r14                                                            ; +0xe, 0x14033769e\npush    r15                                                            ; +0x10, 0x1403376a0\nsub     rsp, 40h                                                       ; +0x12, 0x1403376a2\nmov     rbp, rcx                                                       ; +0x16, 0x1403376a6\nlea     rbx, [rcx+2A0h]                                                ; +0x19, 0x1403376a9\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0x20, 0x1403376b0\njbe     short loc_1403376BA                                            ; +0x25, 0x1403376b5\nmov     rbx, [rbx]                                                     ; +0x27, 0x1403376b7\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x2a, 0x1403376ba\ntest    rcx, rcx                                                       ; +0x31, 0x1403376c1\njnz     short loc_1403376F6                                            ; +0x34, 0x1403376c4\nmov     ecx, 3D0h; Size                                                ; +0x36, 0x1403376c6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x3b, 0x1403376cb\nmov     [rsp+68h+arg_0], rax                                           ; +0x40, 0x1403376d0\nmov     rcx, rax                                                       ; +0x45, 0x1403376d5\ncall    sub_140141280                                                  ; +0x48, 0x1403376d8\nnop                                                                    ; +0x4d, 0x1403376dd\nmov     cs:qword_1406C2EC0, rax                                        ; +0x4e, 0x1403376de\nmov     r8, [rax]                                                      ; +0x55, 0x1403376e5\nmov     rcx, rax                                                       ; +0x58, 0x1403376e8\ncall    qword ptr [r8+48h]                                             ; +0x5b, 0x1403376eb\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x5f, 0x1403376ef\nmov     rdx, rbx                                                       ; +0x66, 0x1403376f6\ncall    GameLevelManager__getStoredOnlineLevels                        ; +0x69, 0x1403376f9\nmov     rbx, rax                                                       ; +0x6e, 0x1403376fe\ntest    rax, rax                                                       ; +0x71, 0x140337701\njz      loc_1403378F6                                                  ; +0x74, 0x140337704\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x7a, 0x14033770a\nmov     r15, rax                                                       ; +0x80, 0x140337710\nxor     r12d, r12d                                                     ; +0x83, 0x140337713\nmov     esi, r12d                                                      ; +0x86, 0x140337716\nmov     rdi, [rbx+38h]                                                 ; +0x89, 0x140337719\nmov     eax, [rdi]                                                     ; +0x8d, 0x14033771d\ntest    eax, eax                                                       ; +0x8f, 0x14033771f\njz      short loc_14033776C                                            ; +0x91, 0x140337721\nmov     rdi, [rdi+10h]                                                 ; +0x93, 0x140337723\nlea     r14, [rax-1]                                                   ; +0x97, 0x140337727\nlea     r14, [rdi+r14*8]                                               ; +0x9b, 0x14033772b\ncmp     rdi, r14                                                       ; +0x9f, 0x14033772f\nja      short loc_14033776C                                            ; +0xa2, 0x140337732\nmov     rbx, [rdi]                                                     ; +0xa4, 0x140337734\ntest    rbx, rbx                                                       ; +0xa7, 0x140337737\njz      short loc_14033776C                                            ; +0xaa, 0x14033773a\ncmp     [rbx+1D2h], r12b                                               ; +0xac, 0x14033773c\njz      short loc_140337763                                            ; +0xb3, 0x140337743\nmov     rdx, rbx                                                       ; +0xb5, 0x140337745\nmov     rcx, r15                                                       ; +0xb8, 0x140337748\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xbb, 0x14033774b\ncmp     [rbx+1D0h], r12b                                               ; +0xc1, 0x140337751\njnz     short loc_140337763                                            ; +0xc8, 0x140337758\nmov     byte ptr [rbx+1D0h], 1                                         ; +0xca, 0x14033775a\ninc     esi                                                            ; +0xd1, 0x140337761\nadd     rdi, 8                                                         ; +0xd3, 0x140337763\ncmp     rdi, r14                                                       ; +0xd7, 0x140337767\njbe     short loc_140337734                                            ; +0xda, 0x14033776a\nmov     rcx, r15                                                       ; +0xdc, 0x14033776c\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xdf, 0x14033776f\ntest    eax, eax                                                       ; +0xe5, 0x140337775\njz      loc_1403378F6                                                  ; +0xe7, 0x140337777\nlea     rbx, [rbp+290h]                                                ; +0xed, 0x14033777d\ntest    rbp, rbp                                                       ; +0xf4, 0x140337784\ncmovz   rbx, r12                                                       ; +0xf7, 0x140337787\nmov     rcx, cs:qword_1406C2EC0                                        ; +0xfb, 0x14033778b\ntest    rcx, rcx                                                       ; +0x102, 0x140337792\njnz     short loc_1403377C6                                            ; +0x105, 0x140337795\nmov     ecx, 3D0h; Size                                                ; +0x107, 0x140337797\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x10c, 0x14033779c\nmov     [rsp+68h+arg_0], rax                                           ; +0x111, 0x1403377a1\nmov     rcx, rax                                                       ; +0x116, 0x1403377a6\ncall    sub_140141280                                                  ; +0x119, 0x1403377a9\nnop                                                                    ; +0x11e, 0x1403377ae\nmov     cs:qword_1406C2EC0, rax                                        ; +0x11f, 0x1403377af\nmov     rdx, [rax]                                                     ; +0x126, 0x1403377b6\nmov     rcx, rax                                                       ; +0x129, 0x1403377b9\ncall    qword ptr [rdx+48h]                                            ; +0x12c, 0x1403377bc\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x12f, 0x1403377bf\nmov     [rcx+340h], rbx                                                ; +0x136, 0x1403377c6\nlea     rax, [rbp+280h]                                                ; +0x13d, 0x1403377cd\ntest    rbp, rbp                                                       ; +0x144, 0x1403377d4\ncmovz   rax, r12                                                       ; +0x147, 0x1403377d7\nmov     [rcx+328h], rax                                                ; +0x14b, 0x1403377db\nmovzx   r9d, byte ptr [rbp+298h]                                       ; +0x152, 0x1403377e2\nmov     r8, r15                                                        ; +0x15a, 0x1403377ea\nxor     edx, edx                                                       ; +0x15d, 0x1403377ed\ncall    GameLevelManager__deleteUserMessages                           ; +0x15f, 0x1403377ef\ntest    al, al                                                         ; +0x164, 0x1403377f4\njz      short loc_14033786A                                            ; +0x166, 0x1403377f6\nxorps   xmm0, xmm0                                                     ; +0x168, 0x1403377f8\nmovups  [rsp+68h+var_48], xmm0                                         ; +0x16b, 0x1403377fb\nmov     [rsp+68h+var_38], r12                                          ; +0x170, 0x140337800\nmov     [rsp+68h+var_30], 0Fh                                          ; +0x175, 0x140337805\nmov     ecx, 20h ; ' '                                                 ; +0x17e, 0x14033780e\ncall    sub_14003AA10                                                  ; +0x183, 0x140337813\nmov     qword ptr [rsp+68h+var_48], rax                                ; +0x188, 0x140337818\nmov     [rsp+68h+var_38], 14h                                          ; +0x18d, 0x14033781d\nmov     [rsp+68h+var_30], 1Fh                                          ; +0x196, 0x140337826\nmovups  xmm0, cs:xmmword_1405AB3A8                                     ; +0x19f, 0x14033782f\nmovups  xmmword ptr [rax], xmm0                                        ; +0x1a6, 0x140337836\nmov     edx, cs:dword_1405AB3B8                                        ; +0x1a9, 0x140337839\nmov     [rax+10h], edx                                                 ; +0x1af, 0x14033783f\nmov     byte ptr [rax+14h], 0                                          ; +0x1b2, 0x140337842\nlea     rdx, [rsp+68h+var_48]                                          ; +0x1b6, 0x140337846\nlea     rcx, [rbp+288h]                                                ; +0x1bb, 0x14033784b\ncall    UploadActionPopup__create                                      ; +0x1c2, 0x140337852\nmov     [rbp+2E0h], rax                                                ; +0x1c7, 0x140337857\nmov     rdx, [rax]                                                     ; +0x1ce, 0x14033785e\nmov     rcx, rax                                                       ; +0x1d1, 0x140337861\ncall    qword ptr [rdx+410h]                                           ; +0x1d4, 0x140337864\ntest    esi, esi                                                       ; +0x1da, 0x14033786a\njle     short loc_1403378E1                                            ; +0x1dc, 0x14033786c\ncall    GJAccountManager__sharedState                                  ; +0x1de, 0x14033786e\nmov     ebx, [rax+168h]                                                ; +0x1e3, 0x140337873\nsub     ebx, [rax+16Ch]                                                ; +0x1e9, 0x140337879\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x1ef, 0x14033787f\ntest    rcx, rcx                                                       ; +0x1f6, 0x140337886\njnz     short loc_1403378BA                                            ; +0x1f9, 0x140337889\nmov     ecx, 3D0h; Size                                                ; +0x1fb, 0x14033788b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x200, 0x140337890\nmov     [rsp+68h+arg_0], rax                                           ; +0x205, 0x140337895\nmov     rcx, rax                                                       ; +0x20a, 0x14033789a\ncall    sub_140141280                                                  ; +0x20d, 0x14033789d\nnop                                                                    ; +0x212, 0x1403378a2\nmov     cs:qword_1406C2EC0, rax                                        ; +0x213, 0x1403378a3\nmov     rdx, [rax]                                                     ; +0x21a, 0x1403378aa\nmov     rcx, rax                                                       ; +0x21d, 0x1403378ad\ncall    qword ptr [rdx+48h]                                            ; +0x220, 0x1403378b0\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x223, 0x1403378b3\nmovsxd  rdx, ebx                                                       ; +0x22a, 0x1403378ba\nmov     rcx, [rcx+258h]                                                ; +0x22d, 0x1403378bd\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x234, 0x1403378c4\ntest    rax, rax                                                       ; +0x23a, 0x1403378ca\njz      short loc_1403378E1                                            ; +0x23d, 0x1403378cd\nmov     ecx, [rax+2ECh]                                                ; +0x23f, 0x1403378cf\nsub     ecx, esi                                                       ; +0x245, 0x1403378d5\ncmovs   ecx, r12d                                                      ; +0x247, 0x1403378d7\nmov     [rax+2ECh], ecx                                                ; +0x24b, 0x1403378db\nmov     byte ptr [rbp+320h], 0                                         ; +0x251, 0x1403378e1\nxor     edx, edx                                                       ; +0x258, 0x1403378e8\nmov     rcx, [rbp+308h]                                                ; +0x25a, 0x1403378ea\ncall    CCMenuItemToggler__toggle                                      ; +0x261, 0x1403378f1\nmov     rbx, [rsp+68h+arg_8]                                           ; +0x266, 0x1403378f6\nmov     rbp, [rsp+68h+arg_10]                                          ; +0x26b, 0x1403378fb\nadd     rsp, 40h                                                       ; +0x273, 0x140337903\npop     r15                                                            ; +0x277, 0x140337907\npop     r14                                                            ; +0x279, 0x140337909\npop     r12                                                            ; +0x27b, 0x14033790b\npop     rdi                                                            ; +0x27d, 0x14033790d\npop     rsi                                                            ; +0x27e, 0x14033790e\nretn                                                                   ; +0x27f, 0x14033790f", "xrefs": ["MessagesProfilePage::FLAlert_Clicked @ 0x140337932", "<???> @ 0x1406d527c"], "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"}