{"type": "func", "start": 5370158256, "end": 5370158838, "name": "GameLevelManager::onRemoveFriendCompleted", "pseudocode": "// \n// GameLevelManager::onRemoveFriendCompleted from 0x140161cb0 to 0x140161ef6 (582 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x1401437d4\n// > <???> @ 0x1406caba8\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 __fastcall GameLevelManager::onRemoveFriendCompleted(GameLevelManager *a1, const void **a2, _QWORD *a3)\n{\n  _BYTE *v6; // rbx\n  size_t v7; // r8\n  GameLevelManager *v8; // rcx\n  void *v9; // rcx\n  __int64 SplitIntFromKey; // rsi\n  const void *v11; // rcx\n  unsigned __int64 v12; // rbx\n  size_t v13; // r8\n  UploadActionDelegate *v14; // rcx\n  struct cocos2d::CCObject *v15; // rax\n  unsigned int v16; // ebx\n  UserInfoDelegate *m_userInfoDelegate; // rcx\n  cocos2d::CCArray *StoredUserList; // rax\n  cocos2d::CCArray *v19; // rdi\n  UserListDelegate *m_userListDelegate; // rcx\n  UploadActionDelegate *m_uploadActionDelegate; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-58h] BYREF\n  __int128 v23; // [rsp+40h] [rbp-48h]\n\n  v6 = a3;\n  if ( a3[3] > 0xFu )\n    v6 = (_BYTE *)*a3;\n  *(_OWORD *)Block = 0;\n  v23 = 0;\n  v7 = -1;\n  do\n    ++v7;\n  while ( v6[v7] );\n  sub_14003A930(Block, v6, v7);\n  cocos2d::CCDictionary::removeObjectForKey(a1->m_friendReqAndUserBlocks, Block);\n  if ( *((_QWORD *)&v23 + 1) > 0xFu )\n  {\n    v9 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v23 + 1) + 1LL) >= 0x1000 )\n    {\n      v9 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v9);\n  }\n  SplitIntFromKey = GameLevelManager::getSplitIntFromKey(v8, v6, 1);\n  *(_OWORD *)Block = 0;\n  *(_QWORD *)&v23 = 2;\n  *((_QWORD *)&v23 + 1) = 15;\n  strcpy((char *)Block, \"-1\");\n  v11 = a2;\n  if ( (unsigned __int64)a2[3] > 0xF )\n    v11 = *a2;\n  v12 = (unsigned __int64)a2[2];\n  v13 = v12;\n  if ( v12 > 2 )\n    v13 = 2;\n  if ( !memcmp(v11, Block, v13) && v12 == 2 )\n  {\n    m_uploadActionDelegate = a1->m_uploadActionDelegate;\n    if ( m_uploadActionDelegate )\n      m_uploadActionDelegate->uploadActionFailed(m_uploadActionDelegate, SplitIntFromKey, 33);\n  }\n  else\n  {\n    v14 = a1->m_uploadActionDelegate;\n    if ( v14 )\n      v14->uploadActionFinished(v14, SplitIntFromKey, 33);\n    v15 = cocos2d::CCDictionary::objectForKey(a1->m_storedUserInfo, SplitIntFromKey);\n    v16 = 0;\n    if ( v15 )\n    {\n      v15[13].m_nTag = 0;\n      m_userInfoDelegate = a1->m_userInfoDelegate;\n      if ( m_userInfoDelegate )\n        m_userInfoDelegate->userInfoChanged(m_userInfoDelegate, (GJUserScore *)v15);\n    }\n    StoredUserList = GameLevelManager::getStoredUserList(a1, (UserListType)0);\n    v19 = StoredUserList;\n    if ( StoredUserList && cocos2d::CCArray::count(StoredUserList) )\n    {\n      while ( LODWORD(cocos2d::CCArray::objectAtIndex(v19, v16)[7].__vftable) != (_DWORD)SplitIntFromKey )\n      {\n        if ( ++v16 >= cocos2d::CCArray::count(v19) )\n          goto LABEL_30;\n      }\n      cocos2d::CCArray::removeObjectAtIndex(v19, v16, 1);\n      m_userListDelegate = a1->m_userListDelegate;\n      if ( m_userListDelegate )\n        m_userListDelegate->userListChanged(m_userListDelegate, v19, (UserListType)0LL);\n    }\n  }\nLABEL_30:\n  sub_14003A830((__int64)a2);\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onRemoveFriendCompleted from 0x140161cb0 to 0x140161ef6 (582 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x1401437d4\n; > <???> @ 0x1406caba8\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_18], rbx                                              ; +0x0, 0x140161cb0\npush    rbp                                                            ; +0x5, 0x140161cb5\npush    rsi                                                            ; +0x6, 0x140161cb6\npush    rdi                                                            ; +0x7, 0x140161cb7\npush    r14                                                            ; +0x8, 0x140161cb8\npush    r15                                                            ; +0xa, 0x140161cba\nsub     rsp, 60h                                                       ; +0xc, 0x140161cbc\nmov     rax, cs:__security_cookie                                      ; +0x10, 0x140161cc0\nxor     rax, rsp                                                       ; +0x17, 0x140161cc7\nmov     [rsp+88h+var_38], rax                                          ; +0x1a, 0x140161cca\nmov     r15, r8                                                        ; +0x1f, 0x140161ccf\nmov     r14, rdx                                                       ; +0x22, 0x140161cd2\nmov     rbp, rcx                                                       ; +0x25, 0x140161cd5\nmov     [rsp+88h+var_68], rdx                                          ; +0x28, 0x140161cd8\nmov     [rsp+88h+var_60], r8                                           ; +0x2d, 0x140161cdd\nmov     rbx, r8                                                        ; +0x32, 0x140161ce2\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x35, 0x140161ce5\njbe     short loc_140161CEF                                            ; +0x3a, 0x140161cea\nmov     rbx, [r8]                                                      ; +0x3c, 0x140161cec\nxorps   xmm0, xmm0                                                     ; +0x3f, 0x140161cef\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x42, 0x140161cf2\nxorps   xmm1, xmm1                                                     ; +0x47, 0x140161cf7\nmovdqu  [rsp+88h+var_48], xmm1                                         ; +0x4a, 0x140161cfa\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x50, 0x140161d00\nnop     word ptr [rax+rax+00000000h]                                   ; +0x57, 0x140161d07\ninc     r8                                                             ; +0x60, 0x140161d10\ncmp     byte ptr [rbx+r8], 0                                           ; +0x63, 0x140161d13\njnz     short loc_140161D10                                            ; +0x68, 0x140161d18\nmov     rdx, rbx                                                       ; +0x6a, 0x140161d1a\nlea     rcx, [rsp+88h+Block]                                           ; +0x6d, 0x140161d1d\ncall    sub_14003A930                                                  ; +0x72, 0x140161d22\nnop                                                                    ; +0x77, 0x140161d27\nlea     rdx, [rsp+88h+Block]                                           ; +0x78, 0x140161d28\nmov     rcx, [rbp+250h]                                                ; +0x7d, 0x140161d2d\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0x84, 0x140161d34\nnop                                                                    ; +0x8a, 0x140161d3a\nmov     rdx, qword ptr [rsp+88h+var_48+8]                              ; +0x8b, 0x140161d3b\ncmp     rdx, 0Fh                                                       ; +0x90, 0x140161d40\njbe     short loc_140161D7B                                            ; +0x94, 0x140161d44\ninc     rdx                                                            ; +0x96, 0x140161d46\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0x99, 0x140161d49\nmov     rax, rcx                                                       ; +0x9e, 0x140161d4e\ncmp     rdx, 1000h                                                     ; +0xa1, 0x140161d51\njb      short loc_140161D76                                            ; +0xa8, 0x140161d58\nadd     rdx, 27h ; '''                                                 ; +0xaa, 0x140161d5a\nmov     rcx, [rcx-8]                                                   ; +0xae, 0x140161d5e\nsub     rax, rcx                                                       ; +0xb2, 0x140161d62\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xb5, 0x140161d65\ncmp     rax, 1Fh                                                       ; +0xb9, 0x140161d69\njbe     short loc_140161D76                                            ; +0xbd, 0x140161d6d\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xbf, 0x140161d6f\nalign 2                                                                ; +0xc5, 0x140161d75\ncall    j_j_free                                                       ; +0xc6, 0x140161d76\nmov     r8d, 1                                                         ; +0xcb, 0x140161d7b\nmov     rdx, rbx                                                       ; +0xd1, 0x140161d81\ncall    GameLevelManager__getSplitIntFromKey                           ; +0xd4, 0x140161d84\nmovsxd  rsi, eax                                                       ; +0xd9, 0x140161d89\nxorps   xmm0, xmm0                                                     ; +0xdc, 0x140161d8c\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0xdf, 0x140161d8f\nmov     edx, 2                                                         ; +0xe4, 0x140161d94\nmov     qword ptr [rsp+88h+var_48], rdx                                ; +0xe9, 0x140161d99\nmov     qword ptr [rsp+88h+var_48+8], 0Fh                              ; +0xee, 0x140161d9e\nmov     eax, 312Dh                                                     ; +0xf7, 0x140161da7\nmov     word ptr [rsp+88h+Block], ax                                   ; +0xfc, 0x140161dac\nmov     byte ptr [rsp+88h+Block+2], 0                                  ; +0x101, 0x140161db1\nmov     rcx, r14                                                       ; +0x106, 0x140161db6\ncmp     qword ptr [r14+18h], 0Fh                                       ; +0x109, 0x140161db9\njbe     short loc_140161DC3                                            ; +0x10e, 0x140161dbe\nmov     rcx, [r14]; Buf1                                               ; +0x110, 0x140161dc0\nmov     rbx, [r14+10h]                                                 ; +0x113, 0x140161dc3\nmov     r8, rbx                                                        ; +0x117, 0x140161dc7\ncmp     rbx, rdx                                                       ; +0x11a, 0x140161dca\ncmova   r8, rdx; Size                                                  ; +0x11d, 0x140161dcd\nlea     rdx, [rsp+88h+Block]; Buf2                                     ; +0x121, 0x140161dd1\ncall    memcmp                                                         ; +0x126, 0x140161dd6\ntest    eax, eax                                                       ; +0x12b, 0x140161ddb\njnz     short loc_140161DEB                                            ; +0x12d, 0x140161ddd\ncmp     rbx, 2                                                         ; +0x12f, 0x140161ddf\njb      short loc_140161DEB                                            ; +0x133, 0x140161de3\njbe     loc_140161EA9                                                  ; +0x135, 0x140161de5\nmov     rcx, [rbp+328h]                                                ; +0x13b, 0x140161deb\ntest    rcx, rcx                                                       ; +0x142, 0x140161df2\njz      short loc_140161E04                                            ; +0x145, 0x140161df5\nmov     rax, [rcx]                                                     ; +0x147, 0x140161df7\nmov     r8d, 21h ; '!'                                                 ; +0x14a, 0x140161dfa\nmov     edx, esi                                                       ; +0x150, 0x140161e00\ncall    qword ptr [rax]                                                ; +0x152, 0x140161e02\nmov     rdx, rsi                                                       ; +0x154, 0x140161e04\nmov     rcx, [rbp+258h]                                                ; +0x157, 0x140161e07\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x15e, 0x140161e0e\nxor     ebx, ebx                                                       ; +0x164, 0x140161e14\ntest    rax, rax                                                       ; +0x166, 0x140161e16\njz      short loc_140161E37                                            ; +0x169, 0x140161e19\nmov     [rax+2E8h], ebx                                                ; +0x16b, 0x140161e1b\nmov     rcx, [rbp+320h]                                                ; +0x171, 0x140161e21\ntest    rcx, rcx                                                       ; +0x178, 0x140161e28\njz      short loc_140161E37                                            ; +0x17b, 0x140161e2b\nmov     r8, [rcx]                                                      ; +0x17d, 0x140161e2d\nmov     rdx, rax                                                       ; +0x180, 0x140161e30\ncall    qword ptr [r8+10h]                                             ; +0x183, 0x140161e33\nxor     edx, edx                                                       ; +0x187, 0x140161e37\nmov     rcx, rbp                                                       ; +0x189, 0x140161e39\ncall    GameLevelManager__getStoredUserList                            ; +0x18c, 0x140161e3c\nmov     rdi, rax                                                       ; +0x191, 0x140161e41\ntest    rax, rax                                                       ; +0x194, 0x140161e44\njz      short loc_140161EC4                                            ; +0x197, 0x140161e47\nmov     rcx, rax                                                       ; +0x199, 0x140161e49\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x19c, 0x140161e4c\ntest    eax, eax                                                       ; +0x1a2, 0x140161e52\njz      short loc_140161EC4                                            ; +0x1a4, 0x140161e54\nnop     word ptr [rax+rax+00000000h]                                   ; +0x1a6, 0x140161e56\nmov     edx, ebx                                                       ; +0x1b0, 0x140161e60\nmov     rcx, rdi                                                       ; +0x1b2, 0x140161e62\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x1b5, 0x140161e65\nmov     rcx, rdi                                                       ; +0x1bb, 0x140161e6b\ncmp     [rax+188h], esi                                                ; +0x1be, 0x140161e6e\njz      short loc_140161E84                                            ; +0x1c4, 0x140161e74\ninc     ebx                                                            ; +0x1c6, 0x140161e76\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1c8, 0x140161e78\ncmp     ebx, eax                                                       ; +0x1ce, 0x140161e7e\njb      short loc_140161E60                                            ; +0x1d0, 0x140161e80\njmp     short loc_140161EC4                                            ; +0x1d2, 0x140161e82\nmov     r8b, 1                                                         ; +0x1d4, 0x140161e84\nmov     edx, ebx                                                       ; +0x1d7, 0x140161e87\ncall    cs:?removeObjectAtIndex@CCArray@cocos2d@@QEAAXI_N@Z; cocos2d::CCArray::removeObjectAtIndex(uint,bool) ; +0x1d9, 0x140161e89\nmov     rcx, [rbp+330h]                                                ; +0x1df, 0x140161e8f\ntest    rcx, rcx                                                       ; +0x1e6, 0x140161e96\njz      short loc_140161EC4                                            ; +0x1e9, 0x140161e99\nmov     rax, [rcx]                                                     ; +0x1eb, 0x140161e9b\nxor     r8d, r8d                                                       ; +0x1ee, 0x140161e9e\nmov     rdx, rdi                                                       ; +0x1f1, 0x140161ea1\ncall    qword ptr [rax+10h]                                            ; +0x1f4, 0x140161ea4\njmp     short loc_140161EC4                                            ; +0x1f7, 0x140161ea7\nmov     rcx, [rbp+328h]                                                ; +0x1f9, 0x140161ea9\ntest    rcx, rcx                                                       ; +0x200, 0x140161eb0\njz      short loc_140161EC4                                            ; +0x203, 0x140161eb3\nmov     rax, [rcx]                                                     ; +0x205, 0x140161eb5\nmov     r8d, 21h ; '!'                                                 ; +0x208, 0x140161eb8\nmov     edx, esi                                                       ; +0x20e, 0x140161ebe\ncall    qword ptr [rax+8]                                              ; +0x210, 0x140161ec0\nnop                                                                    ; +0x213, 0x140161ec3\nmov     rcx, r14                                                       ; +0x214, 0x140161ec4\ncall    sub_14003A830                                                  ; +0x217, 0x140161ec7\nnop                                                                    ; +0x21c, 0x140161ecc\nmov     rcx, r15                                                       ; +0x21d, 0x140161ecd\ncall    sub_14003A830                                                  ; +0x220, 0x140161ed0\nmov     rcx, [rsp+88h+var_38]                                          ; +0x225, 0x140161ed5\nxor     rcx, rsp; StackCookie                                          ; +0x22a, 0x140161eda\ncall    __security_check_cookie                                        ; +0x22d, 0x140161edd\nmov     rbx, [rsp+88h+arg_18]                                          ; +0x232, 0x140161ee2\nadd     rsp, 60h                                                       ; +0x23a, 0x140161eea\npop     r15                                                            ; +0x23e, 0x140161eee\npop     r14                                                            ; +0x240, 0x140161ef0\npop     rdi                                                            ; +0x242, 0x140161ef2\npop     rsi                                                            ; +0x243, 0x140161ef3\npop     rbp                                                            ; +0x244, 0x140161ef4\nretn                                                                   ; +0x245, 0x140161ef5", "xrefs": ["GameLevelManager::handleIt @ 0x1401437d4", "<???> @ 0x1406caba8"], "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"}