//
// ProfilePage::onFriend from 0x1008a2290 to 0x1008a25e7 (855 bytes)
//
// 1 xrefs:
// > ProfilePage::setupAccountButtons @ 0x1008a1ea5
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:37:15 +0000
//
void __fastcall ProfilePage::onFriend(__int64 a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // rax
unsigned int v4; // ecx
__int64 *v5; // r14
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rdi
unsigned __int8 v9; // si
__int128 *v10; // rax
__int64 v11; // rax
__int64 v12; // rax
char *v13; // rax
__int64 *v14; // rbx
__int64 v15; // rax
__int64 *v16; // rdi
__int128 v17; // [rsp+8h] [rbp-88h] BYREF
void *v18; // [rsp+18h] [rbp-78h]
_QWORD v19[2]; // [rsp+20h] [rbp-70h] BYREF
void *v20; // [rsp+30h] [rbp-60h]
__int128 v21; // [rsp+38h] [rbp-58h] BYREF
void *v22; // [rsp+48h] [rbp-48h]
__int128 v23; // [rsp+50h] [rbp-40h] BYREF
void *__p; // [rsp+60h] [rbp-30h]
__int128 v25; // [rsp+68h] [rbp-28h] BYREF
void *v26; // [rsp+78h] [rbp-18h]
v2 = GJAccountManager::sharedState(a1, a2);
if ( *(_DWORD *)(v2 + 352) > *(_DWORD *)(v2 + 356) )
{
*(_QWORD *)(GameLevelManager::sharedState() + 1352) = a1 + 688;
v3 = *(_QWORD *)(a1 + 728);
switch ( *(_DWORD *)(v3 + 688) )
{
case 0:
LOBYTE(v25) = 28;
strcpy((char *)&v25 + 1, "Friend Request");
v4 = *(_DWORD *)(a1 + 736);
LOWORD(v17) = 0;
v5 = (__int64 *)ShareCommentLayer::create(&v25, 0x8Cu, 2u, v4, &v17);
if ( (v17 & 1) != 0 )
{
operator delete(v18);
if ( (v25 & 1) == 0 )
{
LABEL_5:
if ( *(_DWORD *)(*(_QWORD *)(a1 + 728) + 440LL) == 2 )
goto LABEL_22;
goto LABEL_20;
}
}
else if ( (v25 & 1) == 0 )
{
goto LABEL_5;
}
operator delete(v26);
if ( *(_DWORD *)(*(_QWORD *)(a1 + 728) + 440LL) == 2 )
{
LABEL_22:
v15 = *v5;
v16 = v5;
goto LABEL_27;
}
LABEL_20:
v20 = operator new(0x40u);
v19[0] = 65;
v19[1] = 62;
strcpy((char *)v20, "This user does not accept messages in friend requests.");
sub_1006B3110((__int64)v5, (__int64)v19);
if ( (v19[0] & 1) != 0 )
operator delete(v20);
goto LABEL_22;
case 1:
if ( (*(_BYTE *)(v3 + 320) & 1) != 0 )
{
sub_10001AD30(&v23, *(const void **)(v3 + 336), *(_QWORD *)(v3 + 328));
}
else
{
v10 = (__int128 *)(v3 + 320);
__p = *((void **)v10 + 2);
v23 = *v10;
}
v14 = (__int64 *)sub_1008A5090(a1 + 664, &v23);
if ( (v23 & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64 *, __int64))(*v14 + 72))(v14, 2);
goto LABEL_26;
case 3:
v6 = GameLevelManager::sharedState();
v7 = GameLevelManager::friendRequestFromAccountID(v6, *(_DWORD *)(*(_QWORD *)(a1 + 728) + 376LL));
*(_BYTE *)(*(_QWORD *)(a1 + 728) + 724LL) = 0;
v8 = v7;
v9 = 0;
goto LABEL_13;
case 4:
v11 = GameLevelManager::sharedState();
v12 = GameLevelManager::friendRequestFromAccountID(v11, *(_DWORD *)(*(_QWORD *)(a1 + 728) + 376LL));
if ( v12 )
{
v8 = v12;
v9 = 1;
LABEL_13:
v13 = FriendRequestPopup::create(v8, v9);
(*(void (__fastcall **)(char *))(*(_QWORD *)v13 + 1312LL))(v13);
}
else
{
v22 = operator new(0x38u);
*(_QWORD *)&v21 = 57;
*((_QWORD *)&v21 + 1) = 52;
strcpy((char *)v22, "Are you sure you want to remove this friend request?");
v14 = (__int64 *)FLAlertLayer::create(
(int)a1 + 664,
(int)"Cancel friend request",
&v21,
(int)"Back",
(int)"Remove",
0,
380.0,
0.0,
1.0);
if ( (v21 & 1) != 0 )
operator delete(v22);
(*(void (__fastcall **)(__int64 *, __int64))(*v14 + 72))(v14, 1);
ButtonSprite::updateBGImage(v14[77], (__int64)"GJ_button_06.png");
LABEL_26:
v15 = *v14;
v16 = v14;
LABEL_27:
(*(void (__fastcall **)(__int64 *))(v15 + 1312))(v16);
}
return;
default:
return;
}
}
GJAccountManager::sharedState(a1, a2);
sub_1000A24A0();
}