{"type": "func", "start": 8682692, "end": 8683080, "name": "GJAccountManager::linkToAccount", "pseudocode": "// \n// GJAccountManager::linkToAccount from 0x847cc4 to 0x847e48 (388 bytes)\n// \n// 2 xrefs:\n// > AccountLoginLayer::loginAccountFinished @ 0x852270\n// > <???> @ 0x5ea58\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 GJAccountManager::linkToAccount(__int64 a1, __int64 a2, __int64 a3, int a4, int a5)\n{\n  GameManager *v8; // x24\n  void *v9; // x0\n  GameManager *v10; // x0\n  GameManager *v11; // x22\n  int v12; // w0\n  void (__fastcall ***v13)(_QWORD); // x1\n  int v14; // w0\n  GameManager *v15; // x0\n  unsigned int *v17; // x2\n  int v18; // w1\n  __int64 v20; // [xsp+60h] [xbp+60h] BYREF\n\n  sub_D18EA8(a1 + 352, a3);\n  sub_D18EA8(a1 + 328, a2);\n  *(_DWORD *)(a1 + 336) = a4;\n  v8 = GameManager::sharedState();\n  sub_D18D28(&v20);\n  sub_D18EA8(&v8->m_playerName, &v20);\n  v9 = (void *)(v20 - 24);\n  if ( (__int64 *)(v20 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v17 = (unsigned int *)(v20 - 8);\n      do\n        v18 = __ldaxr(v17);\n      while ( __stlxr(v18 - 1, v17) );\n    }\n    else\n    {\n      v18 = *(_DWORD *)(v20 - 8);\n      *(_DWORD *)(v20 - 8) = v18 - 1;\n    }\n    if ( v18 <= 0 )\n      operator delete(v9);\n  }\n  v10 = GameManager::sharedState();\n  v10->m_playerUserID.value = a5;\n  v11 = v10;\n  v12 = rand();\n  v13 = *(void (__fastcall ****)(_QWORD))(a1 + 376);\n  v14 = (int)(float)((float)((float)v12 * 4.6566e-10) * 1000.0);\n  v11->m_playerUserID.seed = v14;\n  v11->m_playerUserID.random = a5 + v14;\n  if ( v13 )\n    (**v13)(v13);\n  v15 = GameManager::sharedState();\n  GameManager::accountStatusChanged(v15);\n  return _stack_chk_guard;\n}", "assembly": "; \n; GJAccountManager::linkToAccount from 0x847cc4 to 0x847e48 (388 bytes)\n; \n; 2 xrefs:\n; > AccountLoginLayer::loginAccountFinished @ 0x852270\n; > <???> @ 0x5ea58\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, 0x847cc4\nMOV             X29, SP                                                ; +0x4, 0x847cc8\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x847ccc\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x847cd0\nMOV             W20, W4                                                ; +0x10, 0x847cd4\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x14, 0x847cd8\nMOV             X24, X1                                                ; +0x18, 0x847cdc\nMOV             X1, X2                                                 ; +0x1c, 0x847ce0\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x847ce4\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x24, 0x847ce8\nMOV             X21, X0                                                ; +0x28, 0x847cec\nADD             X0, X0, #0x160                                         ; +0x2c, 0x847cf0\nLDR             X2, [X2]                                               ; +0x30, 0x847cf4\nADD             X23, X21, #0x148                                       ; +0x34, 0x847cf8\nSTR             X2, [X29,#0x70+var_8]                                  ; +0x38, 0x847cfc\nADD             X22, X29, #0x70+var_10                                 ; +0x3c, 0x847d00\nSTR             X3, [X29,#0x70+var_28]                                 ; +0x40, 0x847d04\nBL              sub_D18EA8                                             ; +0x44, 0x847d08\nMOV             X1, X24                                                ; +0x48, 0x847d0c\nMOV             X0, X23                                                ; +0x4c, 0x847d10\nBL              sub_D18EA8                                             ; +0x50, 0x847d14\nLDR             X3, [X29,#0x70+var_28]                                 ; +0x54, 0x847d18\nSTR             W3, [X21,#0x150]                                       ; +0x58, 0x847d1c\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x5c, 0x847d20\nMOV             X24, X0                                                ; +0x60, 0x847d24\nMOV             X1, X23                                                ; +0x64, 0x847d28\nMOV             X0, X22                                                ; +0x68, 0x847d2c\nBL              sub_D18D28                                             ; +0x6c, 0x847d30\nADD             X0, X24, #0x220                                        ; +0x70, 0x847d34\nMOV             X1, X22                                                ; +0x74, 0x847d38\nBL              sub_D18EA8                                             ; +0x78, 0x847d3c\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x7c, 0x847d40\nLDR             X2, [X29,#0x70+var_10]                                 ; +0x80, 0x847d44\nSUB             X0, X2, #0x18; this                                    ; +0x84, 0x847d48\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x88, 0x847d4c\nCMP             X0, X1                                                 ; +0x8c, 0x847d50\nB.NE            loc_847DD4                                             ; +0x90, 0x847d54\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x94, 0x847d58\nSTR             W20, [X0,#0x234]                                       ; +0x98, 0x847d5c\nMOV             X22, X0                                                ; +0x9c, 0x847d60\nBL              .rand                                                  ; +0xa0, 0x847d64\nSCVTF           S0, W0                                                 ; +0xa4, 0x847d68\nLDR             X1, [X21,#0x178]                                       ; +0xa8, 0x847d6c\nLDR             S1, =0x30000000                                        ; +0xac, 0x847d70\nFMUL            S0, S0, S1                                             ; +0xb0, 0x847d74\nLDR             S1, =0x447A0000                                        ; +0xb4, 0x847d78\nFMUL            S0, S0, S1                                             ; +0xb8, 0x847d7c\nFCVTZS          W0, S0                                                 ; +0xbc, 0x847d80\nADD             W20, W20, W0                                           ; +0xc0, 0x847d84\nSTR             W0, [X22,#0x230]                                       ; +0xc4, 0x847d88\nSTR             W20, [X22,#0x22C]                                      ; +0xc8, 0x847d8c\nCBZ             X1, loc_847DA4                                         ; +0xcc, 0x847d90\nLDR             X2, [X1]                                               ; +0xd0, 0x847d94\nMOV             X0, X1                                                 ; +0xd4, 0x847d98\nLDR             X1, [X2]                                               ; +0xd8, 0x847d9c\nBLR             X1                                                     ; +0xdc, 0x847da0\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xe0, 0x847da4\nBL              _ZN11GameManager20accountStatusChangedEv; GameManager::accountStatusChanged(void) ; +0xe4, 0x847da8\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xe8, 0x847dac\nLDR             X1, [X29,#0x70+var_8]                                  ; +0xec, 0x847db0\nLDR             X0, [X19]                                              ; +0xf0, 0x847db4\nCMP             X1, X0                                                 ; +0xf4, 0x847db8\nB.NE            loc_847E18                                             ; +0xf8, 0x847dbc\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xfc, 0x847dc0\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x100, 0x847dc4\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0x104, 0x847dc8\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x108, 0x847dcc\nRET                                                                    ; +0x10c, 0x847dd0\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x110, 0x847dd4\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x114, 0x847dd8\nCBZ             X1, loc_847E08                                         ; +0x118, 0x847ddc\nSUB             X2, X2, #8                                             ; +0x11c, 0x847de0\nLDAXR           W1, [X2]                                               ; +0x120, 0x847de4\nSUB             W3, W1, #1                                             ; +0x124, 0x847de8\nSTLXR           W4, W3, [X2]                                           ; +0x128, 0x847dec\nCBNZ            W4, loc_847DE4                                         ; +0x12c, 0x847df0\nCMP             W1, WZR                                                ; +0x130, 0x847df4\nB.GT            loc_847D58                                             ; +0x134, 0x847df8\nADD             X1, X29, #0x70+var_18                                  ; +0x138, 0x847dfc\nBL              j__ZdlPv; operator delete(void *)                      ; +0x13c, 0x847e00\nB               loc_847D58                                             ; +0x140, 0x847e04\nLDUR            W1, [X2,#-8]                                           ; +0x144, 0x847e08\nSUB             W3, W1, #1                                             ; +0x148, 0x847e0c\nSTUR            W3, [X2,#-8]                                           ; +0x14c, 0x847e10\nB               loc_847DF4                                             ; +0x150, 0x847e14\nBL              .__stack_chk_fail                                      ; +0x154, 0x847e18\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x158, 0x847e1c\nMOV             X19, X0                                                ; +0x15c, 0x847e20\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x160, 0x847e24\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x164, 0x847e28\nSUB             X0, X0, #0x18                                          ; +0x168, 0x847e2c\nCMP             X0, X1                                                 ; +0x16c, 0x847e30\nB.EQ            loc_847E40                                             ; +0x170, 0x847e34\nADD             X1, X29, #0x70+var_18                                  ; +0x174, 0x847e38\nBL              sub_844A20                                             ; +0x178, 0x847e3c\nMOV             X0, X19                                                ; +0x17c, 0x847e40\nBL              _Unwind_Resume                                         ; +0x180, 0x847e44", "xrefs": ["AccountLoginLayer::loginAccountFinished @ 0x852270", "<???> @ 0x5ea58"], "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"}