{"type": "func", "start": 9973472, "end": 9973940, "name": "GJMultiplayerManager::createAndAddComment", "pseudocode": "// \n// GJMultiplayerManager::createAndAddComment from 0x982ee0 to 0x9830b4 (468 bytes)\n// \n// 2 xrefs:\n// > GJMultiplayerManager::uploadComment @ 0x983d00\n// > <???> @ 0xa1d18\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__int64 __fastcall GJMultiplayerManager::createAndAddComment(__int64 a1, char **a2, int a3)\n{\n  GJAccountManager *v5; // x0\n  cocos2d::CCString *v6; // x0\n  char *CString; // x0\n  void *v8; // x0\n  __int64 v9; // x0\n  void *v10; // x0\n  unsigned int *v12; // x1\n  int v13; // w2\n  unsigned int *v14; // x1\n  int v15; // w2\n  char *v16; // [xsp+48h] [xbp+48h]\n  __int64 v17; // [xsp+58h] [xbp+58h] BYREF\n  __int64 v18; // [xsp+60h] [xbp+60h] BYREF\n\n  v16 = *a2;\n  v5 = GJAccountManager::sharedState();\n  v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(\n                              (cocos2d::CCString *)\"2~%s~8~%i~9~7 minutes~6~-1\",\n                              v16,\n                              (unsigned int)(v5->m_accountID - v5->m_unkInt1));\n  CString = (char *)cocos2d::CCString::getCString(v6);\n  sub_D153B8((int)&v17, CString);\n  sub_D18D28(&v18);\n  GJMultiplayerManager::addComment(a1, (__int64)&v18, a3);\n  v8 = (void *)(v18 - 24);\n  if ( (__int64 *)(v18 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v12 = (unsigned int *)(v18 - 8);\n      do\n        v13 = __ldaxr(v12);\n      while ( __stlxr(v13 - 1, v12) );\n    }\n    else\n    {\n      v13 = *(_DWORD *)(v18 - 8);\n      *(_DWORD *)(v18 - 8) = v13 - 1;\n    }\n    if ( v13 <= 0 )\n      operator delete(v8);\n  }\n  v9 = *(_QWORD *)(a1 + 352);\n  if ( v9 )\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 24LL))(v9);\n  v10 = (void *)(v17 - 24);\n  if ( (__int64 *)(v17 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v14 = (unsigned int *)(v17 - 8);\n      do\n        v15 = __ldaxr(v14);\n      while ( __stlxr(v15 - 1, v14) );\n    }\n    else\n    {\n      v15 = *(_DWORD *)(v17 - 8);\n      *(_DWORD *)(v17 - 8) = v15 - 1;\n    }\n    if ( v15 <= 0 )\n      operator delete(v10);\n  }\n  return _stack_chk_guard;\n}", "assembly": "; \n; GJMultiplayerManager::createAndAddComment from 0x982ee0 to 0x9830b4 (468 bytes)\n; \n; 2 xrefs:\n; > GJMultiplayerManager::uploadComment @ 0x983d00\n; > <???> @ 0xa1d18\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\nSTP             X29, X30, [SP,#var_70]!                                ; +0x0, 0x982ee0\nMOV             X29, SP                                                ; +0x4, 0x982ee4\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x8, 0x982ee8\nADRP            X21, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x982eec\nLDR             X1, [X1]                                               ; +0x10, 0x982ef0\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x14, 0x982ef4\nMOV             X23, X0                                                ; +0x18, 0x982ef8\nMOV             W24, W2                                                ; +0x1c, 0x982efc\nLDR             X0, [X21,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x982f00\nADD             X22, X29, #0x70+var_10                                 ; +0x24, 0x982f04\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x28, 0x982f08\nSTR             X1, [X29,#0x70+var_28]                                 ; +0x2c, 0x982f0c\nADD             X20, X29, #0x70+var_18                                 ; +0x30, 0x982f10\nLDR             X0, [X0]; this                                         ; +0x34, 0x982f14\nADRP            X19, #off_122EFE8@PAGE                                 ; +0x38, 0x982f18\nSTR             X0, [X29,#0x70+var_8]                                  ; +0x3c, 0x982f1c\nBL              _ZN16GJAccountManager11sharedStateEv; GJAccountManager::sharedState(void) ; +0x40, 0x982f20\nMOV             X3, X0                                                 ; +0x44, 0x982f24\nLDR             X1, [X29,#0x70+var_28]; char *                         ; +0x48, 0x982f28\nADRL            X0, a2S8I97Minutes6; \"2~%s~8~%i~9~7 minutes~6~-1\"      ; +0x4c, 0x982f2c\nLDR             W4, [X3,#0x150]                                        ; +0x54, 0x982f34\nLDR             W2, [X3,#0x154]                                        ; +0x58, 0x982f38\nSUB             W2, W4, W2                                             ; +0x5c, 0x982f3c\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x60, 0x982f40\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x64, 0x982f44\nMOV             X1, X0; char *                                         ; +0x68, 0x982f48\nMOV             X2, X22                                                ; +0x6c, 0x982f4c\nMOV             X0, X20; int                                           ; +0x70, 0x982f50\nBL              sub_D153B8                                             ; +0x74, 0x982f54\nMOV             X0, X22                                                ; +0x78, 0x982f58\nMOV             X1, X20                                                ; +0x7c, 0x982f5c\nBL              sub_D18D28                                             ; +0x80, 0x982f60\nMOV             X0, X23                                                ; +0x84, 0x982f64\nMOV             X1, X22                                                ; +0x88, 0x982f68\nMOV             W2, W24                                                ; +0x8c, 0x982f6c\nBL              _ZN20GJMultiplayerManager10addCommentESsi; GJMultiplayerManager::addComment(std::string,int) ; +0x90, 0x982f70\nLDR             X1, [X29,#0x70+var_10]                                 ; +0x94, 0x982f74\nLDR             X2, [X19,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0x98, 0x982f78\nSUB             X0, X1, #0x18; p                                       ; +0x9c, 0x982f7c\nCMP             X0, X2                                                 ; +0xa0, 0x982f80\nB.NE            loc_982FD8                                             ; +0xa4, 0x982f84\nLDR             X0, [X23,#0x160]                                       ; +0xa8, 0x982f88\nCBZ             X0, loc_982F9C                                         ; +0xac, 0x982f8c\nLDR             X1, [X0]                                               ; +0xb0, 0x982f90\nLDR             X1, [X1,#0x18]                                         ; +0xb4, 0x982f94\nBLR             X1                                                     ; +0xb8, 0x982f98\nLDR             X1, [X29,#0x70+var_18]                                 ; +0xbc, 0x982f9c\nLDR             X19, [X19,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0xc0, 0x982fa0\nSUB             X0, X1, #0x18; p                                       ; +0xc4, 0x982fa4\nCMP             X0, X19                                                ; +0xc8, 0x982fa8\nB.NE            loc_98300C                                             ; +0xcc, 0x982fac\nLDR             X0, [X21,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xd0, 0x982fb0\nLDR             X1, [X29,#0x70+var_8]                                  ; +0xd4, 0x982fb4\nLDR             X0, [X0]                                               ; +0xd8, 0x982fb8\nCMP             X1, X0                                                 ; +0xdc, 0x982fbc\nB.NE            loc_983060                                             ; +0xe0, 0x982fc0\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xe4, 0x982fc4\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0xe8, 0x982fc8\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0xec, 0x982fcc\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xf0, 0x982fd0\nRET                                                                    ; +0xf4, 0x982fd4\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0xf8, 0x982fd8\nLDR             X2, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xfc, 0x982fdc\nCBZ             X2, loc_983050                                         ; +0x100, 0x982fe0\nSUB             X1, X1, #8                                             ; +0x104, 0x982fe4\nLDAXR           W2, [X1]                                               ; +0x108, 0x982fe8\nSUB             W3, W2, #1                                             ; +0x10c, 0x982fec\nSTLXR           W4, W3, [X1]                                           ; +0x110, 0x982ff0\nCBNZ            W4, loc_982FE8                                         ; +0x114, 0x982ff4\nCMP             W2, WZR                                                ; +0x118, 0x982ff8\nB.GT            loc_982F88                                             ; +0x11c, 0x982ffc\nADD             X1, X29, #0x70+var_20                                  ; +0x120, 0x983000\nBL              j__ZdlPv; operator delete(void *)                      ; +0x124, 0x983004\nB               loc_982F88                                             ; +0x128, 0x983008\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0x12c, 0x98300c\nLDR             X2, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x130, 0x983010\nCBZ             X2, loc_983040                                         ; +0x134, 0x983014\nSUB             X1, X1, #8                                             ; +0x138, 0x983018\nLDAXR           W2, [X1]                                               ; +0x13c, 0x98301c\nSUB             W3, W2, #1                                             ; +0x140, 0x983020\nSTLXR           W4, W3, [X1]                                           ; +0x144, 0x983024\nCBNZ            W4, loc_98301C                                         ; +0x148, 0x983028\nCMP             W2, WZR                                                ; +0x14c, 0x98302c\nB.GT            loc_982FB0                                             ; +0x150, 0x983030\nMOV             X1, X22                                                ; +0x154, 0x983034\nBL              j__ZdlPv; operator delete(void *)                      ; +0x158, 0x983038\nB               loc_982FB0                                             ; +0x15c, 0x98303c\nLDUR            W2, [X1,#-8]                                           ; +0x160, 0x983040\nSUB             W3, W2, #1                                             ; +0x164, 0x983044\nSTUR            W3, [X1,#-8]                                           ; +0x168, 0x983048\nB               loc_98302C                                             ; +0x16c, 0x98304c\nLDUR            W2, [X1,#-8]                                           ; +0x170, 0x983050\nSUB             W3, W2, #1                                             ; +0x174, 0x983054\nSTUR            W3, [X1,#-8]                                           ; +0x178, 0x983058\nB               loc_982FF8                                             ; +0x17c, 0x98305c\nBL              .__stack_chk_fail                                      ; +0x180, 0x983060\nADRP            X19, #off_122EFE8@PAGE                                 ; +0x184, 0x983064\nMOV             X20, X0                                                ; +0x188, 0x983068\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x18c, 0x98306c\nLDR             X1, [X19,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0x190, 0x983070\nSUB             X0, X0, #0x18                                          ; +0x194, 0x983074\nCMP             X0, X1                                                 ; +0x198, 0x983078\nB.EQ            loc_983088                                             ; +0x19c, 0x98307c\nADD             X1, X29, #0x70+var_20                                  ; +0x1a0, 0x983080\nBL              sub_4DD360                                             ; +0x1a4, 0x983084\nLDR             X0, [X29,#0x70+var_18]                                 ; +0x1a8, 0x983088\nLDR             X19, [X19,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0x1ac, 0x98308c\nSUB             X0, X0, #0x18                                          ; +0x1b0, 0x983090\nCMP             X0, X19                                                ; +0x1b4, 0x983094\nB.EQ            loc_9830A4                                             ; +0x1b8, 0x983098\nADD             X1, X29, #0x70+var_20                                  ; +0x1bc, 0x98309c\nBL              sub_4DD360                                             ; +0x1c0, 0x9830a0\nMOV             X0, X20                                                ; +0x1c4, 0x9830a4\nBL              _Unwind_Resume                                         ; +0x1c8, 0x9830a8\nMOV             X20, X0                                                ; +0x1cc, 0x9830ac\nB               loc_983088                                             ; +0x1d0, 0x9830b0", "xrefs": ["GJMultiplayerManager::uploadComment @ 0x983d00", "<???> @ 0xa1d18"], "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"}