// // policy_cache_set from 0xdf2ee8 to 0xdf31fc (788 bytes) // // 5 xrefs: // > X509_policy_check @ 0xdf36ec // > X509_policy_check @ 0xdf3724 // > X509_policy_check @ 0xdf3804 // > X509_policy_check @ 0xdf3f04 // > @ 0xa0410 // // 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 policy_cache_set(__int64 a1) { _QWORD *v3; // x0 _QWORD *v4; // x21 _QWORD *ext_d2i; // x0 _QWORD *v6; // x20 __int64 v7; // x0 __int64 v8; // x0 __int64 v9; // x1 unsigned int *v10; // x0 int *v11; // x25 __int64 v12; // x26 __int64 v13; // x22 __int64 v14; // x0 _QWORD *v15; // x0 int v16; // w24 __int64 v17; // x0 __int64 v18; // x0 __int64 v19; // x22 __int64 v20; // x0 __int64 v21; // x0 unsigned int v22; // [xsp+6Ch] [xbp+6Ch] int v23; // [xsp+6Ch] [xbp+6Ch] if ( *(_QWORD *)(a1 + 240) ) return *(_QWORD *)(a1 + 240); CRYPTO_THREAD_write_lock(*(pthread_rwlock_t **)(a1 + 320)); if ( *(_QWORD *)(a1 + 240) ) goto LABEL_4; v3 = CRYPTO_malloc(&qword_28, (__int64)"crypto/x509v3/pcy_cache.c", 84); v4 = v3; if ( !v3 ) goto LABEL_4; *v3 = 0; v3[1] = 0; v3[2] = -1; v3[3] = -1; v3[4] = -1; *(_QWORD *)(a1 + 240) = v3; ext_d2i = (_QWORD *)X509_get_ext_d2i(a1); v6 = ext_d2i; if ( !ext_d2i ) { if ( v22 != -1 ) goto LABEL_26; goto LABEL_12; } v7 = *ext_d2i; if ( !v7 ) { v9 = v6[1]; if ( !v9 ) goto LABEL_26; goto LABEL_10; } if ( *(_DWORD *)(v7 + 4) == 258 ) goto LABEL_26; v8 = ASN1_INTEGER_get(v7); v9 = v6[1]; v4[3] = v8; if ( v9 ) { LABEL_10: if ( *(_DWORD *)(v9 + 4) == 258 ) goto LABEL_26; v4[4] = ASN1_INTEGER_get(v9); } LABEL_12: v10 = (unsigned int *)X509_get_ext_d2i(a1); v11 = (int *)v10; if ( v10 ) { v12 = *(_QWORD *)(a1 + 240); if ( !(unsigned int)OPENSSL_sk_num(v10) || (v15 = OPENSSL_sk_new((__int64)sub_DF2E80), (*(_QWORD *)(v12 + 8) = v15) == 0) ) { LABEL_14: v13 = 0; LABEL_15: v14 = v13; LABEL_16: policy_data_free(v14); OPENSSL_sk_pop_free(v11, (void (__fastcall *)(__int64))POLICYINFO_free); OPENSSL_sk_pop_free(*(int **)(v12 + 8), (void (__fastcall *)(__int64))policy_data_free); *(_QWORD *)(v12 + 8) = 0; goto LABEL_4; } v16 = 0; while ( v16 < (int)OPENSSL_sk_num((unsigned int *)v11) ) { v17 = OPENSSL_sk_value((__int64)v11, v16); v18 = policy_data_new(v17, 0, v22); v13 = v18; if ( !v18 ) goto LABEL_14; if ( (unsigned int)OBJ_obj2nid(*(_QWORD *)(v18 + 8)) == 746 ) { if ( *(_QWORD *)v12 ) goto LABEL_41; *(_QWORD *)v12 = v13; ++v16; } else { if ( (unsigned int)OPENSSL_sk_find(*(_QWORD *)(v12 + 8), v13) != -1 ) { LABEL_41: v14 = v13; *(_DWORD *)(a1 + 208) |= 0x800u; goto LABEL_16; } if ( !(unsigned int)OPENSSL_sk_push(*(int **)(v12 + 8), v13) ) goto LABEL_15; ++v16; } } policy_data_free(0); OPENSSL_sk_pop_free(v11, (void (__fastcall *)(__int64))POLICYINFO_free); v20 = X509_get_ext_d2i(a1); if ( v20 ) { v23 = policy_cache_set_mapping(a1, v20); if ( v23 > 0 ) { v21 = X509_get_ext_d2i(a1); v19 = v21; if ( v21 ) { if ( *(_DWORD *)(v21 + 4) == 258 ) goto LABEL_27; v4[2] = ASN1_INTEGER_get(v21); LABEL_28: POLICY_CONSTRAINTS_free(v6); ASN1_INTEGER_free(v19); goto LABEL_4; } } } LABEL_26: v19 = 0; LABEL_27: *(_DWORD *)(a1 + 208) |= 0x800u; goto LABEL_28; } if ( v22 != -1 ) goto LABEL_26; LABEL_4: CRYPTO_THREAD_unlock(*(pthread_rwlock_t **)(a1 + 320)); return *(_QWORD *)(a1 + 240); }
GD Web Decomp Icon

GD Web Decomp

Raw Source