{"type": "func", "start": 4298446624, "end": 4298447296, "name": "InfoLayer::onComment", "pseudocode": "// \n// InfoLayer::onComment from 0x100351720 to 0x1003519c0 (672 bytes)\n// \n// 2 xrefs:\n// > InfoLayer::FLAlert_Clicked @ 0x100352a98\n// > InfoLayer::init @ 0x100350634\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\nvoid __fastcall InfoLayer::onComment(InfoLayer *a1, cocos2d::CCObject *a2)\n{\n  GJAccountManager *v3; // x0\n  GameManager *v4; // x0\n  GameLevelManager *v5; // x20\n  GameLevelManager *v6; // x0\n  GJUserScore *m_score; // x8\n  int m_userID; // w1\n  FLAlertLayer *v9; // x20\n  void *v10; // x0\n  GameManager *v11; // x0\n  GJLevelList *m_levelList; // x8\n  GJGameLevel *m_level; // x8\n  const char *PostCommentKey; // x0\n  int TimeLeft; // w0\n  cocos2d::CCString *v16; // x0\n  char *CString; // x0\n  GJUserScore *v18; // x8\n  __int64 v19; // x20\n  GJLevelList *v20; // x8\n  GJGameLevel *v21; // x8\n  GJGameLevel *v22; // x8\n  void *__p[2]; // [xsp+8h] [xbp-88h] BYREF\n  char v24; // [xsp+1Fh] [xbp-71h]\n  void *v25[2]; // [xsp+20h] [xbp-70h] BYREF\n  char v26; // [xsp+37h] [xbp-59h]\n  _QWORD v27[2]; // [xsp+38h] [xbp-58h] BYREF\n  char v28; // [xsp+4Fh] [xbp-41h]\n  void *v29[2]; // [xsp+50h] [xbp-40h] BYREF\n  char v30; // [xsp+67h] [xbp-29h]\n  _QWORD v31[2]; // [xsp+68h] [xbp-28h] BYREF\n  char v32; // [xsp+7Fh] [xbp-11h]\n\n  v3 = GJAccountManager::sharedState();\n  if ( v3->m_accountID <= v3->m_unkInt1 )\n  {\n    sub_100009900(\n      v31,\n      \"You need an <cl>account</c> to post <cg>comments</c>. You can create one for free from settings in the main menu.\");\n    v9 = FLAlertLayer::create_1(0, (__int64)\"Account Needed\", (__int64)v31, (__int64)\"Close\", 0, 380.0);\n    if ( v32 < 0 )\n    {\n      v10 = (void *)v31[0];\nLABEL_7:\n      operator delete(v10);\n    }\n  }\n  else\n  {\n    v4 = GameManager::sharedState();\n    if ( GameManager::getGameVariable(v4, \"0012\") )\n    {\n      v5 = GameLevelManager::sharedState();\n      v6 = GameLevelManager::sharedState();\n      m_score = a1->m_score;\n      if ( m_score )\n      {\n        m_userID = m_score->m_userID;\n      }\n      else\n      {\n        m_levelList = a1->m_levelList;\n        if ( m_levelList )\n        {\n          m_userID = -m_levelList->m_listID;\n        }\n        else\n        {\n          m_level = a1->m_level;\n          if ( m_level )\n            m_userID = m_level->m_levelID.random - m_level->m_levelID.seed;\n          else\n            m_userID = 0;\n        }\n      }\n      PostCommentKey = GameLevelManager::getPostCommentKey(v6, m_userID);\n      TimeLeft = GameLevelManager::getTimeLeft(v5, PostCommentKey, 15.0);\n      if ( (unsigned int)(TimeLeft - 1) <= 0xE )\n      {\n        v16 = (cocos2d::CCString *)sub_100268F4C(\"Please wait %i seconds before posting a new comment!\", TimeLeft);\n        CString = (char *)cocos2d::CCString::getCString(v16);\n        sub_100009900(v27, CString);\n        v9 = FLAlertLayer::create_1(0, (__int64)\"Too fast\", (__int64)v27, (__int64)\"OK\", 0, 300.0);\n        if ( (v28 & 0x80000000) == 0 )\n          goto LABEL_32;\n        v10 = (void *)v27[0];\n        goto LABEL_7;\n      }\n      sub_100009900(v25, \"Add Comment\");\n      v18 = a1->m_score;\n      if ( v18 )\n      {\n        v19 = (unsigned int)v18->m_userID;\n      }\n      else\n      {\n        v20 = a1->m_levelList;\n        if ( v20 )\n        {\n          v19 = (unsigned int)-v20->m_listID;\n        }\n        else\n        {\n          v21 = a1->m_level;\n          if ( v21 )\n            v19 = (unsigned int)(v21->m_levelID.random - v21->m_levelID.seed);\n          else\n            v19 = 0;\n        }\n      }\n      sub_100009900(__p, \"\");\n      v9 = (FLAlertLayer *)ShareCommentLayer::create((__int64)v25, 100, 0, v19, (__int64)__p);\n      if ( v24 < 0 )\n        operator delete(__p[0]);\n      if ( v26 < 0 )\n        operator delete(v25[0]);\n      v22 = a1->m_level;\n      if ( v22 )\n        LODWORD(v9[1].m_sAdditionalTransform.c) = v22->m_orbCompletion.random - v22->m_orbCompletion.seed;\n    }\n    else\n    {\n      v11 = GameManager::sharedState();\n      GameManager::setGameVariable(v11, \"0012\", 1);\n      sub_100009900(\n        v29,\n        \"1. Do <cr>not</c> spam.\\n\"\n        \"2. Do <cr>not</c> harass other players.\\n\"\n        \"3. Do <cr>not</c> post inappropriate or controversial content.\\n\"\n        \"4. Do <cr>not</c> try to bypass these rules.\\n\"\n        \"<cy>These rules and their enforcement are entirely at Elder Moderators' discretion.</c>\");\n      v9 = FLAlertLayer::create_1(\n             (__int64)&a1->FLAlertLayerProtocol,\n             (__int64)\"Comment Rules\",\n             (__int64)v29,\n             (__int64)\"Next\",\n             0,\n             380.0);\n      if ( v30 < 0 )\n        operator delete(v29[0]);\n      ((void (__fastcall *)(FLAlertLayer *, __int64))v9->setTag)(v9, 3);\n    }\n  }\nLABEL_32:\n  ((void (__fastcall *)(FLAlertLayer *))v9->show)(v9);\n}", "assembly": "; \n; InfoLayer::onComment from 0x100351720 to 0x1003519c0 (672 bytes)\n; \n; 2 xrefs:\n; > InfoLayer::FLAlert_Clicked @ 0x100352a98\n; > InfoLayer::init @ 0x100350634\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\nSUB             SP, SP, #0xA0                                          ; +0x0, 0x100351720\nSTP             X20, X19, [SP,#0x90+var_10]                            ; +0x4, 0x100351724\nSTP             X29, X30, [SP,#0x90+var_s0]                            ; +0x8, 0x100351728\nADD             X29, SP, #0x90                                         ; +0xc, 0x10035172c\nMOV             X19, X0                                                ; +0x10, 0x100351730\nBL              GJAccountManager__sharedState                          ; +0x14, 0x100351734\nLDR             W8, [X0,#0x160]                                        ; +0x18, 0x100351738\nLDR             W9, [X0,#0x164]                                        ; +0x1c, 0x10035173c\nCMP             W8, W9                                                 ; +0x20, 0x100351740\nB.LE            loc_100351778                                          ; +0x24, 0x100351744\nBL              GameManager__sharedState                               ; +0x28, 0x100351748\nADRL            X1, a0012; \"0012\"                                      ; +0x2c, 0x10035174c\nBL              GameManager__getGameVariable                           ; +0x34, 0x100351754\nTBZ             W0, #0, loc_1003517C8                                  ; +0x38, 0x100351758\nBL              GameLevelManager__sharedState                          ; +0x3c, 0x10035175c\nMOV             X20, X0                                                ; +0x40, 0x100351760\nBL              GameLevelManager__sharedState                          ; +0x44, 0x100351764\nLDR             X8, [X19,#0x298]                                       ; +0x48, 0x100351768\nCBZ             X8, loc_100351840                                      ; +0x4c, 0x10035176c\nLDR             W1, [X8,#0x174]                                        ; +0x50, 0x100351770\nB               loc_100351870                                          ; +0x54, 0x100351774\nADRL            X1, aYouNeedAnClAcc_1; \"You need an <cl>account</c> to post <cg\"... ; +0x58, 0x100351778\nSUB             X0, X29, #-var_28; int                                 ; +0x60, 0x100351780\nBL              sub_100009900                                          ; +0x64, 0x100351784\nADRL            X1, aAccountNeeded; \"Account Needed\"                   ; +0x68, 0x100351788\nADRL            X3, aClose; \"Close\"                                    ; +0x70, 0x100351790\nMOV             W8, #0x43BE0000                                        ; +0x78, 0x100351798\nFMOV            S0, W8                                                 ; +0x7c, 0x10035179c\nSUB             X2, X29, #-var_28                                      ; +0x80, 0x1003517a0\nMOV             X0, #0                                                 ; +0x84, 0x1003517a4\nMOV             X4, #0                                                 ; +0x88, 0x1003517a8\nBL              FLAlertLayer__create_1                                 ; +0x8c, 0x1003517ac\nMOV             X20, X0                                                ; +0x90, 0x1003517b0\nLDURSB          W8, [X29,#var_11]                                      ; +0x94, 0x1003517b4\nTBZ             W8, #0x1F, loc_1003519A0                               ; +0x98, 0x1003517b8\nLDUR            X0, [X29,#var_28]; __p                                 ; +0x9c, 0x1003517bc\nBL              __ZdlPv; operator delete(void *)                       ; +0xa0, 0x1003517c0\nB               loc_1003519A0                                          ; +0xa4, 0x1003517c4\nBL              GameManager__sharedState                               ; +0xa8, 0x1003517c8\nADRL            X1, a0012; \"0012\"                                      ; +0xac, 0x1003517cc\nMOV             W2, #1                                                 ; +0xb4, 0x1003517d4\nBL              GameManager__setGameVariable                           ; +0xb8, 0x1003517d8\nADRL            X1, a1DoCrNotCSpam2; \"1. Do <cr>not</c> spam.\\n2. Do <cr>not<\"... ; +0xbc, 0x1003517dc\nSUB             X0, X29, #-var_40; int                                 ; +0xc4, 0x1003517e4\nBL              sub_100009900                                          ; +0xc8, 0x1003517e8\nADRL            X1, aCommentRules; \"Comment Rules\"                     ; +0xcc, 0x1003517ec\nADRL            X3, aNext; \"Next\"                                      ; +0xd4, 0x1003517f4\nMOV             W8, #0x43BE0000                                        ; +0xdc, 0x1003517fc\nFMOV            S0, W8                                                 ; +0xe0, 0x100351800\nADD             X0, X19, #0x288                                        ; +0xe4, 0x100351804\nSUB             X2, X29, #-var_40                                      ; +0xe8, 0x100351808\nMOV             X4, #0                                                 ; +0xec, 0x10035180c\nBL              FLAlertLayer__create_1                                 ; +0xf0, 0x100351810\nMOV             X20, X0                                                ; +0xf4, 0x100351814\nLDURSB          W8, [X29,#var_29]                                      ; +0xf8, 0x100351818\nTBZ             W8, #0x1F, loc_100351828                               ; +0xfc, 0x10035181c\nLDUR            X0, [X29,#var_40]; __p                                 ; +0x100, 0x100351820\nBL              __ZdlPv; operator delete(void *)                       ; +0x104, 0x100351824\nLDR             X8, [X20]                                              ; +0x108, 0x100351828\nLDR             X8, [X8,#0x48]                                         ; +0x10c, 0x10035182c\nMOV             X0, X20                                                ; +0x110, 0x100351830\nMOV             W1, #3                                                 ; +0x114, 0x100351834\nBLR             X8                                                     ; +0x118, 0x100351838\nB               loc_1003519A0                                          ; +0x11c, 0x10035183c\nLDR             X8, [X19,#0x2A0]                                       ; +0x120, 0x100351840\nCBZ             X8, loc_100351854                                      ; +0x124, 0x100351844\nLDR             W8, [X8,#0x158]                                        ; +0x128, 0x100351848\nNEG             W1, W8                                                 ; +0x12c, 0x10035184c\nB               loc_100351870                                          ; +0x130, 0x100351850\nLDR             X8, [X19,#0x290]                                       ; +0x134, 0x100351854\nCBZ             X8, loc_10035186C                                      ; +0x138, 0x100351858\nLDR             W9, [X8,#0x148]                                        ; +0x13c, 0x10035185c\nLDR             W8, [X8,#0x14C]                                        ; +0x140, 0x100351860\nSUB             W1, W9, W8                                             ; +0x144, 0x100351864\nB               loc_100351870                                          ; +0x148, 0x100351868\nMOV             W1, #0                                                 ; +0x14c, 0x10035186c\nBL              GameLevelManager__getPostCommentKey                    ; +0x150, 0x100351870\nMOV             X1, X0                                                 ; +0x154, 0x100351874\nFMOV            S0, #15.0                                              ; +0x158, 0x100351878\nMOV             X0, X20                                                ; +0x15c, 0x10035187c\nBL              GameLevelManager__getTimeLeft                          ; +0x160, 0x100351880\nSUB             W8, W0, #1                                             ; +0x164, 0x100351884\nCMP             W8, #0xE                                               ; +0x168, 0x100351888\nB.HI            loc_1003518EC                                          ; +0x16c, 0x10035188c\nSTR             X0, [SP,#0x90+var_90]                                  ; +0x170, 0x100351890\nADRL            X0, aPleaseWaitISec_2; \"Please wait %i seconds before posting a\"... ; +0x174, 0x100351894\nBL              sub_100268F4C                                          ; +0x17c, 0x10035189c\nBL              cocos2d__CCString__getCString                          ; +0x180, 0x1003518a0\nMOV             X1, X0; __s                                            ; +0x184, 0x1003518a4\nADD             X0, SP, #0x90+var_58; int                              ; +0x188, 0x1003518a8\nBL              sub_100009900                                          ; +0x18c, 0x1003518ac\nADRL            X1, aTooFast_0; \"Too fast\"                             ; +0x190, 0x1003518b0\nADRL            X3, aOk; \"OK\"                                          ; +0x198, 0x1003518b8\nMOV             W8, #0x43960000                                        ; +0x1a0, 0x1003518c0\nFMOV            S0, W8                                                 ; +0x1a4, 0x1003518c4\nADD             X2, SP, #0x90+var_58                                   ; +0x1a8, 0x1003518c8\nMOV             X0, #0                                                 ; +0x1ac, 0x1003518cc\nMOV             X4, #0                                                 ; +0x1b0, 0x1003518d0\nBL              FLAlertLayer__create_1                                 ; +0x1b4, 0x1003518d4\nMOV             X20, X0                                                ; +0x1b8, 0x1003518d8\nLDRSB           W8, [SP,#0x90+var_41]                                  ; +0x1bc, 0x1003518dc\nTBZ             W8, #0x1F, loc_1003519A0                               ; +0x1c0, 0x1003518e0\nLDR             X0, [SP,#0x90+var_58]                                  ; +0x1c4, 0x1003518e4\nB               loc_1003517C0                                          ; +0x1c8, 0x1003518e8\nADRL            X1, aAddComment; \"Add Comment\"                         ; +0x1cc, 0x1003518ec\nADD             X0, SP, #0x90+var_70; int                              ; +0x1d4, 0x1003518f4\nBL              sub_100009900                                          ; +0x1d8, 0x1003518f8\nLDR             X8, [X19,#0x298]                                       ; +0x1dc, 0x1003518fc\nCBZ             X8, loc_10035190C                                      ; +0x1e0, 0x100351900\nLDR             W20, [X8,#0x174]                                       ; +0x1e4, 0x100351904\nB               loc_10035193C                                          ; +0x1e8, 0x100351908\nLDR             X8, [X19,#0x2A0]                                       ; +0x1ec, 0x10035190c\nCBZ             X8, loc_100351920                                      ; +0x1f0, 0x100351910\nLDR             W8, [X8,#0x158]                                        ; +0x1f4, 0x100351914\nNEG             W20, W8                                                ; +0x1f8, 0x100351918\nB               loc_10035193C                                          ; +0x1fc, 0x10035191c\nLDR             X8, [X19,#0x290]                                       ; +0x200, 0x100351920\nCBZ             X8, loc_100351938                                      ; +0x204, 0x100351924\nLDR             W9, [X8,#0x148]                                        ; +0x208, 0x100351928\nLDR             W8, [X8,#0x14C]                                        ; +0x20c, 0x10035192c\nSUB             W20, W9, W8                                            ; +0x210, 0x100351930\nB               loc_10035193C                                          ; +0x214, 0x100351934\nMOV             W20, #0                                                ; +0x218, 0x100351938\nADRL            X1, asc_100746688; \"\"                                  ; +0x21c, 0x10035193c\nADD             X0, SP, #0x90+__p; int                                 ; +0x224, 0x100351944\nBL              sub_100009900                                          ; +0x228, 0x100351948\nADD             X0, SP, #0x90+var_70                                   ; +0x22c, 0x10035194c\nADD             X4, SP, #0x90+__p                                      ; +0x230, 0x100351950\nMOV             W1, #0x64 ; 'd'                                        ; +0x234, 0x100351954\nMOV             W2, #0                                                 ; +0x238, 0x100351958\nMOV             X3, X20                                                ; +0x23c, 0x10035195c\nBL              ShareCommentLayer__create                              ; +0x240, 0x100351960\nMOV             X20, X0                                                ; +0x244, 0x100351964\nLDRSB           W8, [SP,#0x90+var_71]                                  ; +0x248, 0x100351968\nTBZ             W8, #0x1F, loc_100351978                               ; +0x24c, 0x10035196c\nLDR             X0, [SP,#0x90+__p]; __p                                ; +0x250, 0x100351970\nBL              __ZdlPv; operator delete(void *)                       ; +0x254, 0x100351974\nLDRSB           W8, [SP,#0x90+var_59]                                  ; +0x258, 0x100351978\nTBZ             W8, #0x1F, loc_100351988                               ; +0x25c, 0x10035197c\nLDR             X0, [SP,#0x90+var_70]; __p                             ; +0x260, 0x100351980\nBL              __ZdlPv; operator delete(void *)                       ; +0x264, 0x100351984\nLDR             X8, [X19,#0x290]                                       ; +0x268, 0x100351988\nCBZ             X8, loc_1003519A0                                      ; +0x26c, 0x10035198c\nLDR             W9, [X8,#0x2EC]                                        ; +0x270, 0x100351990\nLDR             W8, [X8,#0x2F0]                                        ; +0x274, 0x100351994\nSUB             W8, W9, W8                                             ; +0x278, 0x100351998\nSTR             W8, [X20,#0x2F4]                                       ; +0x27c, 0x10035199c\nLDR             X8, [X20]                                              ; +0x280, 0x1003519a0\nLDR             X8, [X8,#0x508]                                        ; +0x284, 0x1003519a4\nMOV             X0, X20                                                ; +0x288, 0x1003519a8\nBLR             X8                                                     ; +0x28c, 0x1003519ac\nLDP             X29, X30, [SP,#0x90+var_s0]                            ; +0x290, 0x1003519b0\nLDP             X20, X19, [SP,#0x90+var_10]                            ; +0x294, 0x1003519b4\nADD             SP, SP, #0xA0                                          ; +0x298, 0x1003519b8\nRET                                                                    ; +0x29c, 0x1003519bc", "xrefs": ["InfoLayer::FLAlert_Clicked @ 0x100352a98", "InfoLayer::init @ 0x100350634"], "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"}