//
// sub_E21A4C from 0xe21a4c to 0xe21c28 (476 bytes)
//
// 1 xrefs:
// > sub_DF0298 @ 0xdf152c
//
// This function is hookable on this platform (idp: arm, 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 13:09:46 +0000
//
__int64 __fastcall sub_E21A4C(__int64 *a1, __int64 a2)
{
__int64 v2; // x21
unsigned int v4; // w19
int v6; // w0
const char *v7; // x20
int v8; // t1
const char *v9; // x22
const char *v10; // x23
size_t v11; // x0
__int64 v12; // x0
int v13; // w0
int v14; // t1
size_t v15; // x20
size_t v16; // x0
void *v17; // x0
__int64 v18; // [xsp+48h] [xbp+48h] BYREF
v2 = *a1;
v18 = 0;
v4 = sub_E0AA10("CSeq:", (_BYTE *)a2, 5);
if ( v4 )
{
if ( sscanf((const char *)(a2 + 4), ": %ld", &v18) != 1 )
{
v4 = 85;
sub_DF1848(v2, "Unable to read the CSeq header: [%s]", (const char *)a2);
return v4;
}
v12 = v18;
*(_QWORD *)(*(_QWORD *)(v2 + 536) + 144LL) = v18;
*(_QWORD *)(v2 + 36080) = v12;
return 0;
}
else
{
if ( !(unsigned int)sub_E0AA10("Session:", (_BYTE *)a2, 8) )
return v4;
v6 = *(unsigned __int8 *)(a2 + 8);
v7 = (const char *)(a2 + 8);
if ( v6 )
{
while ( 1 )
{
v4 = isspace(v6);
if ( !v4 )
break;
v8 = *(unsigned __int8 *)++v7;
v6 = v8;
if ( !v8 )
goto LABEL_14;
}
v9 = *(const char **)(v2 + 2024);
v10 = v7;
if ( v9 )
{
v11 = strlen(*(const char **)(v2 + 2024));
if ( strncmp(v7, v9, v11) )
{
v4 = 86;
sub_DF1848(v2, "Got RTSP Session ID Line [%s], but wanted ID [%s]", v7, v9);
}
}
else
{
v13 = *(unsigned __int8 *)v7;
if ( v13 != 59 && *v7 )
{
do
{
if ( isspace(v13) )
break;
v14 = *(unsigned __int8 *)++v7;
v13 = v14;
if ( v14 == 59 )
break;
}
while ( v13 );
v15 = v7 - v10;
v16 = v15 + 1;
}
else
{
v16 = 1;
v15 = 0;
}
v4 = 27;
v17 = off_154A3C0(v16);
*(_QWORD *)(v2 + 2024) = v17;
if ( v17 )
{
v4 = 0;
memcpy(v17, v10, v15);
*(_BYTE *)(*(_QWORD *)(v2 + 2024) + v15) = 0;
}
}
return v4;
}
LABEL_14:
sub_DF1848(v2, "Got a blank Session ID");
return 0;
}
}