{"type": "func", "start": 5372451280, "end": 5372451725, "name": "GJMultiplayerManager::addComment", "pseudocode": "// \n// GJMultiplayerManager::addComment from 0x1403919d0 to 0x140391b8d (445 bytes)\n// \n// 3 xrefs:\n// > GJMultiplayerManager::onJoinLobbyCompleted @ 0x14039116e\n// > GJMultiplayerManager::createAndAddComment @ 0x140391924\n// > <???> @ 0x140922ff4\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:31:11 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall GJMultiplayerManager::addComment(__int64 a1, __int64 a2, int a3)\n{\n  unsigned int v5; // ebx\n  __int64 v6; // rdi\n  __int64 v7; // rcx\n  struct cocos2d::CCObject *v8; // rsi\n  _QWORD *v9; // rax\n  __int64 v10; // rax\n  char *v11; // rbp\n  __int64 v12; // rax\n  struct cocos2d::CCObject *v13; // rdi\n  __int64 v14; // rax\n  struct cocos2d::CCObject *v15; // rax\n  void **v16; // rdx\n  void *Src[4]; // [rsp+28h] [rbp-80h] BYREF\n  _BYTE v18[32]; // [rsp+48h] [rbp-60h] BYREF\n  __int64 v19; // [rsp+68h] [rbp-40h]\n\n  v19 = a2;\n  v5 = 0;\n  v6 = a3;\n  v8 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 344), a3);\n  if ( !v8 )\n  {\n    v8 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v7);\n    cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 344), v8, v6);\n  }\n  v9 = (_QWORD *)sub_14003F4F0((__int64)v18, a2);\n  v10 = GameLevelManager::responseToDict(v9, 1);\n  v11 = GJComment::create(v10);\n  v12 = GJAccountManager::sharedState();\n  if ( *((_DWORD *)v11 + 101) == *(_DWORD *)(v12 + 360) - *(_DWORD *)(v12 + 364)\n    && *((_DWORD *)v11 + 96) != -1\n    && cocos2d::CCArray::count(v8) )\n  {\n    while ( 1 )\n    {\n      v13 = cocos2d::CCArray::objectAtIndex(v8, v5);\n      v14 = GJAccountManager::sharedState();\n      if ( *((_DWORD *)v13 + 101) == *(_DWORD *)(v14 + 360) - *(_DWORD *)(v14 + 364) && *((_DWORD *)v13 + 96) == -1 )\n        break;\n      if ( ++v5 >= cocos2d::CCArray::count(v8) )\n        goto LABEL_9;\n    }\n    *((_DWORD *)v13 + 96) = *((_DWORD *)v11 + 96);\n  }\n  else\n  {\nLABEL_9:\n    v11[457] = 1;\n    v15 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 328), *((int *)v11 + 101));\n    if ( v15 )\n    {\n      sub_14003F4F0((__int64)Src, (__int64)v15 + 320);\n      if ( v11 + 352 != (char *)Src )\n      {\n        v16 = Src;\n        if ( Src[3] > (void *)0xF )\n          v16 = (void **)Src[0];\n        sub_1400405A0((void **)v11 + 44, v16, (size_t)Src[2]);\n      }\n      sub_14003D310((__int64)Src);\n    }\n    cocos2d::CCArray::addObject(v8, (struct cocos2d::CCObject *)v11);\n  }\n  sub_14003D310(a2);\n}", "assembly": "; \n; GJMultiplayerManager::addComment from 0x1403919d0 to 0x140391b8d (445 bytes)\n; \n; 3 xrefs:\n; > GJMultiplayerManager::onJoinLobbyCompleted @ 0x14039116e\n; > GJMultiplayerManager::createAndAddComment @ 0x140391924\n; > <???> @ 0x140922ff4\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:31:11 +0000\n; \nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x1403919d0\npush    rbp                                                            ; +0x5, 0x1403919d5\npush    rsi                                                            ; +0x6, 0x1403919d6\npush    rdi                                                            ; +0x7, 0x1403919d7\npush    r14                                                            ; +0x8, 0x1403919d8\npush    r15                                                            ; +0xa, 0x1403919da\nsub     rsp, 80h                                                       ; +0xc, 0x1403919dc\nmov     rax, cs:__security_cookie                                      ; +0x13, 0x1403919e3\nxor     rax, rsp                                                       ; +0x1a, 0x1403919ea\nmov     [rsp+0A8h+var_38], rax                                         ; +0x1d, 0x1403919ed\nmov     r15, rdx                                                       ; +0x22, 0x1403919f2\nmov     r14, rcx                                                       ; +0x25, 0x1403919f5\nmov     [rsp+0A8h+var_40], rdx                                         ; +0x28, 0x1403919f8\nxor     ebx, ebx                                                       ; +0x2d, 0x1403919fd\nmovsxd  rdi, r8d                                                       ; +0x2f, 0x1403919ff\nmov     rdx, rdi                                                       ; +0x32, 0x140391a02\nmov     rcx, [rcx+158h]                                                ; +0x35, 0x140391a05\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x3c, 0x140391a0c\nmov     rsi, rax                                                       ; +0x42, 0x140391a12\ntest    rax, rax                                                       ; +0x45, 0x140391a15\njnz     short loc_140391A36                                            ; +0x48, 0x140391a18\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x4a, 0x140391a1a\nmov     rsi, rax                                                       ; +0x50, 0x140391a20\nmov     r8, rdi                                                        ; +0x53, 0x140391a23\nmov     rdx, rax                                                       ; +0x56, 0x140391a26\nmov     rcx, [r14+158h]                                                ; +0x59, 0x140391a29\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,__int64) ; +0x60, 0x140391a30\nmov     rdx, r15                                                       ; +0x66, 0x140391a36\nlea     rcx, [rsp+0A8h+var_60]                                         ; +0x69, 0x140391a39\ncall    sub_14003F4F0                                                  ; +0x6e, 0x140391a3e\nmov     dl, 1                                                          ; +0x73, 0x140391a43\nmov     rcx, rax                                                       ; +0x75, 0x140391a45\ncall    GameLevelManager__responseToDict                               ; +0x78, 0x140391a48\nmov     rcx, rax                                                       ; +0x7d, 0x140391a4d\ncall    GJComment__create                                              ; +0x80, 0x140391a50\nmov     rbp, rax                                                       ; +0x85, 0x140391a55\ncall    GJAccountManager__sharedState                                  ; +0x88, 0x140391a58\nmov     ecx, [rax+168h]                                                ; +0x8d, 0x140391a5d\nsub     ecx, [rax+16Ch]                                                ; +0x93, 0x140391a63\ncmp     [rbp+194h], ecx                                                ; +0x99, 0x140391a69\njnz     short loc_140391AD3                                            ; +0x9f, 0x140391a6f\ncmp     dword ptr [rbp+180h], 0FFFFFFFFh                               ; +0xa1, 0x140391a71\njz      short loc_140391AD3                                            ; +0xa8, 0x140391a78\nmov     rcx, rsi                                                       ; +0xaa, 0x140391a7a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xad, 0x140391a7d\ntest    eax, eax                                                       ; +0xb3, 0x140391a83\njz      short loc_140391AD3                                            ; +0xb5, 0x140391a85\nnop     word ptr [rax+rax+00000000h]                                   ; +0xb7, 0x140391a87\nmov     edx, ebx                                                       ; +0xc0, 0x140391a90\nmov     rcx, rsi                                                       ; +0xc2, 0x140391a92\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0xc5, 0x140391a95\nmov     rdi, rax                                                       ; +0xcb, 0x140391a9b\ncall    GJAccountManager__sharedState                                  ; +0xce, 0x140391a9e\nmov     ecx, [rax+168h]                                                ; +0xd3, 0x140391aa3\nsub     ecx, [rax+16Ch]                                                ; +0xd9, 0x140391aa9\ncmp     [rdi+194h], ecx                                                ; +0xdf, 0x140391aaf\njnz     short loc_140391AC4                                            ; +0xe5, 0x140391ab5\ncmp     dword ptr [rdi+180h], 0FFFFFFFFh                               ; +0xe7, 0x140391ab7\njz      loc_140391B7E                                                  ; +0xee, 0x140391abe\ninc     ebx                                                            ; +0xf4, 0x140391ac4\nmov     rcx, rsi                                                       ; +0xf6, 0x140391ac6\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xf9, 0x140391ac9\ncmp     ebx, eax                                                       ; +0xff, 0x140391acf\njb      short loc_140391A90                                            ; +0x101, 0x140391ad1\nmov     byte ptr [rbp+1C9h], 1                                         ; +0x103, 0x140391ad3\nmovsxd  rdx, dword ptr [rbp+194h]                                      ; +0x10a, 0x140391ada\nmov     rcx, [r14+148h]                                                ; +0x111, 0x140391ae1\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x118, 0x140391ae8\ntest    rax, rax                                                       ; +0x11e, 0x140391aee\njz      short loc_140391B45                                            ; +0x121, 0x140391af1\nlea     rdx, [rax+140h]                                                ; +0x123, 0x140391af3\nlea     rcx, [rsp+0A8h+Src]                                            ; +0x12a, 0x140391afa\ncall    sub_14003F4F0                                                  ; +0x12f, 0x140391aff\nlea     rax, [rsp+0A8h+Src]                                            ; +0x134, 0x140391b04\nmov     [rsp+0A8h+var_88], rax                                         ; +0x139, 0x140391b09\nlea     rcx, [rbp+160h]; void *                                        ; +0x13e, 0x140391b0e\nlea     rax, [rsp+0A8h+Src]                                            ; +0x145, 0x140391b15\ncmp     rcx, rax                                                       ; +0x14a, 0x140391b1a\njz      short loc_140391B3B                                            ; +0x14d, 0x140391b1d\nlea     rdx, [rsp+0A8h+Src]                                            ; +0x14f, 0x140391b1f\ncmp     [rsp+0A8h+var_68], 0Fh                                         ; +0x154, 0x140391b24\ncmova   rdx, [rsp+0A8h+Src]; Src                                       ; +0x15a, 0x140391b2a\nmov     r8, [rsp+0A8h+Size]; Size                                      ; +0x160, 0x140391b30\ncall    sub_1400405A0                                                  ; +0x165, 0x140391b35\nnop                                                                    ; +0x16a, 0x140391b3a\nlea     rcx, [rsp+0A8h+Src]                                            ; +0x16b, 0x140391b3b\ncall    sub_14003D310                                                  ; +0x170, 0x140391b40\nmov     rdx, rbp                                                       ; +0x175, 0x140391b45\nmov     rcx, rsi                                                       ; +0x178, 0x140391b48\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x17b, 0x140391b4b\nnop                                                                    ; +0x181, 0x140391b51\nmov     rcx, r15                                                       ; +0x182, 0x140391b52\ncall    sub_14003D310                                                  ; +0x185, 0x140391b55\nmov     rcx, [rsp+0A8h+var_38]                                         ; +0x18a, 0x140391b5a\nxor     rcx, rsp; StackCookie                                          ; +0x18f, 0x140391b5f\ncall    __security_check_cookie                                        ; +0x192, 0x140391b62\nmov     rbx, [rsp+0A8h+arg_18]                                         ; +0x197, 0x140391b67\nadd     rsp, 80h                                                       ; +0x19f, 0x140391b6f\npop     r15                                                            ; +0x1a6, 0x140391b76\npop     r14                                                            ; +0x1a8, 0x140391b78\npop     rdi                                                            ; +0x1aa, 0x140391b7a\npop     rsi                                                            ; +0x1ab, 0x140391b7b\npop     rbp                                                            ; +0x1ac, 0x140391b7c\nretn                                                                   ; +0x1ad, 0x140391b7d\nmov     eax, [rbp+180h]                                                ; +0x1ae, 0x140391b7e\nmov     [rdi+180h], eax                                                ; +0x1b4, 0x140391b84\njmp     short loc_140391B52                                            ; +0x1ba, 0x140391b8a\ndb 0CCh                                                                ; +0x1bc, 0x140391b8c", "xrefs": ["GJMultiplayerManager::onJoinLobbyCompleted @ 0x14039116e", "GJMultiplayerManager::createAndAddComment @ 0x140391924", "<???> @ 0x140922ff4"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}