//
// GJMessagePopup::onBlock from 0x1402988e0 to 0x140298b0c (556 bytes)
//
// 2 xrefs:
// > GJMessagePopup::loadFromGJMessage @ 0x140298262
// > ??> @ 0x1406d1c88
//
// 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=4
void GJMessagePopup::onBlock(GJMessagePopup *a1, cocos2d::CCObject *a2)
{
const char *v3; // r8
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
FLAlertLayer *v13; // [rsp+58h] [rbp-41h]
__int128 v14; // [rsp+60h] [rbp-39h] BYREF
__int64 v15; // [rsp+70h] [rbp-29h]
__int64 v16; // [rsp+78h] [rbp-21h]
_BYTE v17[32]; // [rsp+80h] [rbp-19h] BYREF
void *Block[2]; // [rsp+A0h] [rbp+7h] BYREF
__int64 v19; // [rsp+B0h] [rbp+17h]
unsigned __int64 v20; // [rsp+B8h] [rbp+1Fh]
_QWORD v21[4]; // [rsp+C0h] [rbp+27h] BYREF
sub_14003BDB0((__int64)v21, (__int64)&a1->m_message->m_username);
v3 = (const char *)v21;
if ( v21[3] <= 0xFu )
{
v4 = (const char *)v21;
}
else
{
v4 = (const char *)v21[0];
v3 = (const char *)v21[0];
}
v5 = cocos2d::CCString::createWithFormat(
"Are you sure you want to block %s?\n"
"%s will no longer be able to:\n"
"- View your profile\n"
"- Send messages\n"
"- Send friend requests\n"
"- Messages from this user will be removed",
v4,
v3);
CString = cocos2d::CCString::getCString(v5);
*(_OWORD *)Block = 0;
v19 = 0;
v20 = 0;
v7 = -1;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003A930(Block, CString, v8);
v9 = Block;
if ( v20 > 0xF )
v9 = (void **)Block[0];
v14 = 0;
v15 = 0;
v16 = 0;
do
++v7;
while ( *((_BYTE *)v9 + v7) );
sub_14003A930(&v14, v9, v7);
v13 = (FLAlertLayer *)operator new(0x278u);
v10 = FLAlertLayer::FLAlertLayer(v13);
if ( v10 )
{
v11 = sub_14003BDB0((__int64)v17, (__int64)&v14);
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)&v14);
ButtonSprite::updateBGImage(v10->m_button2, "GJ_button_06.png");
v10->setTag(v10, 1);
v10->show(v10);
if ( v20 > 0xF )
{
v12 = Block[0];
if ( v20 + 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)v21);
}