//
// sub_108E114 from 0x108e114 to 0x108efc8 (3764 bytes)
//
// 9 xrefs:
// > sub_108E114 @ 0x108e29c
// > sub_108E114 @ 0x108e48c
// > sub_108E114 @ 0x108e5ac
// > sub_108E114 @ 0x108e614
// > sub_108E114 @ 0x108e9ac
// > sub_108E114 @ 0x108ecb4
// > ASN1_item_print @ 0x108f114
// > ASN1_item_print @ 0x108f28c
// > ASN1_item_print @ 0x108f52c
//
// 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:17:17 +0000
//
__int64 __fastcall sub_108E114(__int64 a1, unsigned int **a2, unsigned int a3, __int64 *a4, __int64 *a5)
{
__int64 v5; // x6
unsigned int **v9; // x20
const char *v10; // x23
__int64 v12; // x5
const char *v13; // x21
unsigned int v14; // w19
const char *v15; // x4
unsigned int *v16; // x28
int v17; // w20
unsigned int v18; // w27
__int64 v19; // x0
unsigned __int8 *v20; // x19
__int64 (__fastcall *v21)(__int64, int **, unsigned __int8 *, __int64 *); // x21
__int64 (__fastcall *v22)(__int64, int **, unsigned __int8 *, __int64 *); // d10
__int64 v23; // x3
unsigned int (__fastcall *v25)(__int64, int **, unsigned __int8 *, _QWORD, __int64 *); // x5
__int64 (__fastcall *v26)(__int64, int **, _QWORD, char *, __int64 *); // x5
int v27; // w0
int choice_selector; // w2
int v29; // w0
_QWORD *v30; // x23
__int64 v31; // x25
__int64 field_ptr; // x0
bool v33; // cc
_QWORD *v34; // x0
_QWORD *v35; // x21
__int64 v36; // x21
int *v37; // x23
__int64 *v38; // x25
unsigned __int64 v39; // x21
unsigned __int8 *v40; // x25
__int64 v41; // x26
__int64 (__fastcall *v42)(__int64, unsigned int **, unsigned __int8 *, __int64 *); // x27
__int64 v43; // x3
__int64 v44; // x0
__int64 (__fastcall *v45)(__int64, unsigned int **, unsigned __int8 *, _QWORD, __int64 *); // x5
_DWORD *v46; // x25
unsigned int v47; // w0
signed int v48; // t1
const char *v49; // x0
__int64 v50; // x0
const char *v51; // x1
__int64 v52; // x0
__int64 (__fastcall *v53)(__int64, unsigned int **, _QWORD, char *, __int64 *); // x5
int v54; // w0
int v55; // w2
int v56; // w0
__int64 v57; // x23
_QWORD *v58; // x21
_QWORD *v59; // x0
__int64 v60; // x0
unsigned int v61; // w0
char *v62; // x21
_BYTE *v63; // x0
_BYTE *v64; // x19
void *v65; // x0
_BOOL4 v66; // w19
__int64 v67; // x21
unsigned int *v68; // x23
unsigned __int64 v69; // x21
int v70; // w20
__int64 v71; // x0
unsigned int *v72; // x20
unsigned int v73; // w0
signed int v74; // t1
const char *v75; // x0
unsigned int v76; // w0
char *v77; // x20
_BYTE *v78; // x0
_BYTE *v79; // x20
void *v80; // x0
__int64 v81; // x0
const char *v82; // x1
__int64 v83; // [xsp+A8h] [xbp+A8h]
_QWORD *v84; // [xsp+A8h] [xbp+A8h]
__int64 v85; // [xsp+A8h] [xbp+A8h]
__int64 v86; // [xsp+A8h] [xbp+A8h]
__int64 v87; // [xsp+A8h] [xbp+A8h]
unsigned int **v88; // [xsp+B8h] [xbp+B8h] BYREF
int *v89; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v90; // [xsp+C8h] [xbp+C8h] BYREF
unsigned int v91; // [xsp+D0h] [xbp+D0h]
__int64 *v92; // [xsp+D8h] [xbp+D8h]
char v93[80]; // [xsp+E0h] [xbp+E0h] BYREF
v5 = *a5;
v9 = a2;
v10 = nullptr;
v12 = *a4;
if ( (*a5 & 0x80) != 0 )
v10 = *(const char **)(a4[4] + 48);
v13 = nullptr;
if ( (v5 & 0x40) == 0 )
v13 = (const char *)a4[3];
if ( (v12 & 0x1000) != 0 )
{
v88 = a2;
v9 = (unsigned int **)&v88;
}
v14 = v12 & 6;
if ( (v12 & 6) != 0 )
{
if ( v13 )
{
if ( (v5 & 4) != 0 )
{
if ( (v12 & 2) != 0 )
v15 = "SET";
else
v15 = "SEQUENCE";
if ( (int)BIO_printf(a1, "%*s%s OF %s {\n", a3, &byte_11B8890, v15, (const char *)a4[3]) > 0 )
goto LABEL_13;
return 0;
}
if ( (int)BIO_printf(a1, "%*s%s:\n", a3, &byte_11B8890, v13) <= 0 )
return 0;
}
LABEL_13:
v16 = *v9;
v17 = 0;
while ( v17 < (int)OPENSSL_sk_num(v16) )
{
if ( v17 > 0 && (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0 )
return 0;
v18 = a3 + 2;
v19 = OPENSSL_sk_value((__int64)v16, v17);
v89 = (int *)v19;
v20 = (unsigned __int8 *)a4[4];
v21 = *((__int64 (__fastcall **)(__int64, int **, unsigned __int8 *, __int64 *))v20 + 4);
v22 = v21;
if ( v21 )
{
v22 = *((__int64 (__fastcall **)(__int64, int **, unsigned __int8 *, __int64 *))v21 + 3);
if ( v22 )
{
v90 = a1;
v91 = a3 + 2;
v92 = a5;
}
}
if ( *v20 )
{
if ( v19 )
{
switch ( *v20 )
{
case 1u:
case 6u:
if ( !v22 )
goto LABEL_52;
v29 = v22(8, &v89, v20, &v90);
if ( !v29 )
return 0;
if ( v29 == 2 )
goto LABEL_30;
LABEL_52:
v30 = *((_QWORD **)v20 + 2);
if ( *((__int64 *)v20 + 3) <= 0 )
goto LABEL_84;
v31 = 1;
do
{
v34 = asn1_do_adb(&v89, v30, 1);
v35 = v34;
if ( !v34 )
return 0;
field_ptr = asn1_get_field_ptr(&v89, (__int64)v34);
if ( !(unsigned int)sub_108E114(a1, field_ptr, a3 + 4, v35, a5) )
return 0;
v30 += 5;
v33 = v31++ < *((_QWORD *)v20 + 3);
}
while ( v33 );
LABEL_84:
if ( (*a5 & 2) != 0 && (BIO_printf(a1, "%*s}\n", v18, &byte_11B8890) & 0x80000000) != 0 )
return 0;
if ( !v22 )
goto LABEL_30;
if ( !(unsigned int)v22(9, &v89, v20, &v90) )
return 0;
++v17;
continue;
case 2u:
choice_selector = asn1_get_choice_selector(&v89, (__int64)v20);
if ( choice_selector < 0 || choice_selector >= *((_QWORD *)v20 + 3) )
{
if ( (int)BIO_printf(a1, "ERROR: selector [%d] invalid\n", choice_selector) <= 0 )
return 0;
++v17;
}
else
{
v83 = *((_QWORD *)v20 + 2) + 40LL * choice_selector;
v44 = asn1_get_field_ptr(&v89, v83);
if ( !(unsigned int)sub_108E114(a1, v44, v18, v83, a5) )
return 0;
++v17;
}
break;
case 4u:
if ( !v21 )
goto LABEL_30;
v26 = *((__int64 (__fastcall **)(__int64, int **, _QWORD, char *, __int64 *))v21 + 6);
if ( !v26 )
goto LABEL_30;
v27 = v26(a1, &v89, v18, &byte_11B8890, a5);
if ( !v27 )
return 0;
if ( v27 == 2 )
goto LABEL_43;
goto LABEL_30;
case 5u:
goto LABEL_26;
default:
BIO_printf(a1, "Unprocessed type %d\n", *v20);
return 0;
}
continue;
}
LABEL_59:
if ( (*a5 & 1) == 0 )
goto LABEL_30;
if ( (int)BIO_puts(a1, (__int64)"
\n") <= 0 )
return 0;
++v17;
continue;
}
if ( *((_QWORD *)v20 + 1) != 1 && !v19 )
goto LABEL_59;
v23 = *((_QWORD *)v20 + 2);
if ( v23 )
{
if ( !(unsigned int)sub_108E114(a1, &v89, v18, v23, a5) )
return 0;
LABEL_30:
++v17;
continue;
}
LABEL_26:
if ( !(unsigned int)sub_108DFD4(a1, v18, 0, nullptr, a5) )
return 0;
if ( v21 )
{
v25 = *((unsigned int (__fastcall **)(__int64, int **, unsigned __int8 *, _QWORD, __int64 *))v21 + 7);
if ( v25 )
{
if ( !v25(a1, &v89, v20, v18, a5) )
return 0;
goto LABEL_30;
}
}
if ( *v20 == 5 )
{
v37 = v89;
v36 = (int)(v89[1] & 0xFFFFFEFF);
if ( v36 == -4 )
goto LABEL_101;
}
else
{
v36 = *((_QWORD *)v20 + 1);
if ( v36 == 1 )
{
if ( (*a5 & 8) == 0 )
{
v38 = (__int64 *)&v89;
LABEL_112:
LODWORD(v50) = *(_DWORD *)v38;
if ( *(_DWORD *)v38 != -1 || (v50 = *((_QWORD *)v20 + 5), v51 = "BOOL ABSENT", (_DWORD)v50 != -1) )
{
v51 = "TRUE";
if ( !(_DWORD)v50 )
v51 = "FALSE";
}
if ( (int)BIO_puts(a1, (__int64)v51) <= 0 )
return 0;
goto LABEL_43;
}
v47 = 1;
v37 = nullptr;
v38 = (__int64 *)&v89;
goto LABEL_102;
}
v37 = v89;
if ( v36 == -4 )
{
LABEL_101:
v46 = v37;
v37 = *((int **)v37 + 1);
v48 = *v46;
v38 = (__int64 *)(v46 + 2);
v47 = v48;
v36 = v48;
if ( (*a5 & 0x10) == 0 )
goto LABEL_102;
goto LABEL_66;
}
}
v38 = (__int64 *)&v89;
if ( (*a5 & 8) != 0 )
{
v47 = v36;
v38 = (__int64 *)&v89;
LABEL_102:
v49 = ASN1_tag2str(v47);
if ( v36 == 5 )
{
LABEL_107:
if ( (int)BIO_puts(a1, (__int64)"NULL\n") <= 0 )
return 0;
++v17;
continue;
}
if ( v49 && ((int)BIO_puts(a1, (__int64)v49) <= 0 || (int)BIO_puts(a1, (__int64)":") <= 0) )
return 0;
goto LABEL_67;
}
LABEL_66:
if ( v36 == 5 )
goto LABEL_107;
LABEL_67:
v39 = v36 + 3;
if ( v39 > 0x1B )
{
LABEL_68:
if ( !(unsigned int)ASN1_STRING_print_ex(a1, v37, a5[4]) )
return 0;
LABEL_43:
if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0 )
return 0;
++v17;
continue;
}
switch ( (int)v39 )
{
case 0:
case 19:
case 20:
if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0
|| (int)ASN1_parse_dump(a1, *((char **)v37 + 1), *v37, v18, 0) <= 0 )
{
return 0;
}
++v17;
break;
case 4:
goto LABEL_112;
case 5:
case 13:
v63 = i2s_ASN1_INTEGER(0, v37);
v64 = v63;
if ( !v63 )
return 0;
v33 = (int)BIO_puts(a1, (__int64)v63) <= 0;
v65 = v64;
v66 = !v33;
CRYPTO_free(v65, (__int64)"crypto/asn1/tasn_prn.c", 401);
if ( !v66 )
return 0;
goto LABEL_43;
case 6:
case 7:
if ( v37[1] == 3 )
{
if ( (int)BIO_printf(a1, " (%ld unused bits)\n", *((_QWORD *)v37 + 2) & 7LL) <= 0 )
return 0;
}
else if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0 )
{
return 0;
}
if ( *v37 <= 0 )
goto LABEL_30;
if ( (int)BIO_dump_indent(a1, *((unsigned __int8 **)v37 + 1), *v37, a3 + 4) <= 0 )
return 0;
++v17;
break;
case 9:
v85 = *v38;
v61 = OBJ_obj2nid(*v38);
v62 = OBJ_nid2ln(v61);
if ( !v62 )
v62 = &byte_11B8890;
OBJ_obj2txt(v93, 80, v85, 1);
if ( (int)BIO_printf(a1, "%s (%s)", v62, v93) <= 0 )
return 0;
goto LABEL_43;
case 26:
if ( !ASN1_UTCTIME_print(a1, (__int64)v37) )
return 0;
goto LABEL_43;
case 27:
if ( !ASN1_GENERALIZEDTIME_print(a1, (__int64)v37) )
return 0;
goto LABEL_43;
default:
goto LABEL_68;
}
}
if ( !v17 && (int)BIO_printf(a1, "%*s\n", a3 + 2, &byte_11B8890) <= 0 )
return 0;
if ( (*a5 & 2) != 0 )
return (int)BIO_printf(a1, "%*s}\n", a3, &byte_11B8890) > 0;
return 1;
}
v40 = (unsigned __int8 *)a4[4];
v41 = *((_QWORD *)v40 + 4);
if ( v41 )
{
v42 = *(__int64 (__fastcall **)(__int64, unsigned int **, unsigned __int8 *, __int64 *))(v41 + 24);
if ( v42 )
{
v90 = a1;
v91 = a3;
v92 = a5;
}
}
else
{
v42 = nullptr;
}
if ( *v40 )
{
if ( *v9 )
{
switch ( *v40 )
{
case 1u:
case 6u:
if ( !(unsigned int)sub_108DFD4(a1, a3, (__int64)v13, v10, a5) )
return v14;
if ( !v13 && !v10 )
goto LABEL_130;
if ( (*a5 & 2) != 0 )
{
if ( (int)BIO_puts(a1, (__int64)" {\n") <= 0 )
return v14;
}
else if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0 )
{
return v14;
}
LABEL_130:
if ( v42 )
{
v56 = v42(8, v9, v40, &v90);
if ( !v56 )
return v14;
if ( v56 == 2 )
return 1;
}
v57 = 1;
v58 = *((_QWORD **)v40 + 2);
if ( *((__int64 *)v40 + 3) <= 0 )
goto LABEL_137;
break;
case 2u:
v55 = asn1_get_choice_selector(v9, (__int64)v40);
if ( v55 < 0 || v55 >= *((_QWORD *)v40 + 3) )
{
return (int)BIO_printf(a1, "ERROR: selector [%d] invalid\n", v55) > 0;
}
else
{
v86 = *((_QWORD *)v40 + 2) + 40LL * v55;
v71 = asn1_get_field_ptr(v9, v86);
return (unsigned int)sub_108E114(a1, v71, a3, v86, a5) != 0;
}
case 4u:
if ( !(unsigned int)sub_108DFD4(a1, a3, (__int64)v13, v10, a5) )
return v14;
v52 = *((_QWORD *)v40 + 4);
if ( v52 )
{
v53 = *(__int64 (__fastcall **)(__int64, unsigned int **, _QWORD, char *, __int64 *))(v52 + 48);
if ( v53 )
{
v54 = v53(a1, v9, a3, &byte_11B8890, a5);
if ( !v54 )
return v14;
if ( v54 == 2 )
return (int)BIO_puts(a1, (__int64)&byte_11AAA48) > 0;
return 1;
}
}
if ( !v10 )
return 1;
return (int)BIO_printf(a1, ":EXTERNAL TYPE %s\n", v10) > 0;
case 5u:
goto LABEL_96;
default:
BIO_printf(a1, "Unprocessed type %d\n", *v40);
return v14;
}
while ( 1 )
{
v59 = asn1_do_adb(v9, v58, 1);
if ( !v59 )
break;
v84 = v59;
v60 = asn1_get_field_ptr(v9, (__int64)v59);
if ( !(unsigned int)sub_108E114(a1, v60, a3 + 2, v84, a5) )
break;
v58 += 5;
v33 = v57++ < *((_QWORD *)v40 + 3);
if ( !v33 )
{
LABEL_137:
if ( (*a5 & 2) == 0 || (BIO_printf(a1, "%*s}\n", a3, &byte_11B8890) & 0x80000000) == 0 )
{
if ( !v42 )
return 1;
return (unsigned int)v42(9, v9, v40, &v90) != 0;
}
return v14;
}
}
return v14;
}
goto LABEL_170;
}
if ( *((_QWORD *)v40 + 1) != 1 && !*v9 )
{
LABEL_170:
if ( (v5 & 1) == 0 )
return 1;
if ( (unsigned int)sub_108DFD4(a1, a3, (__int64)v13, v10, a5) )
return (int)BIO_puts(a1, (__int64)"\n") > 0;
return v14;
}
v43 = *((_QWORD *)v40 + 2);
if ( v43 )
return (unsigned int)sub_108E114(a1, v9, a3, v43, a5) != 0;
LABEL_96:
if ( !(unsigned int)sub_108DFD4(a1, a3, (__int64)v13, v10, a5) )
return v14;
if ( v41 )
{
v45 = *(__int64 (__fastcall **)(__int64, unsigned int **, unsigned __int8 *, _QWORD, __int64 *))(v41 + 56);
if ( v45 )
return (unsigned int)v45(a1, v9, v40, a3, a5) != 0;
}
if ( *v40 == 5 )
{
v68 = *v9;
v67 = (int)((*v9)[1] & 0xFFFFFEFF);
}
else
{
v67 = *((_QWORD *)v40 + 1);
if ( v67 == 1 )
{
if ( (*a5 & 8) == 0 )
{
LABEL_222:
LODWORD(v81) = *(_DWORD *)v9;
if ( *(_DWORD *)v9 == -1 && (v81 = *((_QWORD *)v40 + 5), (_DWORD)v81 == -1) )
{
v82 = "BOOL ABSENT";
}
else if ( (_DWORD)v81 )
{
v82 = "TRUE";
}
else
{
v82 = "FALSE";
}
if ( (int)BIO_puts(a1, (__int64)v82) <= 0 )
return v14;
goto LABEL_183;
}
v73 = 1;
v68 = nullptr;
goto LABEL_193;
}
v68 = *v9;
}
if ( v67 == -4 )
{
v72 = v68;
v68 = *((unsigned int **)v68 + 1);
v74 = *v72;
v9 = (unsigned int **)(v72 + 2);
v73 = v74;
v67 = v74;
if ( (*a5 & 0x10) != 0 )
{
LABEL_179:
if ( v67 != 5 )
goto LABEL_180;
LABEL_200:
if ( (int)BIO_puts(a1, (__int64)"NULL\n") > 0 )
return 1;
return v14;
}
}
else
{
if ( (*a5 & 8) == 0 )
goto LABEL_179;
v73 = v67;
}
LABEL_193:
v75 = ASN1_tag2str(v73);
if ( v67 == 5 )
goto LABEL_200;
if ( v75 && ((int)BIO_puts(a1, (__int64)v75) <= 0 || (int)BIO_puts(a1, (__int64)":") <= 0) )
return v14;
LABEL_180:
v69 = v67 + 3;
if ( v69 <= 0x1B )
{
switch ( (int)v69 )
{
case 0:
case 19:
case 20:
if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) > 0
&& (int)ASN1_parse_dump(a1, *((char **)v68 + 1), (int)*v68, a3, 0) > 0 )
{
return 1;
}
return v14;
case 4:
goto LABEL_222;
case 5:
case 13:
v78 = i2s_ASN1_INTEGER(0, v68);
v79 = v78;
if ( !v78 )
return v14;
v33 = (int)BIO_puts(a1, (__int64)v78) <= 0;
v80 = v79;
v70 = !v33;
CRYPTO_free(v80, (__int64)"crypto/asn1/tasn_prn.c", 401);
goto LABEL_182;
case 6:
case 7:
if ( v68[1] == 3 )
{
if ( (int)BIO_printf(a1, " (%ld unused bits)\n", *((_QWORD *)v68 + 2) & 7LL) <= 0 )
return v14;
}
else if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) <= 0 )
{
return v14;
}
if ( (int)*v68 <= 0 )
return 1;
if ( (int)BIO_dump_indent(a1, *((unsigned __int8 **)v68 + 1), *v68, a3 + 2) > 0 )
v14 = 1;
break;
case 9:
v87 = (__int64)*v9;
v76 = OBJ_obj2nid((__int64)*v9);
v77 = OBJ_nid2ln(v76);
if ( !v77 )
v77 = &byte_11B8890;
OBJ_obj2txt(v93, 80, v87, 1);
v70 = (int)BIO_printf(a1, "%s (%s)", v77, v93) > 0;
goto LABEL_182;
case 26:
v70 = ASN1_UTCTIME_print(a1, (__int64)v68);
goto LABEL_182;
case 27:
v70 = ASN1_GENERALIZEDTIME_print(a1, (__int64)v68);
goto LABEL_182;
default:
goto LABEL_181;
}
}
else
{
LABEL_181:
v70 = ASN1_STRING_print_ex(a1, (int *)v68, a5[4]);
LABEL_182:
if ( v70 )
{
LABEL_183:
if ( (int)BIO_puts(a1, (__int64)&byte_11AAA48) > 0 )
return 1;
}
}
return v14;
}