//
// sub_63C460 from 0x63c460 to 0x63c526 (198 bytes)
//
// 1 xrefs:
// > sub_614AFC @ 0x614bf6
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_63C460(size_t *a1, int a2, _BYTE *a3)
{
int *v5; // r6
int result; // r0
_BYTE *v7; // r1
int v8; // t1
int v9; // r4
int v10; // r3
v5 = (int *)(a1 + 195);
if ( !a2 )
v5 = (int *)(a1 + 189);
result = sub_62AC7C("NTLM", a3, 4);
if ( result )
{
v7 = a3 + 4;
if ( a3[4] )
{
if ( (*(_BYTE *)((unsigned __int8)a3[4] + ctype_ + 1) & 8) == 0 )
{
LABEL_15:
result = sub_640FEC(*a1, v7, v5);
if ( !result )
*v5 = 2;
return result;
}
while ( 1 )
{
v8 = (unsigned __int8)*++v7;
v9 = ctype_ + v8;
if ( !v8 )
break;
if ( (*(_BYTE *)(v9 + 1) & 8) == 0 )
goto LABEL_15;
}
}
v10 = *v5;
if ( *v5 == 4 )
{
sub_61807C(*a1, "NTLM auth restarted\n");
sub_641B58(a1 + 189);
sub_641B58(a1 + 195);
sub_63C80C(a1);
goto LABEL_12;
}
if ( v10 == 3 )
{
sub_61807C(*a1, "NTLM handshake rejected\n");
sub_641B58(a1 + 189);
sub_641B58(a1 + 195);
sub_63C80C(a1);
*v5 = 0;
return 9;
}
else
{
if ( !v10 )
{
LABEL_12:
*v5 = 1;
return 0;
}
sub_61807C(*a1, "NTLM handshake failure (internal error)\n");
return 9;
}
}
return result;
}