// // ASN1_item_ex_d2i from 0xd6cf94 to 0xd6d84c (2232 bytes) // // 3 xrefs: // > ASN1_item_d2i @ 0xd6d880 // > sub_DF18BC @ 0xdf190c // > @ 0x96cc0 // // 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 ASN1_item_ex_d2i( __int64 *a1, char **a2, __int64 a3, __int64 a4, unsigned int a5, __int64 a6, unsigned __int8 a7, __int64 a8) { int v8; // w8 int v13; // w23 __int64 v15; // x21 unsigned int (__fastcall *v16)(__int64, __int64 *, __int64, _QWORD); // x27 int v17; // w21 int v19; // w21 int v20; // w0 int v21; // s9 __int64 v22; // x1 __int64 v23; // x21 _QWORD *v24; // x22 bool v25; // cc __int64 v26; // x0 __int64 v27; // x23 __int64 field_ptr; // x0 __int64 *v29; // x3 int choice_selector; // w0 __int64 v31; // x2 __int64 v32; // x22 __int64 *v33; // x21 unsigned int v34; // w24 __int64 v35; // d8 int v36; // w0 __int64 v37; // x21 __int64 v38; // x0 __int64 v39; // x24 __int64 v40; // x4 int v41; // w0 int v42; // s8 __int64 v43; // x6 char *v44; // x23 __int64 v45; // x2 __int64 v46; // x23 __int64 v47; // x0 __int64 *v48; // x0 __int64 v49; // [xsp+98h] [xbp+78h] unsigned __int8 v50; // [xsp+A9h] [xbp+89h] BYREF unsigned __int8 v51; // [xsp+AAh] [xbp+8Ah] BYREF char v52; // [xsp+ABh] [xbp+8Bh] BYREF unsigned int v53; // [xsp+ACh] [xbp+8Ch] BYREF __int64 v54; // [xsp+B0h] [xbp+90h] BYREF char *v55; // [xsp+B8h] [xbp+98h] BYREF v8 = a5; v54 = a3; v55 = nullptr; v13 = a7; v15 = *(_QWORD *)(a4 + 32); if ( !a1 ) { v17 = 0; goto LABEL_5; } if ( v15 ) { v16 = *(unsigned int (__fastcall **)(__int64, __int64 *, __int64, _QWORD))(v15 + 24); switch ( *(_BYTE *)a4 ) { case 0: goto LABEL_39; case 1: case 6: goto LABEL_20; case 2: if ( v16 && !v16(4, a1, a4, 0) ) goto LABEL_18; goto LABEL_46; case 4: goto LABEL_13; case 5: goto LABEL_8; default: goto LABEL_4; } } switch ( *(_BYTE *)a4 ) { case 0: LABEL_39: v29 = *(__int64 **)(a4 + 16); if ( !v29 ) { v17 = sub_D6AECC(a1, a2, a3, a4, a5, a6, a7, a8); goto LABEL_14; } if ( a5 == -1 && !a7 ) { v17 = sub_D6C3B4((__int64)a1, a2, a3, v29, 0, a8); goto LABEL_14; } ERR_put_error(13, 120, 170, "crypto/asn1/tasn_dec.c", 159); goto LABEL_12; case 1: case 6: v16 = nullptr; LABEL_20: v55 = *a2; if ( a5 == -1 ) { LODWORD(a6) = 0; v8 = 16; } v20 = sub_D6A774(&v54, nullptr, nullptr, &v51, &v52, &v55, a3, v8, a6, a7, a8); if ( !v20 ) { ERR_put_error(13, 120, 58, "crypto/asn1/tasn_dec.c", 274); goto LABEL_12; } if ( v20 == -1 ) goto LABEL_110; if ( v15 && (*(_DWORD *)(v15 + 8) & 4) != 0 ) { v21 = 1; v54 = a3 + *a2 - v55; } else { v21 = v51; } if ( !v52 ) { ERR_put_error(13, 120, 149, "crypto/asn1/tasn_dec.c", 286); goto LABEL_12; } if ( !*a1 && !(unsigned int)ASN1_item_ex_new(a1, a4) ) { ERR_put_error(13, 120, 58, "crypto/asn1/tasn_dec.c", 291); goto LABEL_12; } if ( v16 && !v16(4, a1, a4, 0) ) goto LABEL_18; v22 = *(_QWORD *)(a4 + 24); v23 = 1; v24 = *(_QWORD **)(a4 + 16); if ( v22 <= 0 ) goto LABEL_100; do { if ( (*v24 & 0x300LL) != 0 ) { v26 = asn1_do_adb(a1, v24, 0); v27 = v26; if ( v26 ) { field_ptr = asn1_get_field_ptr(a1, v26); asn1_template_free(field_ptr, v27); } v22 = *(_QWORD *)(a4 + 24); } v25 = v23 < v22; v24 += 5; ++v23; } while ( v25 ); v24 = *(_QWORD **)(a4 + 16); if ( v22 <= 0 ) { LABEL_100: v42 = 0; LABEL_101: if ( v51 ) { if ( v54 > 1 && !*v55 && !v55[1] ) { v55 += 2; goto LABEL_90; } goto LABEL_107; } LABEL_90: if ( !v21 && v54 ) { ERR_put_error(13, 120, 148, "crypto/asn1/tasn_dec.c", 369); goto LABEL_12; } } else { v39 = 0; while ( 1 ) { v42 = v39; v33 = (__int64 *)asn1_do_adb(a1, v24, 1); if ( !v33 ) goto LABEL_12; v43 = asn1_get_field_ptr(a1, v33); if ( !v54 ) break; v44 = v55; if ( v54 > 1 && !*v55 && !v55[1] ) { v55 += 2; if ( v51 ) { v51 = 0; v54 -= 2; goto LABEL_90; } ERR_put_error(13, 120, 159, "crypto/asn1/tasn_dec.c", 325); LABEL_12: v17 = 0; ERR_add_error_data(2, "Type=", *(_QWORD *)(a4 + 48)); goto LABEL_5; } if ( *(_QWORD *)(a4 + 24) - 1LL == v39 ) LOBYTE(v40) = 0; else v40 = *v33 & 1; v49 = v43; v41 = sub_D6C3B4(v43, &v55, v54, v33, v40, a8); if ( !v41 ) { LABEL_80: v45 = v33[3]; v17 = 0; ERR_add_error_data(4, "Field=", v45); goto LABEL_5; } if ( v41 == -1 ) asn1_template_free(v49, v33); else v54 += v44 - v55; ++v39; v24 += 5; v42 = v39; if ( *(_QWORD *)(a4 + 24) <= v39 ) goto LABEL_101; } if ( v51 ) { LABEL_107: ERR_put_error(13, 120, 137, "crypto/asn1/tasn_dec.c", 364); goto LABEL_12; } } v46 = v42 + 1LL; if ( v42 < *(_QWORD *)(a4 + 24) ) { do { v48 = (__int64 *)asn1_do_adb(a1, v24, 1); v33 = v48; if ( !v48 ) goto LABEL_12; if ( (*v48 & 1) == 0 ) { ERR_put_error(13, 120, 121, "crypto/asn1/tasn_dec.c", 389); goto LABEL_80; } v24 += 5; v47 = asn1_get_field_ptr(a1, v48); asn1_template_free(v47, v33); v25 = v46++ < *(_QWORD *)(a4 + 24); } while ( v25 ); } if ( !(unsigned int)asn1_enc_save(a1, *a2, (unsigned int)v55 - (unsigned int)*a2, a4) ) goto LABEL_18; if ( v16 ) { LABEL_56: if ( !v16(5, a1, a4, 0) ) { LABEL_18: ERR_put_error(13, 120, 100, "crypto/asn1/tasn_dec.c", 405); goto LABEL_12; } } LABEL_57: v17 = 1; *a2 = v55; return (unsigned int)v17; case 2: v16 = nullptr; LABEL_46: if ( *a1 ) { choice_selector = asn1_get_choice_selector(a1, a4); v31 = *(_QWORD *)(a4 + 24); if ( (choice_selector & 0x80000000) == 0 && choice_selector < v31 ) { v37 = *(_QWORD *)(a4 + 16) + 40LL * choice_selector; v38 = asn1_get_field_ptr(a1, v37); asn1_template_free(v38, v37); asn1_set_choice_selector(a1, 0xFFFFFFFFLL, a4); v31 = *(_QWORD *)(a4 + 24); } } else { if ( !(unsigned int)ASN1_item_ex_new(a1, a4) ) { ERR_put_error(13, 120, 58, "crypto/asn1/tasn_dec.c", 214); goto LABEL_12; } v31 = *(_QWORD *)(a4 + 24); } v55 = *a2; v32 = 0; v33 = *(__int64 **)(a4 + 16); if ( v31 <= 0 ) { v34 = 0; } else { while ( 1 ) { v34 = v32; v35 = asn1_get_field_ptr(a1, v33); v36 = sub_D6C3B4(v35, &v55, v54, v33, 1u, a8); if ( v36 != -1 ) break; v31 = *(_QWORD *)(a4 + 24); v34 = ++v32; v33 += 5; if ( v31 <= v32 ) goto LABEL_54; } if ( v36 <= 0 ) { asn1_template_free(v35, v33); ERR_put_error(13, 120, 58, "crypto/asn1/tasn_dec.c", 237); if ( !v33 ) goto LABEL_12; goto LABEL_80; } v31 = *(_QWORD *)(a4 + 24); } LABEL_54: if ( v32 != v31 ) { asn1_set_choice_selector(a1, v34, a4); if ( !v16 ) goto LABEL_57; goto LABEL_56; } if ( !v13 ) { ERR_put_error(13, 120, 143, "crypto/asn1/tasn_dec.c", 249); goto LABEL_12; } v17 = -1; ASN1_item_ex_free(a1, a4); goto LABEL_5; case 4: LABEL_13: v17 = (*(__int64 (__fastcall **)(__int64 *, char **, __int64, __int64, _QWORD, __int64, _QWORD, __int64))(v15 + 32))( a1, a2, a3, a4, a5, a6, a7, a8); goto LABEL_14; case 5: LABEL_8: v55 = *a2; if ( !(unsigned int)sub_D6AA1C(nullptr, &v53, &v50, nullptr, nullptr, &v55, a3, 1, a8) ) { ERR_put_error(13, 120, 58, "crypto/asn1/tasn_dec.c", 174); goto LABEL_12; } v19 = v50; if ( v50 ) { if ( !v13 ) { ERR_put_error(13, 120, 139, "crypto/asn1/tasn_dec.c", 183); goto LABEL_12; } LABEL_110: v17 = -1; goto LABEL_5; } if ( (ASN1_tag2bit(v53) & *(_QWORD *)(a4 + 8)) == 0 ) { if ( !v13 ) { ERR_put_error(13, 120, 140, "crypto/asn1/tasn_dec.c", 191); goto LABEL_12; } goto LABEL_110; } v17 = sub_D6AECC(a1, a2, v54, a4, v53, v19, v19, a8); LABEL_14: if ( v17 <= 0 ) LABEL_5: ASN1_item_ex_free(a1, a4); return (unsigned int)v17; default: LABEL_4: v17 = 0; goto LABEL_5; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source