//
// ThreadViewPopup::requestDeleteMessage from 0x1400e50e0 to 0x1400e5389 (681 bytes)
//
// 3 xrefs:
// > ThreadMessageOptionsPopup::onAction @ 0x1400e5a7b
// > ThreadMessageOptionsPopup::FLAlert_Clicked @ 0x1400e5c3c
// > ??> @ 0x140914c3c
//
// 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 11:26:32 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall ThreadViewPopup::requestDeleteMessage(__int64 a1, __int64 a2)
{
__int64 v4; // rcx
char v5; // di
void *v6; // r8
bool v7; // zf
cocos2d::CCString *v8; // rax
const char *CString; // rax
size_t v10; // r8
__int64 v11; // rcx
char updated; // bp
void *v13; // r8
__int64 v14; // rbx
__int64 v15; // rax
void *v16; // [rsp+30h] [rbp-48h]
void *v17; // [rsp+30h] [rbp-48h]
void *v18; // [rsp+30h] [rbp-48h]
void *Block[2]; // [rsp+38h] [rbp-40h] BYREF
__int64 v20; // [rsp+48h] [rbp-30h]
unsigned __int64 v21; // [rsp+50h] [rbp-28h]
if ( !*(_QWORD *)(a1 + 1096) && a2 > 0 )
{
if ( *(_BYTE *)(a1 + 783) )
{
v20 = 13;
v21 = 15;
strcpy((char *)Block, "deleteMessage");
HIWORD(Block[1]) = 0;
v4 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v16 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v16);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v4 = *(_QWORD *)&qword_14090BFB0;
}
v5 = GameLevelManager::adminThreadAction(v4, *(unsigned int *)(*(_QWORD *)(a1 + 744) + 56LL), Block, a2);
if ( v21 > 0xF )
{
v6 = Block[0];
if ( v21 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
v7 = v5 == 0;
}
else
{
v8 = cocos2d::CCString::createWithFormat("%lli", a2);
CString = cocos2d::CCString::getCString(v8);
*(_OWORD *)Block = 0;
v20 = 0;
v21 = 0;
v10 = -1;
do
++v10;
while ( CString[v10] );
sub_14003D230(Block, CString, v10);
v11 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v17 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v17);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v11 = *(_QWORD *)&qword_14090BFB0;
}
updated = GameLevelManager::updateThread(v11, *(unsigned int *)(*(_QWORD *)(a1 + 744) + 56LL), 12, Block);
if ( v21 > 0xF )
{
v13 = Block[0];
if ( v21 + 1 >= 0x1000 )
{
v13 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v13 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v13);
}
v7 = updated == 0;
}
if ( !v7 )
{
*(_QWORD *)(a1 + 1096) = a2;
v14 = a1 + 672;
v15 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v18 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v18);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v15 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v15 + 1392) = v14;
}
}
}