{"type": "func", "start": 4605356, "end": 4605682, "name": "GJAccountManager::onLoginAccountCompleted", "pseudocode": "// \n// GJAccountManager::onLoginAccountCompleted from 0x4645ac to 0x4646f2 (326 bytes)\n// \n// 1 xrefs:\n// > GJAccountManager::handleIt @ 0x465bd8\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\nGJAccountLoginDelegate *__fastcall GJAccountManager::onLoginAccountCompleted(\n        GJAccountManager *a1,\n        cocos2d::CCArray *a2,\n        int a3,\n        int a4)\n{\n  cocos2d::CCString *v6; // r0\n  char *CString; // r0\n  int v8; // r10\n  int v9; // r2\n  GJAccountLoginDelegate *result; // r0\n  cocos2d::CCString *v11; // r0\n  char *v12; // r0\n  int v13; // r9\n  int v14; // r2\n  int v15; // r8\n  int v16; // r2\n  cocos2d::CCArray *v17; // r6\n  cocos2d::CCString *v18; // r0\n  int v19; // r4\n  cocos2d::CCString *v20; // r0\n  int m_accountID; // r3\n  int v24; // [sp+8h] [bp-8h] BYREF\n  int v25; // [sp+Ch] [bp-4h]\n\n  v24 = a3;\n  v25 = a4;\n  GJAccountManager::removeDLFromActive(a1, \"login_account\");\n  v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"%i\", (const char *)0xFFFFFFF4);\n  CString = (char *)cocos2d::CCString::getCString(v6);\n  sub_776584((int)&v24, CString);\n  v8 = sub_774DBC(a2, &v24);\n  sub_774008(&v24);\n  if ( !v8 )\n  {\n    result = a1->m_accountLoginDelegate;\n    if ( result )\n      return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(\n                                         result,\n                                         -12,\n                                         v9,\n                                         result->loginAccountFailed);\n    return result;\n  }\n  v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"%i\", (const char *)0xFFFFFFF3);\n  v12 = (char *)cocos2d::CCString::getCString(v11);\n  sub_776584((int)&v24, v12);\n  v13 = sub_774DBC(a2, &v24);\n  sub_774008(&v24);\n  if ( !v13 )\n  {\n    result = a1->m_accountLoginDelegate;\n    if ( result )\n      return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(\n                                         result,\n                                         -13,\n                                         v14,\n                                         result->loginAccountFailed);\n    return result;\n  }\n  sub_776584((int)&v24, \"-1\");\n  v15 = sub_774DBC(a2, &v24);\n  sub_774008(&v24);\n  if ( !v15 || (v17 = sub_464224(a2, \",\"), cocos2d::CCArray::count(v17) <= 1u) )\n  {\n    result = a1->m_accountLoginDelegate;\n    goto LABEL_12;\n  }\n  v18 = cocos2d::CCArray::stringAtIndex(v17, 0);\n  v19 = cocos2d::CCString::intValue(v18);\n  v20 = cocos2d::CCArray::stringAtIndex(v17, 1u);\n  v16 = cocos2d::CCString::intValue(v20);\n  result = a1->m_accountLoginDelegate;\n  if ( v19 <= 0 )\n  {\nLABEL_12:\n    if ( result )\n      return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(\n                                         result,\n                                         -1,\n                                         v16,\n                                         result->loginAccountFailed);\n    return result;\n  }\n  m_accountID = a1->m_accountID;\n  if ( !m_accountID || m_accountID == v19 )\n  {\n    if ( result )\n      return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, int, int), GJAccountManager *, cocos2d::CCArray *, int, int))result->loginAccountFinished)(\n                                         result,\n                                         v19,\n                                         v16,\n                                         result->loginAccountFinished,\n                                         a1,\n                                         a2,\n                                         v24,\n                                         v25);\n  }\n  else if ( result )\n  {\n    return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(\n                                       result,\n                                       -10,\n                                       v16,\n                                       result->loginAccountFailed);\n  }\n  return result;\n}", "assembly": "; \n; GJAccountManager::onLoginAccountCompleted from 0x4645ac to 0x4646f2 (326 bytes)\n; \n; 1 xrefs:\n; > GJAccountManager::handleIt @ 0x465bd8\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-R10,LR}                                            ; +0x0, 0x4645ac\nMOV             R6, R1                                                 ; +0x4, 0x4645b0\nLDR             R7, =(__stack_chk_guard_ptr - 0x4645C0)                ; +0x6, 0x4645b2\nMOV             R5, R0                                                 ; +0x8, 0x4645b4\nLDR.W           R9, =(aI - 0x4645C6); \"%i\"                             ; +0xa, 0x4645b6\nADD             R4, SP, #0x10+var_8                                    ; +0xe, 0x4645ba\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0x10, 0x4645bc\nLDR             R7, [R7]; __stack_chk_guard                            ; +0x12, 0x4645be\nLDR             R1, =(aLoginAccount - 0x4645CE); \"login_account\"       ; +0x14, 0x4645c0\nADD             R9, PC; \"%i\"                                           ; +0x16, 0x4645c2\nADD.W           R8, SP, #0x10+var_C                                    ; +0x18, 0x4645c4\nLDR             R3, [R7]                                               ; +0x1c, 0x4645c8\nADD             R1, PC; \"login_account\"                                ; +0x1e, 0x4645ca\nSTR             R3, [SP,#0x10+var_4]                                   ; +0x20, 0x4645cc\nBL              _ZN16GJAccountManager18removeDLFromActiveEPKc; GJAccountManager::removeDLFromActive(char const*) ; +0x22, 0x4645ce\nMOV             R1, #0xFFFFFFF4; char *                                ; +0x26, 0x4645d2\nMOV             R0, R9; this                                           ; +0x2a, 0x4645d6\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x2c, 0x4645d8\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x30, 0x4645dc\nMOV             R2, R8                                                 ; +0x34, 0x4645e0\nMOV             R1, R0; char *                                         ; +0x36, 0x4645e2\nMOV             R0, R4; int                                            ; +0x38, 0x4645e4\nBL              sub_776584                                             ; +0x3a, 0x4645e6\nMOV             R0, R6                                                 ; +0x3e, 0x4645ea\nMOV             R1, R4                                                 ; +0x40, 0x4645ec\nBL              sub_774DBC                                             ; +0x42, 0x4645ee\nMOV             R10, R0                                                ; +0x46, 0x4645f2\nMOV             R0, R4                                                 ; +0x48, 0x4645f4\nBL              sub_774008                                             ; +0x4a, 0x4645f6\nCMP.W           R10, #0                                                ; +0x4e, 0x4645fa\nBNE             loc_464612                                             ; +0x52, 0x4645fe\nLDR.W           R0, [R5,#0x124]                                        ; +0x54, 0x464600\nCMP             R0, #0                                                 ; +0x58, 0x464604\nBEQ             loc_4646E0                                             ; +0x5a, 0x464606\nLDR             R3, [R0]                                               ; +0x5c, 0x464608\nMOV             R1, #0xFFFFFFF4                                        ; +0x5e, 0x46460a\nLDR             R3, [R3,#4]                                            ; +0x62, 0x46460e\nB               loc_464650                                             ; +0x64, 0x464610\nMOV             R1, #0xFFFFFFF3; char *                                ; +0x66, 0x464612\nMOV             R0, R9; this                                           ; +0x6a, 0x464616\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x6c, 0x464618\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x70, 0x46461c\nMOV             R2, R8                                                 ; +0x74, 0x464620\nMOV             R1, R0; char *                                         ; +0x76, 0x464622\nMOV             R0, R4; int                                            ; +0x78, 0x464624\nBL              sub_776584                                             ; +0x7a, 0x464626\nMOV             R0, R6                                                 ; +0x7e, 0x46462a\nMOV             R1, R4                                                 ; +0x80, 0x46462c\nBL              sub_774DBC                                             ; +0x82, 0x46462e\nMOV             R9, R0                                                 ; +0x86, 0x464632\nMOV             R0, R4                                                 ; +0x88, 0x464634\nBL              sub_774008                                             ; +0x8a, 0x464636\nCMP.W           R9, #0                                                 ; +0x8e, 0x46463a\nBNE             loc_464654                                             ; +0x92, 0x46463e\nLDR.W           R0, [R5,#0x124]                                        ; +0x94, 0x464640\nCMP             R0, #0                                                 ; +0x98, 0x464644\nBEQ             loc_4646E0                                             ; +0x9a, 0x464646\nLDR             R3, [R0]                                               ; +0x9c, 0x464648\nMOV             R1, #0xFFFFFFF3                                        ; +0x9e, 0x46464a\nLDR             R3, [R3,#4]                                            ; +0xa2, 0x46464e\nBLX             R3                                                     ; +0xa4, 0x464650\nB               loc_4646E0                                             ; +0xa6, 0x464652\nLDR             R1, =(a1 - 0x46465E); \"-1\"                             ; +0xa8, 0x464654\nMOV             R2, R8                                                 ; +0xaa, 0x464656\nMOV             R0, R4; int                                            ; +0xac, 0x464658\nADD             R1, PC; \"-1\"                                           ; +0xae, 0x46465a\nBL              sub_776584                                             ; +0xb0, 0x46465c\nMOV             R0, R6                                                 ; +0xb4, 0x464660\nMOV             R1, R4                                                 ; +0xb6, 0x464662\nBL              sub_774DBC                                             ; +0xb8, 0x464664\nMOV             R8, R0                                                 ; +0xbc, 0x464668\nMOV             R0, R4                                                 ; +0xbe, 0x46466a\nBL              sub_774008                                             ; +0xc0, 0x46466c\nCMP.W           R8, #0                                                 ; +0xc4, 0x464670\nBEQ             loc_46468A                                             ; +0xc8, 0x464674\nLDR             R1, =(asc_948B9B - 0x46467E); \",\"                      ; +0xca, 0x464676\nMOV             R0, R6                                                 ; +0xcc, 0x464678\nADD             R1, PC; \",\"                                            ; +0xce, 0x46467a\nBL              sub_464224                                             ; +0xd0, 0x46467c\nMOV             R6, R0                                                 ; +0xd4, 0x464680\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xd6, 0x464682\nCMP             R0, #1                                                 ; +0xda, 0x464686\nBHI             loc_464690                                             ; +0xdc, 0x464688\nLDR.W           R0, [R5,#0x124]                                        ; +0xde, 0x46468a\nB               loc_4646B4                                             ; +0xe2, 0x46468e\nMOVS            R1, #0; unsigned int                                   ; +0xe4, 0x464690\nMOV             R0, R6; this                                           ; +0xe6, 0x464692\nBL              _ZN7cocos2d7CCArray13stringAtIndexEj; cocos2d::CCArray::stringAtIndex(uint) ; +0xe8, 0x464694\nBL              _ZNK7cocos2d8CCString8intValueEv; cocos2d::CCString::intValue(void) ; +0xec, 0x464698\nMOVS            R1, #1; unsigned int                                   ; +0xf0, 0x46469c\nMOV             R4, R0                                                 ; +0xf2, 0x46469e\nMOV             R0, R6; this                                           ; +0xf4, 0x4646a0\nBL              _ZN7cocos2d7CCArray13stringAtIndexEj; cocos2d::CCArray::stringAtIndex(uint) ; +0xf6, 0x4646a2\nBL              _ZNK7cocos2d8CCString8intValueEv; cocos2d::CCString::intValue(void) ; +0xfa, 0x4646a6\nCMP             R4, #0                                                 ; +0xfe, 0x4646aa\nMOV             R2, R0                                                 ; +0x100, 0x4646ac\nLDR.W           R0, [R5,#0x124]                                        ; +0x102, 0x4646ae\nBGT             loc_4646C0                                             ; +0x106, 0x4646b2\nCBZ             R0, loc_4646E0                                         ; +0x108, 0x4646b4\nLDR             R3, [R0]                                               ; +0x10a, 0x4646b6\nMOV.W           R1, #0xFFFFFFFF                                        ; +0x10c, 0x4646b8\nLDR             R3, [R3,#4]                                            ; +0x110, 0x4646bc\nB               loc_464650                                             ; +0x112, 0x4646be\nLDR.W           R3, [R5,#0x110]                                        ; +0x114, 0x4646c0\nCBZ             R3, loc_4646D6                                         ; +0x118, 0x4646c4\nCMP             R3, R4                                                 ; +0x11a, 0x4646c6\nBEQ             loc_4646D6                                             ; +0x11c, 0x4646c8\nCBZ             R0, loc_4646E0                                         ; +0x11e, 0x4646ca\nLDR             R3, [R0]                                               ; +0x120, 0x4646cc\nMOV             R1, #0xFFFFFFF6                                        ; +0x122, 0x4646ce\nLDR             R3, [R3,#4]                                            ; +0x126, 0x4646d2\nB               loc_464650                                             ; +0x128, 0x4646d4\nCBZ             R0, loc_4646E0                                         ; +0x12a, 0x4646d6\nLDR             R3, [R0]                                               ; +0x12c, 0x4646d8\nMOV             R1, R4                                                 ; +0x12e, 0x4646da\nLDR             R3, [R3]                                               ; +0x130, 0x4646dc\nBLX             R3                                                     ; +0x132, 0x4646de\nLDR             R2, [SP,#0x10+var_4]                                   ; +0x134, 0x4646e0\nLDR             R3, [R7]                                               ; +0x136, 0x4646e2\nCMP             R2, R3                                                 ; +0x138, 0x4646e4\nBEQ             loc_4646EC                                             ; +0x13a, 0x4646e6\nBLX             __stack_chk_fail                                       ; +0x13c, 0x4646e8\nADD             SP, SP, #0x10                                          ; +0x140, 0x4646ec\nPOP.W           {R4-R10,PC}                                            ; +0x142, 0x4646ee", "xrefs": ["GJAccountManager::handleIt @ 0x465bd8"], "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"}