//
// sub_DEDBAC from 0xdedbac to 0xdedeac (768 bytes)
//
// 2 xrefs:
// > sub_DF0298 @ 0xdf1600
// > sub_E22168 @ 0xe22a20
//
// 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:15 +0000
//
__int64 __fastcall sub_DEDBAC(_QWORD *a1, unsigned __int8 a2, const char *a3)
{
__int64 v3; // x27
unsigned int v4; // w26
const char *v6; // x19
__int64 v7; // x24
_QWORD *v8; // x21
__int64 v9; // x20
__int64 v10; // x0
int v11; // w3
int v12; // t1
int v13; // w0
int v14; // t1
__int64 v16; // x1
int v17; // w0
int v18; // t1
int v19; // w0
const char *v20; // x28
int v21; // t1
char *v22; // x0
__int64 v23; // x28
v3 = *a1;
v4 = a2;
v6 = a3;
v7 = *a1 + 0x8000LL;
if ( a2 )
{
v8 = (_QWORD *)(*a1 + 36248LL);
v9 = *a1 + 35864LL;
}
else
{
v8 = (_QWORD *)(*a1 + 36256LL);
v9 = *a1 + 35832LL;
}
if ( !*a3 )
return 0;
while ( !(unsigned int)sub_E0AA10("NTLM", v6, 4) )
{
if ( !(unsigned int)sub_E0AA10("Digest", v6, 6) )
{
if ( (unsigned int)sub_E0AA10("Basic", v6, 5) )
{
*v8 |= 1uLL;
v23 = *(_QWORD *)(v9 + 8);
*(_QWORD *)(v9 + 16) |= 1uLL;
if ( v23 == 1 )
{
*(_QWORD *)(v9 + 16) = 0;
sub_DF16E0(v3, "Authentication problem. Ignoring this.\n");
*(_BYTE *)(v7 + 3128) = 1;
}
}
goto LABEL_8;
}
if ( (*(_QWORD *)(v9 + 16) & 2) == 0 )
{
if ( (unsigned __int8)sub_E28924() )
{
*v8 |= 2uLL;
*(_QWORD *)(v9 + 16) |= 2uLL;
if ( (unsigned int)sub_E14CE8(a1, v4, v6) )
{
LABEL_40:
sub_DF16E0(v3, "Authentication problem. Ignoring this.\n");
*(_BYTE *)(v7 + 3128) = 1;
}
}
LABEL_8:
v11 = *(unsigned __int8 *)v6;
goto LABEL_11;
}
sub_DF16E0(v3, "Ignoring duplicate digest auth header.\n");
v11 = *(unsigned __int8 *)v6;
LABEL_11:
while ( v11 != 44 && v11 )
{
v12 = *(unsigned __int8 *)++v6;
v11 = v12;
}
if ( v11 == 44 )
v11 = *(unsigned __int8 *)++v6;
LABEL_14:
v13 = v11;
if ( v11 )
{
while ( isspace(v13) )
{
v14 = *(unsigned __int8 *)++v6;
v13 = v14;
if ( !v14 )
return 0;
}
if ( *v6 )
continue;
}
return 0;
}
if ( (*(_QWORD *)(v9 + 16) & 0x28LL) == 0 && !(unsigned __int8)sub_E29CF0() )
goto LABEL_8;
*v8 |= 8uLL;
v10 = *(_QWORD *)(v9 + 8);
*(_QWORD *)(v9 + 16) |= 8uLL;
if ( v10 != 32 && v10 != 8 )
goto LABEL_8;
if ( (unsigned int)sub_E22DE4(a1, v4, v6) )
goto LABEL_40;
v16 = *(_QWORD *)(v9 + 8);
*(_BYTE *)(v7 + 3128) = 0;
if ( v16 != 32 )
goto LABEL_8;
*v8 &= ~8uLL;
*(_QWORD *)(v9 + 16) &= ~8uLL;
*v8 |= 0x20uLL;
*(_QWORD *)(v9 + 16) |= 0x20uLL;
v17 = *(unsigned __int8 *)v6;
if ( *v6 )
{
do
{
if ( !isspace(v17) )
break;
v18 = *(unsigned __int8 *)++v6;
v17 = v18;
}
while ( v18 );
}
if ( !(unsigned int)sub_E0AA10("NTLM", v6, 4) )
goto LABEL_8;
v19 = *((unsigned __int8 *)v6 + 4);
v20 = v6 + 4;
if ( !v6[4] )
{
LABEL_45:
v6 = v20;
v11 = 0;
goto LABEL_14;
}
while ( isspace(v19) )
{
v21 = *(unsigned __int8 *)++v20;
v19 = v21;
if ( !v21 )
goto LABEL_45;
}
v6 = v20;
v22 = off_154A3D8(v20);
a1[159] = v22;
if ( v22 )
{
v11 = *(unsigned __int8 *)v20;
goto LABEL_11;
}
return 27;
}