{"type": "func", "start": 5370156176, "end": 5370156664, "name": "GameLevelManager::onAcceptFriendRequestCompleted", "pseudocode": "// \n// GameLevelManager::onAcceptFriendRequestCompleted from 0x140161490 to 0x140161678 (488 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x1401436cc\n// > <???> @ 0x1406cab84\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::onAcceptFriendRequestCompleted(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; // r15\n  GameLevelManager *v11; // rcx\n  unsigned int v12; // ebp\n  const void *v13; // rcx\n  unsigned __int64 v14; // rbx\n  size_t v15; // r8\n  UploadActionDelegate *m_uploadActionDelegate; // rcx\n  struct cocos2d::CCObject *v17; // rax\n  UserInfoDelegate *m_userInfoDelegate; // rcx\n  UploadActionDelegate *v19; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-68h] BYREF\n  __int128 v21; // [rsp+40h] [rbp-58h]\n\n  v6 = a3;\n  if ( a3[3] > 0xFu )\n    v6 = (_BYTE *)*a3;\n  *(_OWORD *)Block = 0;\n  v21 = 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 *)&v21 + 1) > 0xFu )\n  {\n    v9 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v21 + 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  v12 = GameLevelManager::getSplitIntFromKey(v11, v6, 2);\n  *(_OWORD *)Block = 0;\n  *(_QWORD *)&v21 = 2;\n  *((_QWORD *)&v21 + 1) = 15;\n  strcpy((char *)Block, \"-1\");\n  v13 = a2;\n  if ( (unsigned __int64)a2[3] > 0xF )\n    v13 = *a2;\n  v14 = (unsigned __int64)a2[2];\n  v15 = v14;\n  if ( v14 > 2 )\n    v15 = 2;\n  if ( !memcmp(v13, Block, v15) && v14 == 2 )\n  {\n    m_uploadActionDelegate = a1->m_uploadActionDelegate;\n    if ( m_uploadActionDelegate )\n      m_uploadActionDelegate->uploadActionFailed(m_uploadActionDelegate, v12, 31);\n  }\n  else\n  {\n    v17 = cocos2d::CCDictionary::objectForKey(a1->m_storedUserInfo, SplitIntFromKey);\n    if ( v17 )\n    {\n      v17[13].m_nTag = 1;\n      m_userInfoDelegate = a1->m_userInfoDelegate;\n      if ( m_userInfoDelegate )\n        m_userInfoDelegate->userInfoChanged(m_userInfoDelegate, (GJUserScore *)v17);\n    }\n    v19 = a1->m_uploadActionDelegate;\n    if ( v19 )\n      v19->uploadActionFinished(v19, v12, 31);\n    GameLevelManager::friendRequestWasRemoved(a1, SplitIntFromKey, 0);\n    GameLevelManager::resetStoredUserList(a1, (UserListType)0);\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onAcceptFriendRequestCompleted from 0x140161490 to 0x140161678 (488 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x1401436cc\n; > <???> @ 0x1406cab84\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    rbx                                                            ; +0x0, 0x140161490\npush    rbp                                                            ; +0x2, 0x140161492\npush    rsi                                                            ; +0x3, 0x140161493\npush    rdi                                                            ; +0x4, 0x140161494\npush    r12                                                            ; +0x5, 0x140161495\npush    r14                                                            ; +0x7, 0x140161497\npush    r15                                                            ; +0x9, 0x140161499\nsub     rsp, 60h                                                       ; +0xb, 0x14016149b\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x14016149f\nxor     rax, rsp                                                       ; +0x16, 0x1401614a6\nmov     [rsp+98h+var_48], rax                                          ; +0x19, 0x1401614a9\nmov     rsi, r8                                                        ; +0x1e, 0x1401614ae\nmov     r14, rdx                                                       ; +0x21, 0x1401614b1\nmov     rdi, rcx                                                       ; +0x24, 0x1401614b4\nmov     [rsp+98h+var_78], rdx                                          ; +0x27, 0x1401614b7\nmov     [rsp+98h+var_70], r8                                           ; +0x2c, 0x1401614bc\nmov     rbx, r8                                                        ; +0x31, 0x1401614c1\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x34, 0x1401614c4\njbe     short loc_1401614CE                                            ; +0x39, 0x1401614c9\nmov     rbx, [r8]                                                      ; +0x3b, 0x1401614cb\nxorps   xmm0, xmm0                                                     ; +0x3e, 0x1401614ce\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0x41, 0x1401614d1\nxorps   xmm1, xmm1                                                     ; +0x46, 0x1401614d6\nmovdqu  [rsp+98h+var_58], xmm1                                         ; +0x49, 0x1401614d9\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x4f, 0x1401614df\ninc     r8                                                             ; +0x56, 0x1401614e6\ncmp     byte ptr [rbx+r8], 0                                           ; +0x59, 0x1401614e9\njnz     short loc_1401614E6                                            ; +0x5e, 0x1401614ee\nmov     rdx, rbx                                                       ; +0x60, 0x1401614f0\nlea     rcx, [rsp+98h+Block]                                           ; +0x63, 0x1401614f3\ncall    sub_14003A930                                                  ; +0x68, 0x1401614f8\nnop                                                                    ; +0x6d, 0x1401614fd\nlea     rdx, [rsp+98h+Block]                                           ; +0x6e, 0x1401614fe\nmov     rcx, [rdi+250h]                                                ; +0x73, 0x140161503\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 &) ; +0x7a, 0x14016150a\nnop                                                                    ; +0x80, 0x140161510\nmov     rdx, qword ptr [rsp+98h+var_58+8]                              ; +0x81, 0x140161511\ncmp     rdx, 0Fh                                                       ; +0x86, 0x140161516\njbe     short loc_140161551                                            ; +0x8a, 0x14016151a\ninc     rdx                                                            ; +0x8c, 0x14016151c\nmov     rcx, [rsp+98h+Block]; Block                                    ; +0x8f, 0x14016151f\nmov     rax, rcx                                                       ; +0x94, 0x140161524\ncmp     rdx, 1000h                                                     ; +0x97, 0x140161527\njb      short loc_14016154C                                            ; +0x9e, 0x14016152e\nadd     rdx, 27h ; '''                                                 ; +0xa0, 0x140161530\nmov     rcx, [rcx-8]                                                   ; +0xa4, 0x140161534\nsub     rax, rcx                                                       ; +0xa8, 0x140161538\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xab, 0x14016153b\ncmp     rax, 1Fh                                                       ; +0xaf, 0x14016153f\njbe     short loc_14016154C                                            ; +0xb3, 0x140161543\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xb5, 0x140161545\nalign 4                                                                ; +0xbb, 0x14016154b\ncall    j_j_free                                                       ; +0xbc, 0x14016154c\nmov     r8d, 1                                                         ; +0xc1, 0x140161551\nmov     rdx, rbx                                                       ; +0xc7, 0x140161557\ncall    GameLevelManager__getSplitIntFromKey                           ; +0xca, 0x14016155a\nmovsxd  r15, eax                                                       ; +0xcf, 0x14016155f\nmov     r12d, 2                                                        ; +0xd2, 0x140161562\nmov     r8d, r12d                                                      ; +0xd8, 0x140161568\nmov     rdx, rbx                                                       ; +0xdb, 0x14016156b\ncall    GameLevelManager__getSplitIntFromKey                           ; +0xde, 0x14016156e\nmov     ebp, eax                                                       ; +0xe3, 0x140161573\nxorps   xmm0, xmm0                                                     ; +0xe5, 0x140161575\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0xe8, 0x140161578\nmov     qword ptr [rsp+98h+var_58], r12                                ; +0xed, 0x14016157d\nmov     qword ptr [rsp+98h+var_58+8], 0Fh                              ; +0xf2, 0x140161582\nmov     eax, 312Dh                                                     ; +0xfb, 0x14016158b\nmov     word ptr [rsp+98h+Block], ax                                   ; +0x100, 0x140161590\nmov     byte ptr [rsp+98h+Block+2], 0                                  ; +0x105, 0x140161595\nmov     rcx, r14                                                       ; +0x10a, 0x14016159a\ncmp     qword ptr [r14+18h], 0Fh                                       ; +0x10d, 0x14016159d\njbe     short loc_1401615A7                                            ; +0x112, 0x1401615a2\nmov     rcx, [r14]; Buf1                                               ; +0x114, 0x1401615a4\nmov     rbx, [r14+10h]                                                 ; +0x117, 0x1401615a7\nmov     r8, rbx                                                        ; +0x11b, 0x1401615ab\ncmp     rbx, r12                                                       ; +0x11e, 0x1401615ae\ncmova   r8, r12; Size                                                  ; +0x121, 0x1401615b1\nlea     rdx, [rsp+98h+Block]; Buf2                                     ; +0x125, 0x1401615b5\ncall    memcmp                                                         ; +0x12a, 0x1401615ba\ntest    eax, eax                                                       ; +0x12f, 0x1401615bf\njnz     short loc_1401615E4                                            ; +0x131, 0x1401615c1\ncmp     rbx, r12                                                       ; +0x133, 0x1401615c3\njnz     short loc_1401615E4                                            ; +0x136, 0x1401615c6\nmov     rcx, [rdi+328h]                                                ; +0x138, 0x1401615c8\ntest    rcx, rcx                                                       ; +0x13f, 0x1401615cf\njz      short loc_14016164B                                            ; +0x142, 0x1401615d2\nmov     rax, [rcx]                                                     ; +0x144, 0x1401615d4\nmov     r8d, 1Fh                                                       ; +0x147, 0x1401615d7\nmov     edx, ebp                                                       ; +0x14d, 0x1401615dd\ncall    qword ptr [rax+8]                                              ; +0x14f, 0x1401615df\njmp     short loc_14016164B                                            ; +0x152, 0x1401615e2\nmov     rdx, r15                                                       ; +0x154, 0x1401615e4\nmov     rcx, [rdi+258h]                                                ; +0x157, 0x1401615e7\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x15e, 0x1401615ee\ntest    rax, rax                                                       ; +0x164, 0x1401615f4\njz      short loc_140161619                                            ; +0x167, 0x1401615f7\nmov     dword ptr [rax+2E8h], 1                                        ; +0x169, 0x1401615f9\nmov     rcx, [rdi+320h]                                                ; +0x173, 0x140161603\ntest    rcx, rcx                                                       ; +0x17a, 0x14016160a\njz      short loc_140161619                                            ; +0x17d, 0x14016160d\nmov     r8, [rcx]                                                      ; +0x17f, 0x14016160f\nmov     rdx, rax                                                       ; +0x182, 0x140161612\ncall    qword ptr [r8+10h]                                             ; +0x185, 0x140161615\nmov     rcx, [rdi+328h]                                                ; +0x189, 0x140161619\ntest    rcx, rcx                                                       ; +0x190, 0x140161620\njz      short loc_140161632                                            ; +0x193, 0x140161623\nmov     rax, [rcx]                                                     ; +0x195, 0x140161625\nmov     r8d, 1Fh                                                       ; +0x198, 0x140161628\nmov     edx, ebp                                                       ; +0x19e, 0x14016162e\ncall    qword ptr [rax]                                                ; +0x1a0, 0x140161630\nxor     r8d, r8d                                                       ; +0x1a2, 0x140161632\nmov     edx, r15d                                                      ; +0x1a5, 0x140161635\nmov     rcx, rdi                                                       ; +0x1a8, 0x140161638\ncall    GameLevelManager__friendRequestWasRemoved                      ; +0x1ab, 0x14016163b\nxor     edx, edx                                                       ; +0x1b0, 0x140161640\nmov     rcx, rdi                                                       ; +0x1b2, 0x140161642\ncall    GameLevelManager__resetStoredUserList                          ; +0x1b5, 0x140161645\nnop                                                                    ; +0x1ba, 0x14016164a\nmov     rcx, r14                                                       ; +0x1bb, 0x14016164b\ncall    sub_14003A830                                                  ; +0x1be, 0x14016164e\nnop                                                                    ; +0x1c3, 0x140161653\nmov     rcx, rsi                                                       ; +0x1c4, 0x140161654\ncall    sub_14003A830                                                  ; +0x1c7, 0x140161657\nmov     rcx, [rsp+98h+var_48]                                          ; +0x1cc, 0x14016165c\nxor     rcx, rsp; StackCookie                                          ; +0x1d1, 0x140161661\ncall    __security_check_cookie                                        ; +0x1d4, 0x140161664\nadd     rsp, 60h                                                       ; +0x1d9, 0x140161669\npop     r15                                                            ; +0x1dd, 0x14016166d\npop     r14                                                            ; +0x1df, 0x14016166f\npop     r12                                                            ; +0x1e1, 0x140161671\npop     rdi                                                            ; +0x1e3, 0x140161673\npop     rsi                                                            ; +0x1e4, 0x140161674\npop     rbp                                                            ; +0x1e5, 0x140161675\npop     rbx                                                            ; +0x1e6, 0x140161676\nretn                                                                   ; +0x1e7, 0x140161677", "xrefs": ["GameLevelManager::handleIt @ 0x1401436cc", "<???> @ 0x1406cab84"], "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"}