//
// FriendRequestPopup::onBlock from 0x140296d50 to 0x140296fab (603 bytes)
//
// 2 xrefs:
// > FriendRequestPopup::loadFromGJFriendRequest @ 0x140296959
// > ??> @ 0x1406d1c10
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=5
void FriendRequestPopup::onBlock(FriendRequestPopup *a1, cocos2d::CCObject *a2)
{
__int64 v3; // rcx
const char *v4; // rdx
cocos2d::CCString *v5; // rax
const char *CString; // rax
size_t v7; // rbx
size_t v8; // r8
void **v9; // rdx
FLAlertLayer *v10; // rbx
__int64 v11; // rax
void *v12; // rcx
void *v13; // [rsp+50h] [rbp-49h]
FLAlertLayer *v14; // [rsp+58h] [rbp-41h]
__int128 v15; // [rsp+60h] [rbp-39h] BYREF
__int64 v16; // [rsp+70h] [rbp-29h]
__int64 v17; // [rsp+78h] [rbp-21h]
_BYTE v18[32]; // [rsp+80h] [rbp-19h] BYREF
void *Block[2]; // [rsp+A0h] [rbp+7h] BYREF
__int64 v20; // [rsp+B0h] [rbp+17h]
unsigned __int64 v21; // [rsp+B8h] [rbp+1Fh]
_QWORD v22[4]; // [rsp+C0h] [rbp+27h] BYREF
v3 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v13 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v3 = qword_1406C2EC0;
}
GameLevelManager::tryGetUsername(v3, (__int64)v22, a1->m_request->m_accountID);
v4 = (const char *)v22;
if ( v22[3] > 0xFu )
v4 = (const char *)v22[0];
v5 = cocos2d::CCString::createWithFormat(
"Are you sure you want to block %s?\n"
"They will no longer be able to:\n"
"-View your profile.\n"
"-Send you a friend request.\n"
"-Send you messages, and all older messages from them will be deleted.",
v4);
CString = cocos2d::CCString::getCString(v5);
*(_OWORD *)Block = 0;
v20 = 0;
v21 = 0;
v7 = -1;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003A930(Block, CString, v8);
v9 = Block;
if ( v21 > 0xF )
v9 = (void **)Block[0];
v15 = 0;
v16 = 0;
v17 = 0;
do
++v7;
while ( *((_BYTE *)v9 + v7) );
sub_14003A930(&v15, v9, v7);
v14 = (FLAlertLayer *)operator new(0x278u);
v10 = FLAlertLayer::FLAlertLayer(v14);
if ( v10 )
{
v11 = sub_14003BDB0((__int64)v18, (__int64)&v15);
if ( FLAlertLayer::init(
(__int64)v10,
(__int64)&a1->FLAlertLayerProtocol,
"Confirm Block",
v11,
"Back",
"Block",
380.0,
0,
0,
1.0) )
{
cocos2d::CCObject::autorelease(v10);
}
else
{
((void (__fastcall *)(FLAlertLayer *, __int64))v10->~FLAlertLayer)(v10, 1);
v10 = nullptr;
}
}
sub_14003A830((__int64)&v15);
ButtonSprite::updateBGImage(v10->m_button2, "GJ_button_06.png");
v10->setTag(v10, 1);
v10->show(v10);
if ( v21 > 0xF )
{
v12 = Block[0];
if ( v21 + 1 >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v12);
}
sub_14003A830((__int64)v22);
}