//
// sub_1006A2E60 from 0x1006a2e60 to 0x1006a2fc4 (356 bytes)
//
// 1 xrefs:
// > sub_100676718 @ 0x1006767e0
//
// 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 11:11:40 +0000
//
__int64 __fastcall sub_1006A2E60(size_t *a1, int a2, _BYTE *a3)
{
size_t *v5; // x21
size_t *v6; // x22
int *v7; // x19
unsigned __int8 v8; // w8
_BYTE *v9; // x23
int v10; // t1
int v12; // t1
__int64 result; // x0
int v14; // w8
v5 = a1 + 126;
v6 = a1 + 122;
if ( a2 )
v7 = (int *)(a1 + 126);
else
v7 = (int *)(a1 + 122);
if ( !sub_10069A1C4("NTLM", a3, 4) )
return 0;
v10 = (unsigned __int8)a3[4];
v9 = a3 + 4;
v8 = v10;
if ( !v10 )
goto LABEL_16;
while ( (char)v8 < 0 ? __maskrune(v8, 0x4000u) : _DefaultRuneLocale.__runetype[v8] & 0x4000 )
{
v12 = (unsigned __int8)*++v9;
v8 = v12;
if ( !v12 )
goto LABEL_16;
}
if ( !*v9 )
{
LABEL_16:
v14 = *v7;
if ( *v7 )
{
if ( v14 == 3 )
{
sub_10067860C(*a1, "NTLM handshake rejected\n");
sub_1006A5F10(v6);
sub_1006A5F10(v5);
sub_1006A31E8(a1);
*v7 = 0;
return 9;
}
if ( v14 != 4 )
{
sub_10067860C(*a1, "NTLM handshake failure (internal error)\n");
return 9;
}
sub_10067860C(*a1, "NTLM auth restarted\n");
sub_1006A5F10(v6);
sub_1006A5F10(v5);
sub_1006A31E8(a1);
}
*v7 = 1;
return 0;
}
result = sub_1006A42FC(*a1, v9, v7);
if ( !(_DWORD)result )
{
*v7 = 2;
return 0;
}
return result;
}