//
// sub_E22DE4 from 0xe22de4 to 0xe22f2c (328 bytes)
//
// 1 xrefs:
// > sub_DEDBAC @ 0xdedcd4
//
// 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:47 +0000
//
__int64 __fastcall sub_E22DE4(__int64 *a1, char a2, _BYTE *a3)
{
int *v5; // x20
int v6; // w0
unsigned int v7; // w1
int v8; // w0
_BYTE *v9; // x19
int v10; // w0
int v12; // t1
v5 = (int *)(a1 + 154);
if ( !a2 )
v5 = (int *)(a1 + 150);
v6 = sub_E0AA10("NTLM", a3, 4);
v7 = 0;
if ( !v6 )
return v7;
v8 = (unsigned __int8)a3[4];
v9 = a3 + 4;
if ( v8 )
{
while ( isspace(v8) )
{
v12 = (unsigned __int8)*++v9;
v8 = v12;
if ( !v12 )
goto LABEL_5;
}
v7 = sub_E29CF8(*a1, v9, v5);
if ( !v7 )
*v5 = 2;
return v7;
}
LABEL_5:
v10 = *v5;
if ( *v5 == 4 )
{
sub_DF16E0(*a1, "NTLM auth restarted\n");
sub_E2AD00(a1 + 150);
sub_E2AD00(a1 + 154);
sub_E237F0(a1);
goto LABEL_8;
}
if ( v10 == 3 )
{
sub_DF16E0(*a1, "NTLM handshake rejected\n");
sub_E2AD00(a1 + 150);
sub_E2AD00(a1 + 154);
sub_E237F0(a1);
*v5 = 0;
return 9;
}
if ( !v10 )
{
LABEL_8:
v7 = 0;
*v5 = 1;
return v7;
}
sub_DF16E0(*a1, "NTLM handshake failure (internal error)\n");
return 9;
}