// // asn1_template_free from 0xfeccbc to 0xfed330 (1652 bytes) // // 32 xrefs: // > sub_FE9B88 @ 0xfea064 // > sub_FE9B88 @ 0xfea2a4 // > sub_FE9B88 @ 0xfea38c // > sub_FE9B88 @ 0xfea484 // > sub_FE9B88 @ 0xfea55c // > sub_FEAA90 @ 0xfead00 // > sub_FEAA90 @ 0xfeae94 // > sub_FEAA90 @ 0xfeaffc // > sub_FEAA90 @ 0xfeb050 // > sub_FEAA90 @ 0xfeb11c // > ASN1_item_ex_d2i @ 0xfeb584 // > ASN1_item_ex_d2i @ 0xfeb73c // > ASN1_item_ex_d2i @ 0xfeb8a4 // > ASN1_item_ex_d2i @ 0xfeb8f8 // > ASN1_item_ex_d2i @ 0xfeb9c4 // > asn1_template_free @ 0xfece18 // > asn1_template_free @ 0xfecec4 // > asn1_template_free @ 0xfed018 // > asn1_template_free @ 0xfed098 // > asn1_template_free @ 0xfed100 // > asn1_template_free @ 0xfed218 // > asn1_template_free @ 0xfed2a4 // > asn1_template_free @ 0xfed328 // > ASN1_item_free @ 0xfed398 // > ASN1_item_free @ 0xfed508 // > ASN1_item_free @ 0xfed5b0 // > ASN1_item_free @ 0xfed644 // > ASN1_item_ex_free @ 0xfed790 // > ASN1_item_ex_free @ 0xfed830 // > ASN1_item_ex_free @ 0xfed8b4 // > ASN1_item_ex_free @ 0xfed940 // > @ 0x72fb8 // // 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:15:43 +0000 // __int64 __fastcall asn1_template_free(_QWORD *a1, __int64 *a2) { __int64 result; // x0 unsigned int v5; // s8 _QWORD *v6; // x22 int v7; // w20 bool v8; // cc _QWORD *v9; // x0 __int64 v10; // x0 unsigned __int8 *v11; // x19 __int64 v12; // x3 unsigned int v13; // w4 __int64 v14; // x0 unsigned int (__fastcall *v15)(__int64, __int64 *, unsigned __int8 *, _QWORD); // x27 __int64 v16; // x21 __int64 v17; // x0 __int64 v18; // x25 __int64 field_ptr; // x0 __int64 v20; // x26 __int64 v21; // x1 void (__fastcall *v22)(__int64 *, unsigned __int8 *); // x2 int choice_selector; // w0 __int64 v24; // x3 unsigned __int8 *v25; // x19 __int64 v26; // x1 void (__fastcall *v27)(__int64, _QWORD *, unsigned __int8 *, _QWORD); // x23 __int64 v28; // x21 __int64 v29; // x0 _QWORD *v30; // x0 __int64 v31; // x1 __int64 (__fastcall *v32)(_QWORD *, unsigned __int8 *); // x2 int v33; // w0 __int64 v34; // x0 __int64 v35; // x20 __int64 v36; // x22 __int64 v37; // x0 __int64 v38; // x21 __int64 v39; // x0 int v40; // w0 __int64 v41; // x19 __int64 v42; // x0 __int64 v43; // x0 __int64 v44; // x20 __int64 v45; // x0 _QWORD *v46; // [xsp+80h] [xbp+80h] BYREF __int64 v47; // [xsp+88h] [xbp+88h] BYREF result = *a2; v5 = *(_DWORD *)a2 & 0x1000; if ( v5 ) { v46 = a1; if ( (result & 6) != 0 ) { v6 = a1; a1 = &v46; goto LABEL_6; } v25 = (unsigned __int8 *)a2[4]; a1 = &v46; v26 = *((_QWORD *)v25 + 4); } else { if ( (result & 6) != 0 ) { v6 = (_QWORD *)*a1; LABEL_6: v7 = 0; v8 = (int)OPENSSL_sk_num(v6) > 0; v9 = v6; if ( !v8 ) { LABEL_20: result = OPENSSL_sk_free(v9); *a1 = 0; return result; } while ( 1 ) { v10 = OPENSSL_sk_value(v9, (unsigned int)v7); v11 = (unsigned __int8 *)a2[4]; v47 = v10; v12 = v10; v13 = *v11; v14 = *((_QWORD *)v11 + 4); if ( v12 || !*v11 ) { if ( v14 ) { v15 = *(unsigned int (__fastcall **)(__int64, __int64 *, unsigned __int8 *, _QWORD))(v14 + 24); if ( v15 ) { switch ( *v11 ) { case 0u: v21 = *((_QWORD *)v11 + 2); if ( !v21 ) goto LABEL_22; asn1_template_free(&v47, v21); ++v7; break; case 1u: case 6u: if ( !(unsigned int)asn1_do_lock(&v47, 0xFFFFFFFFLL, v11) && v15(2, &v47, v11, 0) != 2 ) { asn1_enc_free(&v47, v11); v24 = *((_QWORD *)v11 + 3); v16 = *((_QWORD *)v11 + 2) + 40 * v24; if ( v24 > 0 ) { v20 = 1; do { v16 -= 40; v17 = asn1_do_adb(&v47, v16, 0); v18 = v17; if ( v17 ) { field_ptr = asn1_get_field_ptr(&v47, v17); asn1_template_free(field_ptr, v18); } v8 = v20++ < *((_QWORD *)v11 + 3); } while ( v8 ); } v15(3, &v47, v11, 0); if ( !v5 ) CRYPTO_free(v47, "crypto/asn1/tasn_fre.c", 119); } goto LABEL_18; case 2u: if ( v15(2, &v47, v11, 0) == 2 ) goto LABEL_18; choice_selector = asn1_get_choice_selector(&v47, v11); if ( (choice_selector & 0x80000000) == 0 && choice_selector < *((_QWORD *)v11 + 3) ) { v28 = *((_QWORD *)v11 + 2) + 40LL * choice_selector; v29 = asn1_get_field_ptr(&v47, v28); asn1_template_free(v29, v28); } v15(3, &v47, v11, 0); if ( v5 ) goto LABEL_18; ++v7; CRYPTO_free(v47, "crypto/asn1/tasn_fre.c", 79); goto LABEL_19; case 4u: v22 = *(void (__fastcall **)(__int64 *, unsigned __int8 *))(v14 + 16); if ( !v22 ) goto LABEL_18; ++v7; v22(&v47, v11); goto LABEL_19; case 5u: LABEL_22: ++v7; asn1_primitive_free(&v47, (__int64)v11, v5); break; default: goto LABEL_18; } goto LABEL_19; } if ( v13 <= 6 ) __asm { BR X1 } } else if ( v13 <= 6 ) { __asm { BR X0 } } } LABEL_18: ++v7; LABEL_19: v8 = v7 < (int)OPENSSL_sk_num(v6); v9 = v6; if ( !v8 ) goto LABEL_20; } } v25 = (unsigned __int8 *)a2[4]; v26 = *((_QWORD *)v25 + 4); if ( !a1 ) return result; } result = *v25; if ( *v25 ) { if ( !*a1 ) return result; if ( v26 ) goto LABEL_45; result = (unsigned int)(result - 1); switch ( (int)result ) { case 0: case 5: v27 = nullptr; LABEL_79: result = asn1_do_lock(a1, 0xFFFFFFFFLL, v25); if ( !(_DWORD)result ) { asn1_enc_free(a1, v25); v43 = *((_QWORD *)v25 + 3); v35 = *((_QWORD *)v25 + 2) + 40 * v43; if ( v43 > 0 ) { LABEL_67: v36 = 1; do { v35 -= 40; v37 = asn1_do_adb(a1, v35, 0); v38 = v37; if ( v37 ) { v39 = asn1_get_field_ptr(a1, v37); asn1_template_free(v39, v38); } v8 = v36++ < *((_QWORD *)v25 + 3); } while ( v8 ); if ( v27 ) LABEL_72: v27(3, a1, v25, 0); } result = v5; if ( !v5 ) { result = CRYPTO_free(*a1, "crypto/asn1/tasn_fre.c", 119); *a1 = 0; } } break; case 1: LABEL_75: v40 = asn1_get_choice_selector(a1, v25); if ( (v40 & 0x80000000) == 0 && v40 < *((_QWORD *)v25 + 3) ) { v41 = *((_QWORD *)v25 + 2) + 40LL * v40; v42 = asn1_get_field_ptr(a1, v41); asn1_template_free(v42, v41); } LABEL_62: result = v5; if ( !v5 ) { result = CRYPTO_free(*a1, "crypto/asn1/tasn_fre.c", 79); *a1 = 0; } break; case 4: LABEL_51: v30 = a1; return asn1_primitive_free(v30, (__int64)v25, v5); default: return result; } } else { if ( v26 ) { LABEL_45: v27 = *(void (__fastcall **)(__int64, _QWORD *, unsigned __int8 *, _QWORD))(v26 + 24); if ( v27 ) { switch ( *v25 ) { case 0u: goto LABEL_53; case 1u: case 6u: result = asn1_do_lock(a1, 0xFFFFFFFFLL, v25); if ( (_DWORD)result ) return result; result = ((__int64 (__fastcall *)(__int64, _QWORD *, unsigned __int8 *, _QWORD))v27)(2, a1, v25, 0); if ( (_DWORD)result == 2 ) return result; asn1_enc_free(a1, v25); v34 = *((_QWORD *)v25 + 3); v35 = *((_QWORD *)v25 + 2) + 40 * v34; if ( v34 > 0 ) goto LABEL_67; goto LABEL_72; case 2u: result = ((__int64 (__fastcall *)(__int64, _QWORD *, unsigned __int8 *, _QWORD))v27)(2, a1, v25, 0); if ( (_DWORD)result == 2 ) return result; v33 = asn1_get_choice_selector(a1, v25); if ( (v33 & 0x80000000) == 0 && v33 < *((_QWORD *)v25 + 3) ) { v44 = *((_QWORD *)v25 + 2) + 40LL * v33; v45 = asn1_get_field_ptr(a1, v44); asn1_template_free(v45, v44); } v27(3, a1, v25, 0); goto LABEL_62; case 4u: goto LABEL_55; case 5u: goto LABEL_51; default: return result; } } switch ( *v25 ) { case 0u: goto LABEL_53; case 1u: case 6u: goto LABEL_79; case 2u: goto LABEL_75; case 4u: LABEL_55: v32 = *(__int64 (__fastcall **)(_QWORD *, unsigned __int8 *))(v26 + 16); if ( v32 ) result = v32(a1, v25); break; case 5u: goto LABEL_51; default: return result; } return result; } LABEL_53: v31 = *((_QWORD *)v25 + 2); v30 = a1; if ( v31 ) return asn1_template_free(a1, v31); else return asn1_primitive_free(v30, (__int64)v25, v5); } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source