{"type": "func", "start": 5370131088, "end": 5370131628, "name": "GameLevelManager::onUploadUserMessageCompleted", "pseudocode": "// \n// GameLevelManager::onUploadUserMessageCompleted from 0x14015b290 to 0x14015b4ac (540 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x1401439ac\n// > <???> @ 0x1406caa28\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=4\nvoid __fastcall GameLevelManager::onUploadUserMessageCompleted(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  unsigned int SplitIntFromKey; // r13d\n  const void *v11; // rcx\n  unsigned __int64 v12; // r12\n  size_t v13; // r8\n  int v14; // ebp\n  UploadMessageDelegate *v15; // rcx\n  cocos2d::CCString *v16; // rax\n  const char *CString; // rbx\n  GameLevelManager *v18; // rcx\n  UploadMessageDelegate *m_uploadMessageDelegate; // rcx\n  void *v20; // [rsp+28h] [rbp-80h]\n  void *Block[2]; // [rsp+40h] [rbp-68h] BYREF\n  __int64 v22; // [rsp+50h] [rbp-58h]\n  unsigned __int64 v23; // [rsp+58h] [rbp-50h]\n\n  v6 = a3;\n  if ( a3[3] > 0xFu )\n    v6 = (_BYTE *)*a3;\n  *(_OWORD *)Block = 0;\n  v22 = 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 ( v23 > 0xF )\n  {\n    v9 = Block[0];\n    if ( v23 + 1 >= 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  v22 = 2;\n  v23 = 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  v14 = memcmp(v11, Block, v13);\n  if ( !v14 )\n  {\n    if ( v12 >= 2 )\n      v14 = v12 > 2;\n    else\n      v14 = -1;\n  }\n  if ( v14 )\n  {\n    v16 = cocos2d::CCString::createWithFormat(\"messages_%i_%i\", 1, 0);\n    CString = cocos2d::CCString::getCString(v16);\n    v18 = (GameLevelManager *)qword_1406C2EC0;\n    if ( !qword_1406C2EC0 )\n    {\n      v20 = operator new(0x3D0u);\n      qword_1406C2EC0 = sub_140141280((__int64)v20);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n      v18 = (GameLevelManager *)qword_1406C2EC0;\n    }\n    GameLevelManager::resetTimerForKey(v18, CString);\n    m_uploadMessageDelegate = a1->m_uploadMessageDelegate;\n    if ( m_uploadMessageDelegate )\n      m_uploadMessageDelegate->uploadMessageFinished(m_uploadMessageDelegate, SplitIntFromKey);\n  }\n  else\n  {\n    v15 = a1->m_uploadMessageDelegate;\n    if ( v15 )\n      v15->uploadMessageFailed(v15, SplitIntFromKey);\n    GameLevelManager::resetTimerForKey(a1, v6);\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onUploadUserMessageCompleted from 0x14015b290 to 0x14015b4ac (540 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x1401439ac\n; > <???> @ 0x1406caa28\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, 0x14015b290\npush    rbp                                                            ; +0x5, 0x14015b295\npush    rsi                                                            ; +0x6, 0x14015b296\npush    rdi                                                            ; +0x7, 0x14015b297\npush    r12                                                            ; +0x8, 0x14015b298\npush    r13                                                            ; +0xa, 0x14015b29a\npush    r14                                                            ; +0xc, 0x14015b29c\npush    r15                                                            ; +0xe, 0x14015b29e\nsub     rsp, 70h                                                       ; +0x10, 0x14015b2a0\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x14015b2a4\nxor     rax, rsp                                                       ; +0x1b, 0x14015b2ab\nmov     [rsp+0A8h+var_48], rax                                         ; +0x1e, 0x14015b2ae\nmov     rdi, r8                                                        ; +0x23, 0x14015b2b3\nmov     rsi, rdx                                                       ; +0x26, 0x14015b2b6\nmov     r15, rcx                                                       ; +0x29, 0x14015b2b9\nmov     [rsp+0A8h+var_78], rdx                                         ; +0x2c, 0x14015b2bc\nmov     [rsp+0A8h+var_70], r8                                          ; +0x31, 0x14015b2c1\nmov     rbx, r8                                                        ; +0x36, 0x14015b2c6\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x39, 0x14015b2c9\njbe     short loc_14015B2D3                                            ; +0x3e, 0x14015b2ce\nmov     rbx, [r8]                                                      ; +0x40, 0x14015b2d0\nxorps   xmm0, xmm0                                                     ; +0x43, 0x14015b2d3\nmovups  xmmword ptr [rsp+0A8h+Block], xmm0                             ; +0x46, 0x14015b2d6\nxor     eax, eax                                                       ; +0x4b, 0x14015b2db\nmov     [rsp+0A8h+var_58], rax                                         ; +0x4d, 0x14015b2dd\nmov     [rsp+0A8h+var_50], rax                                         ; +0x52, 0x14015b2e2\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x57, 0x14015b2e7\nxchg    ax, ax                                                         ; +0x5e, 0x14015b2ee\ninc     r8                                                             ; +0x60, 0x14015b2f0\ncmp     [rbx+r8], al                                                   ; +0x63, 0x14015b2f3\njnz     short loc_14015B2F0                                            ; +0x67, 0x14015b2f7\nmov     rdx, rbx                                                       ; +0x69, 0x14015b2f9\nlea     rcx, [rsp+0A8h+Block]                                          ; +0x6c, 0x14015b2fc\ncall    sub_14003A930                                                  ; +0x71, 0x14015b301\nnop                                                                    ; +0x76, 0x14015b306\nlea     rdx, [rsp+0A8h+Block]                                          ; +0x77, 0x14015b307\nmov     rcx, [r15+250h]                                                ; +0x7c, 0x14015b30c\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 &) ; +0x83, 0x14015b313\nnop                                                                    ; +0x89, 0x14015b319\nmov     rdx, [rsp+0A8h+var_50]                                         ; +0x8a, 0x14015b31a\ncmp     rdx, 0Fh                                                       ; +0x8f, 0x14015b31f\njbe     short loc_14015B35A                                            ; +0x93, 0x14015b323\ninc     rdx                                                            ; +0x95, 0x14015b325\nmov     rcx, [rsp+0A8h+Block]; Block                                   ; +0x98, 0x14015b328\nmov     rax, rcx                                                       ; +0x9d, 0x14015b32d\ncmp     rdx, 1000h                                                     ; +0xa0, 0x14015b330\njb      short loc_14015B355                                            ; +0xa7, 0x14015b337\nadd     rdx, 27h ; '''                                                 ; +0xa9, 0x14015b339\nmov     rcx, [rcx-8]                                                   ; +0xad, 0x14015b33d\nsub     rax, rcx                                                       ; +0xb1, 0x14015b341\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xb4, 0x14015b344\ncmp     rax, 1Fh                                                       ; +0xb8, 0x14015b348\njbe     short loc_14015B355                                            ; +0xbc, 0x14015b34c\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xbe, 0x14015b34e\ndb 0CCh                                                                ; +0xc4, 0x14015b354\ncall    j_j_free                                                       ; +0xc5, 0x14015b355\nmov     r8d, 1                                                         ; +0xca, 0x14015b35a\nmov     rdx, rbx                                                       ; +0xd0, 0x14015b360\ncall    GameLevelManager__getSplitIntFromKey                           ; +0xd3, 0x14015b363\nmov     r13d, eax                                                      ; +0xd8, 0x14015b368\nxorps   xmm0, xmm0                                                     ; +0xdb, 0x14015b36b\nmovups  xmmword ptr [rsp+0A8h+Block], xmm0                             ; +0xde, 0x14015b36e\nmov     eax, 2                                                         ; +0xe3, 0x14015b373\nmov     [rsp+0A8h+var_58], rax                                         ; +0xe8, 0x14015b378\nmov     r8d, 0Fh                                                       ; +0xed, 0x14015b37d\nmov     [rsp+0A8h+var_50], r8                                          ; +0xf3, 0x14015b383\nmovzx   ecx, cs:word_1405334A0                                         ; +0xf8, 0x14015b388\nmov     word ptr [rsp+0A8h+Block], cx                                  ; +0xff, 0x14015b38f\nmov     byte ptr [rsp+0A8h+Block+2], 0                                 ; +0x104, 0x14015b394\nlea     rdx, [rsp+0A8h+Block]; Buf2                                    ; +0x109, 0x14015b399\nmov     rcx, rsi                                                       ; +0x10e, 0x14015b39e\ncmp     [rsi+18h], r8                                                  ; +0x111, 0x14015b3a1\njbe     short loc_14015B3AA                                            ; +0x115, 0x14015b3a5\nmov     rcx, [rsi]; Buf1                                               ; +0x117, 0x14015b3a7\nmov     r12, [rsi+10h]                                                 ; +0x11a, 0x14015b3aa\nmov     r8, r12                                                        ; +0x11e, 0x14015b3ae\ncmp     rax, r12                                                       ; +0x121, 0x14015b3b1\ncmovb   r8, rax; Size                                                  ; +0x124, 0x14015b3b4\ncall    memcmp                                                         ; +0x128, 0x14015b3b8\nmov     ebp, eax                                                       ; +0x12d, 0x14015b3bd\ntest    eax, eax                                                       ; +0x12f, 0x14015b3bf\njnz     short loc_14015B3D8                                            ; +0x131, 0x14015b3c1\ncmp     r12, 2                                                         ; +0x133, 0x14015b3c3\njnb     short loc_14015B3CE                                            ; +0x137, 0x14015b3c7\nlea     ebp, [rax-1]                                                   ; +0x139, 0x14015b3c9\njmp     short loc_14015B3D8                                            ; +0x13c, 0x14015b3cc\nxor     ebp, ebp                                                       ; +0x13e, 0x14015b3ce\ncmp     r12, 2                                                         ; +0x140, 0x14015b3d0\nsetnbe  bpl                                                            ; +0x144, 0x14015b3d4\ntest    ebp, ebp                                                       ; +0x148, 0x14015b3d8\njnz     short loc_14015B3FE                                            ; +0x14a, 0x14015b3da\nmov     rcx, [r15+350h]                                                ; +0x14c, 0x14015b3dc\ntest    rcx, rcx                                                       ; +0x153, 0x14015b3e3\njz      short loc_14015B3F1                                            ; +0x156, 0x14015b3e6\nmov     rax, [rcx]                                                     ; +0x158, 0x14015b3e8\nmov     edx, r13d                                                      ; +0x15b, 0x14015b3eb\ncall    qword ptr [rax+8]                                              ; +0x15e, 0x14015b3ee\nmov     rdx, rbx                                                       ; +0x161, 0x14015b3f1\nmov     rcx, r15                                                       ; +0x164, 0x14015b3f4\ncall    GameLevelManager__resetTimerForKey                             ; +0x167, 0x14015b3f7\njmp     short loc_14015B476                                            ; +0x16c, 0x14015b3fc\nxor     r8d, r8d                                                       ; +0x16e, 0x14015b3fe\nlea     edx, [r8+1]                                                    ; +0x171, 0x14015b401\nlea     rcx, aMessagesII; \"messages_%i_%i\"                             ; +0x175, 0x14015b405\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x17c, 0x14015b40c\nmov     rcx, rax                                                       ; +0x182, 0x14015b412\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x185, 0x14015b415\nmov     rbx, rax                                                       ; +0x18b, 0x14015b41b\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x18e, 0x14015b41e\ntest    rcx, rcx                                                       ; +0x195, 0x14015b425\njnz     short loc_14015B459                                            ; +0x198, 0x14015b428\nmov     ecx, 3D0h; Size                                                ; +0x19a, 0x14015b42a\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x19f, 0x14015b42f\nmov     [rsp+0A8h+var_80], rax                                         ; +0x1a4, 0x14015b434\nmov     rcx, rax                                                       ; +0x1a9, 0x14015b439\ncall    sub_140141280                                                  ; +0x1ac, 0x14015b43c\nnop                                                                    ; +0x1b1, 0x14015b441\nmov     cs:qword_1406C2EC0, rax                                        ; +0x1b2, 0x14015b442\nmov     rdx, [rax]                                                     ; +0x1b9, 0x14015b449\nmov     rcx, rax                                                       ; +0x1bc, 0x14015b44c\ncall    qword ptr [rdx+48h]                                            ; +0x1bf, 0x14015b44f\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x1c2, 0x14015b452\nmov     rdx, rbx                                                       ; +0x1c9, 0x14015b459\ncall    GameLevelManager__resetTimerForKey                             ; +0x1cc, 0x14015b45c\nmov     rcx, [r15+350h]                                                ; +0x1d1, 0x14015b461\ntest    rcx, rcx                                                       ; +0x1d8, 0x14015b468\njz      short loc_14015B476                                            ; +0x1db, 0x14015b46b\nmov     rax, [rcx]                                                     ; +0x1dd, 0x14015b46d\nmov     edx, r13d                                                      ; +0x1e0, 0x14015b470\ncall    qword ptr [rax]                                                ; +0x1e3, 0x14015b473\nnop                                                                    ; +0x1e5, 0x14015b475\nmov     rcx, rsi                                                       ; +0x1e6, 0x14015b476\ncall    sub_14003A830                                                  ; +0x1e9, 0x14015b479\nnop                                                                    ; +0x1ee, 0x14015b47e\nmov     rcx, rdi                                                       ; +0x1ef, 0x14015b47f\ncall    sub_14003A830                                                  ; +0x1f2, 0x14015b482\nmov     rcx, [rsp+0A8h+var_48]                                         ; +0x1f7, 0x14015b487\nxor     rcx, rsp; StackCookie                                          ; +0x1fc, 0x14015b48c\ncall    __security_check_cookie                                        ; +0x1ff, 0x14015b48f\nmov     rbx, [rsp+0A8h+arg_18]                                         ; +0x204, 0x14015b494\nadd     rsp, 70h                                                       ; +0x20c, 0x14015b49c\npop     r15                                                            ; +0x210, 0x14015b4a0\npop     r14                                                            ; +0x212, 0x14015b4a2\npop     r13                                                            ; +0x214, 0x14015b4a4\npop     r12                                                            ; +0x216, 0x14015b4a6\npop     rdi                                                            ; +0x218, 0x14015b4a8\npop     rsi                                                            ; +0x219, 0x14015b4a9\npop     rbp                                                            ; +0x21a, 0x14015b4aa\nretn                                                                   ; +0x21b, 0x14015b4ab", "xrefs": ["GameLevelManager::handleIt @ 0x1401439ac", "<???> @ 0x1406caa28"], "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"}