{"type": "func", "start": 5370153376, "end": 5370153830, "name": "GameLevelManager::onUploadFriendRequestCompleted", "pseudocode": "// \n// GameLevelManager::onUploadFriendRequestCompleted from 0x1401609a0 to 0x140160b66 (454 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x140143656\n// > <???> @ 0x1406cab54\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::onUploadFriendRequestCompleted(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; // r14\n  const void *v11; // rcx\n  size_t v12; // r8\n  UploadActionDelegate *m_uploadActionDelegate; // rcx\n  struct cocos2d::CCObject *v14; // rax\n  UserInfoDelegate *m_userInfoDelegate; // rcx\n  UploadActionDelegate *v16; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-58h] BYREF\n  __int128 v18; // [rsp+40h] [rbp-48h]\n\n  v6 = a3;\n  if ( a3[3] > 0xFu )\n    v6 = (_BYTE *)*a3;\n  *(_OWORD *)Block = 0;\n  v18 = 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 *)&v18 + 1) > 0xFu )\n  {\n    v9 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v18 + 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 *)&v18 = 2;\n  *((_QWORD *)&v18 + 1) = 15;\n  strcpy((char *)Block, \"-1\");\n  v11 = a2;\n  if ( (unsigned __int64)a2[3] > 0xF )\n    v11 = *a2;\n  v12 = (size_t)a2[2];\n  if ( v12 > 2 )\n    v12 = 2;\n  if ( !memcmp(v11, Block, v12) && a2[2] == (const void *)2 )\n  {\n    m_uploadActionDelegate = a1->m_uploadActionDelegate;\n    if ( m_uploadActionDelegate )\n      m_uploadActionDelegate->uploadActionFailed(m_uploadActionDelegate, SplitIntFromKey, 29);\n    GameLevelManager::resetTimerForKey(a1, v6);\n  }\n  else\n  {\n    v14 = cocos2d::CCDictionary::objectForKey(a1->m_storedUserInfo, SplitIntFromKey);\n    if ( v14 )\n    {\n      v14[13].m_nTag = 4;\n      m_userInfoDelegate = a1->m_userInfoDelegate;\n      if ( m_userInfoDelegate )\n        m_userInfoDelegate->userInfoChanged(m_userInfoDelegate, (GJUserScore *)v14);\n    }\n    v16 = a1->m_uploadActionDelegate;\n    if ( v16 )\n      v16->uploadActionFinished(v16, SplitIntFromKey, 29);\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onUploadFriendRequestCompleted from 0x1401609a0 to 0x140160b66 (454 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x140143656\n; > <???> @ 0x1406cab54\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, 0x1401609a0\npush    rbp                                                            ; +0x2, 0x1401609a2\npush    rsi                                                            ; +0x3, 0x1401609a3\npush    rdi                                                            ; +0x4, 0x1401609a4\npush    r14                                                            ; +0x5, 0x1401609a5\nsub     rsp, 60h                                                       ; +0x7, 0x1401609a7\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x1401609ab\nxor     rax, rsp                                                       ; +0x12, 0x1401609b2\nmov     [rsp+88h+var_38], rax                                          ; +0x15, 0x1401609b5\nmov     rsi, r8                                                        ; +0x1a, 0x1401609ba\nmov     rdi, rdx                                                       ; +0x1d, 0x1401609bd\nmov     rbp, rcx                                                       ; +0x20, 0x1401609c0\nmov     [rsp+88h+var_68], rdx                                          ; +0x23, 0x1401609c3\nmov     [rsp+88h+var_60], r8                                           ; +0x28, 0x1401609c8\nmov     rbx, r8                                                        ; +0x2d, 0x1401609cd\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x30, 0x1401609d0\njbe     short loc_1401609DA                                            ; +0x35, 0x1401609d5\nmov     rbx, [r8]                                                      ; +0x37, 0x1401609d7\nxorps   xmm0, xmm0                                                     ; +0x3a, 0x1401609da\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x3d, 0x1401609dd\nxorps   xmm1, xmm1                                                     ; +0x42, 0x1401609e2\nmovdqu  [rsp+88h+var_48], xmm1                                         ; +0x45, 0x1401609e5\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x4b, 0x1401609eb\ninc     r8                                                             ; +0x52, 0x1401609f2\ncmp     byte ptr [rbx+r8], 0                                           ; +0x55, 0x1401609f5\njnz     short loc_1401609F2                                            ; +0x5a, 0x1401609fa\nmov     rdx, rbx                                                       ; +0x5c, 0x1401609fc\nlea     rcx, [rsp+88h+Block]                                           ; +0x5f, 0x1401609ff\ncall    sub_14003A930                                                  ; +0x64, 0x140160a04\nnop                                                                    ; +0x69, 0x140160a09\nlea     rdx, [rsp+88h+Block]                                           ; +0x6a, 0x140160a0a\nmov     rcx, [rbp+250h]                                                ; +0x6f, 0x140160a0f\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 &) ; +0x76, 0x140160a16\nnop                                                                    ; +0x7c, 0x140160a1c\nmov     rdx, qword ptr [rsp+88h+var_48+8]                              ; +0x7d, 0x140160a1d\ncmp     rdx, 0Fh                                                       ; +0x82, 0x140160a22\njbe     short loc_140160A5D                                            ; +0x86, 0x140160a26\ninc     rdx                                                            ; +0x88, 0x140160a28\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0x8b, 0x140160a2b\nmov     rax, rcx                                                       ; +0x90, 0x140160a30\ncmp     rdx, 1000h                                                     ; +0x93, 0x140160a33\njb      short loc_140160A58                                            ; +0x9a, 0x140160a3a\nadd     rdx, 27h ; '''                                                 ; +0x9c, 0x140160a3c\nmov     rcx, [rcx-8]                                                   ; +0xa0, 0x140160a40\nsub     rax, rcx                                                       ; +0xa4, 0x140160a44\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa7, 0x140160a47\ncmp     rax, 1Fh                                                       ; +0xab, 0x140160a4b\njbe     short loc_140160A58                                            ; +0xaf, 0x140160a4f\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xb1, 0x140160a51\nalign 8                                                                ; +0xb7, 0x140160a57\ncall    j_j_free                                                       ; +0xb8, 0x140160a58\nmov     r8d, 1                                                         ; +0xbd, 0x140160a5d\nmov     rdx, rbx                                                       ; +0xc3, 0x140160a63\ncall    GameLevelManager__getSplitIntFromKey                           ; +0xc6, 0x140160a66\nmovsxd  r14, eax                                                       ; +0xcb, 0x140160a6b\nxorps   xmm0, xmm0                                                     ; +0xce, 0x140160a6e\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0xd1, 0x140160a71\nmov     edx, 2                                                         ; +0xd6, 0x140160a76\nmov     qword ptr [rsp+88h+var_48], rdx                                ; +0xdb, 0x140160a7b\nmov     qword ptr [rsp+88h+var_48+8], 0Fh                              ; +0xe0, 0x140160a80\nmov     eax, 312Dh                                                     ; +0xe9, 0x140160a89\nmov     word ptr [rsp+88h+Block], ax                                   ; +0xee, 0x140160a8e\nmov     byte ptr [rsp+88h+Block+2], 0                                  ; +0xf3, 0x140160a93\nmov     rcx, rdi                                                       ; +0xf8, 0x140160a98\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xfb, 0x140160a9b\njbe     short loc_140160AA5                                            ; +0x100, 0x140160aa0\nmov     rcx, [rdi]; Buf1                                               ; +0x102, 0x140160aa2\nmov     r8, [rdi+10h]                                                  ; +0x105, 0x140160aa5\ncmp     r8, rdx                                                        ; +0x109, 0x140160aa9\ncmova   r8, rdx; Size                                                  ; +0x10c, 0x140160aac\nlea     rdx, [rsp+88h+Block]; Buf2                                     ; +0x110, 0x140160ab0\ncall    memcmp                                                         ; +0x115, 0x140160ab5\ntest    eax, eax                                                       ; +0x11a, 0x140160aba\njnz     short loc_140160AED                                            ; +0x11c, 0x140160abc\ncmp     qword ptr [rdi+10h], 2                                         ; +0x11e, 0x140160abe\njnz     short loc_140160AED                                            ; +0x123, 0x140160ac3\nmov     rcx, [rbp+328h]                                                ; +0x125, 0x140160ac5\ntest    rcx, rcx                                                       ; +0x12c, 0x140160acc\njz      short loc_140160AE0                                            ; +0x12f, 0x140160acf\nmov     rax, [rcx]                                                     ; +0x131, 0x140160ad1\nmov     r8d, 1Dh                                                       ; +0x134, 0x140160ad4\nmov     edx, r14d                                                      ; +0x13a, 0x140160ada\ncall    qword ptr [rax+8]                                              ; +0x13d, 0x140160add\nmov     rdx, rbx                                                       ; +0x140, 0x140160ae0\nmov     rcx, rbp                                                       ; +0x143, 0x140160ae3\ncall    GameLevelManager__resetTimerForKey                             ; +0x146, 0x140160ae6\njmp     short loc_140160B3D                                            ; +0x14b, 0x140160aeb\nmov     rdx, r14                                                       ; +0x14d, 0x140160aed\nmov     rcx, [rbp+258h]                                                ; +0x150, 0x140160af0\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x157, 0x140160af7\ntest    rax, rax                                                       ; +0x15d, 0x140160afd\njz      short loc_140160B22                                            ; +0x160, 0x140160b00\nmov     dword ptr [rax+2E8h], 4                                        ; +0x162, 0x140160b02\nmov     rcx, [rbp+320h]                                                ; +0x16c, 0x140160b0c\ntest    rcx, rcx                                                       ; +0x173, 0x140160b13\njz      short loc_140160B22                                            ; +0x176, 0x140160b16\nmov     r8, [rcx]                                                      ; +0x178, 0x140160b18\nmov     rdx, rax                                                       ; +0x17b, 0x140160b1b\ncall    qword ptr [r8+10h]                                             ; +0x17e, 0x140160b1e\nmov     rcx, [rbp+328h]                                                ; +0x182, 0x140160b22\ntest    rcx, rcx                                                       ; +0x189, 0x140160b29\njz      short loc_140160B3D                                            ; +0x18c, 0x140160b2c\nmov     rax, [rcx]                                                     ; +0x18e, 0x140160b2e\nmov     r8d, 1Dh                                                       ; +0x191, 0x140160b31\nmov     edx, r14d                                                      ; +0x197, 0x140160b37\ncall    qword ptr [rax]                                                ; +0x19a, 0x140160b3a\nnop                                                                    ; +0x19c, 0x140160b3c\nmov     rcx, rdi                                                       ; +0x19d, 0x140160b3d\ncall    sub_14003A830                                                  ; +0x1a0, 0x140160b40\nnop                                                                    ; +0x1a5, 0x140160b45\nmov     rcx, rsi                                                       ; +0x1a6, 0x140160b46\ncall    sub_14003A830                                                  ; +0x1a9, 0x140160b49\nmov     rcx, [rsp+88h+var_38]                                          ; +0x1ae, 0x140160b4e\nxor     rcx, rsp; StackCookie                                          ; +0x1b3, 0x140160b53\ncall    __security_check_cookie                                        ; +0x1b6, 0x140160b56\nadd     rsp, 60h                                                       ; +0x1bb, 0x140160b5b\npop     r14                                                            ; +0x1bf, 0x140160b5f\npop     rdi                                                            ; +0x1c1, 0x140160b61\npop     rsi                                                            ; +0x1c2, 0x140160b62\npop     rbp                                                            ; +0x1c3, 0x140160b63\npop     rbx                                                            ; +0x1c4, 0x140160b64\nretn                                                                   ; +0x1c5, 0x140160b65", "xrefs": ["GameLevelManager::handleIt @ 0x140143656", "<???> @ 0x1406cab54"], "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"}