//
// sub_E0D04C from 0xe0d04c to 0xe0d194 (328 bytes)
//
// 2 xrefs:
// > sub_E0DC68 @ 0xe0dff4
// > sub_E0DC68 @ 0xe0e050
//
// 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
//
__int64 __fastcall sub_E0D04C(const char *a1, int a2, _DWORD *a3, _DWORD *a4)
{
unsigned __int64 v8; // x0
char *v9; // x1
__int64 result; // x0
_BYTE v11[8]; // [xsp+30h] [xbp+30h] BYREF
char *v12; // [xsp+38h] [xbp+38h] BYREF
if ( !a1 )
return 0;
v8 = strtoul(a1, &v12, 10);
v9 = v12;
if ( !v12 )
{
if ( (v8 & 0x8000000000000000LL) == 0 )
{
*a3 = v8;
goto LABEL_12;
}
LABEL_15:
ERR_put_error(13, 182, 187, (__int64)"crypto/asn1/asn1_gen.c", 360);
return 0;
}
if ( *v12 && v12 > &a1[a2] )
return 0;
if ( (v8 & 0x8000000000000000LL) != 0 )
goto LABEL_15;
*a3 = v8;
if ( !(a2 + (_DWORD)a1 - (_DWORD)v9) )
{
LABEL_12:
result = 1;
*a4 = 128;
return result;
}
switch ( *v9 )
{
case 'A':
result = 1;
*a4 = 64;
break;
case 'C':
goto LABEL_12;
case 'P':
result = 1;
*a4 = 192;
break;
case 'U':
*a4 = 0;
result = 1;
break;
default:
v11[0] = *v9;
v11[1] = 0;
ERR_put_error(13, 182, 186, (__int64)"crypto/asn1/asn1_gen.c", 391);
ERR_add_error_data(2, "Char=", v11);
return 0;
}
return result;
}