{"type": "func", "start": 5308360, "end": 5308626, "name": "GJMultiplayerManager::addComment", "pseudocode": "// \n// GJMultiplayerManager::addComment from 0x50ffc8 to 0x5100d2 (266 bytes)\n// \n// 2 xrefs:\n// > GJMultiplayerManager::onJoinLobbyCompleted @ 0x51031c\n// > GJMultiplayerManager::createAndAddComment @ 0x510608\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\nGJAccountManager *__fastcall GJMultiplayerManager::addComment(int a1, char *a2, char *a3)\n{\n  cocos2d::CCArray *v5; // r8\n  GJComment *v6; // r5\n  int m_accountID; // r6\n  GJAccountManager *v8; // r0\n  intptr_t v9; // r1\n  unsigned int i; // r6\n  int v11; // r0\n  int v12; // r11\n  int v13; // r9\n  GJAccountManager *result; // r0\n  char *v15[3]; // [sp+0h] [bp-Ch] BYREF\n\n  v15[0] = (char *)a1;\n  v15[1] = a2;\n  v15[2] = a3;\n  v5 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 276), (intptr_t)a3);\n  if ( !v5 )\n  {\n    v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr);\n    cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 276), v5, (intptr_t)a3);\n  }\n  sub_775C20(v15);\n  GameLevelManager::responseToDict(v15, 1);\n  v6 = GJComment::create();\n  sub_774008(v15);\n  m_accountID = v6->m_accountID;\n  v8 = GJAccountManager::sharedState();\n  if ( m_accountID == v8->m_accountID - v8->m_unkInt1 && v6->m_commentID != -1 )\n  {\n    for ( i = 0; i < cocos2d::CCArray::count(v5); ++i )\n    {\n      v11 = cocos2d::CCArray::objectAtIndex(v5, i);\n      v12 = *(_DWORD *)(v11 + 292);\n      v13 = v11;\n      result = GJAccountManager::sharedState();\n      if ( v12 == result->m_accountID - result->m_unkInt1 && *(_DWORD *)(v13 + 272) == -1 )\n      {\n        *(_DWORD *)(v13 + 272) = v6->m_commentID;\n        return result;\n      }\n    }\n  }\n  v9 = v6->m_accountID;\n  v6->m_unkMultiplayerBool = 1;\n  if ( cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 268), v9) )\n  {\n    sub_775C20(v15);\n    sub_775D40(&v6->m_userName, v15);\n    sub_774008(v15);\n  }\n  return (GJAccountManager *)cocos2d::CCArray::addObject(v5, v6);\n}", "assembly": "; \n; GJMultiplayerManager::addComment from 0x50ffc8 to 0x5100d2 (266 bytes)\n; \n; 2 xrefs:\n; > GJMultiplayerManager::onJoinLobbyCompleted @ 0x51031c\n; > GJMultiplayerManager::createAndAddComment @ 0x510608\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.W          {R0-R2,R4-R11,LR}                                      ; +0x0, 0x50ffc8\nMOV             R10, R0                                                ; +0x4, 0x50ffcc\nLDR             R7, =(__stack_chk_guard_ptr - 0x50FFDC)                ; +0x6, 0x50ffce\nMOV             R5, R1                                                 ; +0x8, 0x50ffd0\nLDR.W           R0, [R0,#0x114]; this                                  ; +0xa, 0x50ffd2\nMOV             R1, R2; int                                            ; +0xe, 0x50ffd6\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0x10, 0x50ffd8\nLDR             R7, [R7]; __stack_chk_guard                            ; +0x12, 0x50ffda\nMOV             R4, R2                                                 ; +0x14, 0x50ffdc\nLDR             R3, [R7]                                               ; +0x16, 0x50ffde\nSTR             R3, [SP,#0xC+var_8]                                    ; +0x18, 0x50ffe0\nBL              _ZN7cocos2d12CCDictionary12objectForKeyEi; cocos2d::CCDictionary::objectForKey(int) ; +0x1a, 0x50ffe2\nMOV             R8, R0                                                 ; +0x1e, 0x50ffe6\nCBNZ            R0, loc_50FFFC                                         ; +0x20, 0x50ffe8\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x22, 0x50ffea\nMOV             R2, R4; int                                            ; +0x26, 0x50ffee\nMOV             R8, R0                                                 ; +0x28, 0x50fff0\nLDR.W           R0, [R10,#0x114]; this                                 ; +0x2a, 0x50fff2\nMOV             R1, R8; cocos2d::CCObject *                            ; +0x2e, 0x50fff6\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectEi; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,int) ; +0x30, 0x50fff8\nMOV             R1, R5                                                 ; +0x34, 0x50fffc\nMOV             R0, SP                                                 ; +0x36, 0x50fffe\nBL              sub_775C20                                             ; +0x38, 0x510000\nMOV             R0, SP                                                 ; +0x3c, 0x510004\nMOVS            R1, #1                                                 ; +0x3e, 0x510006\nMOV             R4, SP                                                 ; +0x40, 0x510008\nBL              _ZN16GameLevelManager14responseToDictESsb; GameLevelManager::responseToDict(std::string,bool) ; +0x42, 0x51000a\nBL              _ZN9GJComment6createEPN7cocos2d12CCDictionaryE; GJComment::create(cocos2d::CCDictionary *) ; +0x46, 0x51000e\nMOV             R5, R0                                                 ; +0x4a, 0x510012\nMOV             R0, SP                                                 ; +0x4c, 0x510014\nBL              sub_774008                                             ; +0x4e, 0x510016\nLDR.W           R6, [R5,#0x124]                                        ; +0x52, 0x51001a\nBL              _ZN16GJAccountManager11sharedStateEv; GJAccountManager::sharedState(void) ; +0x56, 0x51001e\nLDR.W           R3, [R0,#0x110]                                        ; +0x5a, 0x510022\nLDR.W           R2, [R0,#0x114]                                        ; +0x5e, 0x510026\nSUBS            R3, R3, R2                                             ; +0x62, 0x51002a\nCMP             R6, R3                                                 ; +0x64, 0x51002c\nBEQ             loc_510048                                             ; +0x66, 0x51002e\nMOVS            R3, #1                                                 ; +0x68, 0x510030\nLDR.W           R1, [R5,#0x124]; int                                   ; +0x6a, 0x510032\nSTRB.W          R3, [R5,#0x13C]                                        ; +0x6e, 0x510036\nLDR.W           R0, [R10,#0x10C]; this                                 ; +0x72, 0x51003a\nBL              _ZN7cocos2d12CCDictionary12objectForKeyEi; cocos2d::CCDictionary::objectForKey(int) ; +0x76, 0x51003e\nMOV             R1, R0                                                 ; +0x7a, 0x510042\nCBNZ            R0, loc_510088                                         ; +0x7c, 0x510044\nB               loc_5100A2                                             ; +0x7e, 0x510046\nLDR.W           R3, [R5,#0x110]                                        ; +0x80, 0x510048\nADDS            R3, #1                                                 ; +0x84, 0x51004c\nBEQ             loc_510030                                             ; +0x86, 0x51004e\nMOVS            R6, #0                                                 ; +0x88, 0x510050\nMOV             R0, R8; this                                           ; +0x8a, 0x510052\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x8c, 0x510054\nCMP             R6, R0                                                 ; +0x90, 0x510058\nBCS             loc_510030                                             ; +0x92, 0x51005a\nMOV             R1, R6; unsigned int                                   ; +0x94, 0x51005c\nMOV             R0, R8; this                                           ; +0x96, 0x51005e\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x98, 0x510060\nLDR.W           R11, [R0,#0x124]                                       ; +0x9c, 0x510064\nMOV             R9, R0                                                 ; +0xa0, 0x510068\nBL              _ZN16GJAccountManager11sharedStateEv; GJAccountManager::sharedState(void) ; +0xa2, 0x51006a\nLDR.W           R3, [R0,#0x110]                                        ; +0xa6, 0x51006e\nLDR.W           R2, [R0,#0x114]                                        ; +0xaa, 0x510072\nSUBS            R3, R3, R2                                             ; +0xae, 0x510076\nCMP             R11, R3                                                ; +0xb0, 0x510078\nBNE             loc_510084                                             ; +0xb2, 0x51007a\nLDR.W           R3, [R9,#0x110]                                        ; +0xb4, 0x51007c\nADDS            R3, #1                                                 ; +0xb8, 0x510080\nBEQ             loc_5100B8                                             ; +0xba, 0x510082\nADDS            R6, #1                                                 ; +0xbc, 0x510084\nB               loc_510052                                             ; +0xbe, 0x510086\nADD.W           R1, R1, #0x108                                         ; +0xc0, 0x510088\nMOV             R0, R4                                                 ; +0xc4, 0x51008c\nBL              sub_775C20                                             ; +0xc6, 0x51008e\nADD.W           R0, R5, #0x10C                                         ; +0xca, 0x510092\nMOV             R1, R4                                                 ; +0xce, 0x510096\nBL              sub_775D40                                             ; +0xd0, 0x510098\nMOV             R0, R4                                                 ; +0xd4, 0x51009c\nBL              sub_774008                                             ; +0xd6, 0x51009e\nMOV             R0, R8; this                                           ; +0xda, 0x5100a2\nMOV             R1, R5; cocos2d::CCObject *                            ; +0xdc, 0x5100a4\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xde, 0x5100a6\nB               loc_5100C0                                             ; +0xe2, 0x5100aa\nB               loc_5100AE                                             ; +0xe4, 0x5100ac\nMOV             R0, R4                                                 ; +0xe6, 0x5100ae\nBL              sub_774008                                             ; +0xe8, 0x5100b0\nBL              __cxa_end_cleanup                                      ; +0xec, 0x5100b4\nLDR.W           R3, [R5,#0x110]                                        ; +0xf0, 0x5100b8\nSTR.W           R3, [R9,#0x110]                                        ; +0xf4, 0x5100bc\nLDR             R2, [SP,#0xC+var_8]                                    ; +0xf8, 0x5100c0\nLDR             R3, [R7]                                               ; +0xfa, 0x5100c2\nCMP             R2, R3                                                 ; +0xfc, 0x5100c4\nBEQ             loc_5100CC                                             ; +0xfe, 0x5100c6\nBLX             __stack_chk_fail                                       ; +0x100, 0x5100c8\nADD             SP, SP, #0xC                                           ; +0x104, 0x5100cc\nPOP.W           {R4-R11,PC}                                            ; +0x106, 0x5100ce", "xrefs": ["GJMultiplayerManager::onJoinLobbyCompleted @ 0x51031c", "GJMultiplayerManager::createAndAddComment @ 0x510608"], "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"}