// // X509v3_addr_canonize from 0xa63a8c to 0xa64170 (1764 bytes) // // 2 xrefs: // > sub_A64180 @ 0xa64334 // > @ 0x8223c // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // 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 12:08:35 +0000 // int __fastcall X509v3_addr_canonize(_DWORD *a1) { signed int i; // r8 _DWORD *v3; // r0 int *v4; // r3 int v5; // r4 int *v6; // r6 _DWORD *afi; // r0 size_t v8; // r5 signed int v9; // r7 int *v10; // r11 int v11; // r3 int v12; // r3 int v13; // r3 int v14; // r3 int v15; // r3 int v16; // r3 int v17; // r3 int v18; // r3 int v19; // r3 int v20; // r3 int v21; // r3 int v22; // r3 int v23; // r3 int v24; // r3 int v25; // r3 int v26; // r2 int v27; // r0 int v29; // r0 int *v30; // r0 int *v31; // [sp+8h] [bp-B4h] int v32; // [sp+Ch] [bp-B0h] int v33; // [sp+10h] [bp-ACh] int v34; // [sp+14h] [bp-A8h] int v35; // [sp+18h] [bp-A4h] int v36; // [sp+1Ch] [bp-A0h] int v37; // [sp+20h] [bp-9Ch] int v38; // [sp+24h] [bp-98h] int v39; // [sp+28h] [bp-94h] int v40; // [sp+2Ch] [bp-90h] int v41; // [sp+30h] [bp-8Ch] int v42; // [sp+34h] [bp-88h] int v43; // [sp+38h] [bp-84h] int v44; // [sp+3Ch] [bp-80h] int v45; // [sp+40h] [bp-7Ch] unsigned __int8 *v46; // [sp+48h] [bp-74h] unsigned __int8 *v47; // [sp+4Ch] [bp-70h] unsigned __int8 *v48; // [sp+50h] [bp-6Ch] unsigned __int8 *v49; // [sp+54h] [bp-68h] unsigned __int8 *v50; // [sp+58h] [bp-64h] unsigned __int8 *v51; // [sp+5Ch] [bp-60h] int v52; // [sp+60h] [bp-5Ch] _DWORD *v53; // [sp+6Ch] [bp-50h] int v54; // [sp+74h] [bp-48h] BYREF unsigned __int8 v55[16]; // [sp+78h] [bp-44h] BYREF char v56[16]; // [sp+88h] [bp-34h] BYREF char v57[16]; // [sp+98h] [bp-24h] BYREF unsigned __int8 v58[20]; // [sp+A8h] [bp-14h] BYREF for ( i = 0; i < OPENSSL_sk_num((int)a1); ++i ) { v3 = (_DWORD *)OPENSSL_sk_value(a1, i); v4 = (int *)v3[1]; v5 = *v4; if ( *v4 != 1 ) continue; v6 = (int *)v4[1]; afi = X509v3_addr_get_afi(v3); if ( afi == (int *)((char *)&dword_0 + 1) ) { v40 = -11; v39 = -10; v38 = -9; v37 = -8; v36 = -7; v35 = -6; v34 = -5; v33 = -4; v32 = -3; v43 = -2; v42 = -1; v41 = 0; v8 = 4; v44 = 2; v52 = 4; v45 = 3; } else if ( afi == (int *)((char *)&dword_0 + 2) ) { v38 = 3; v37 = 4; v36 = 5; v35 = 6; v34 = 7; v33 = 8; v32 = 9; v43 = 10; v42 = 11; v41 = 12; v8 = 16; v40 = 1; v44 = 14; v5 = 13; v39 = 2; v52 = 16; v45 = 15; } else { v40 = -15; v39 = -14; v38 = -13; v37 = -12; v36 = -11; v35 = -10; v34 = -9; v33 = -8; v32 = -7; v43 = -6; v42 = -5; v41 = -4; v8 = 0; v44 = -2; v52 = 0; v5 = -3; v45 = -1; } OPENSSL_sk_sort((int)v6); v46 = &v58[v45 + 16]; v47 = &v58[v44 + 16]; v48 = &v58[v5 + 16]; v49 = &v58[v41 + 16]; v50 = &v58[v42 + 16]; v9 = 0; v51 = &v58[v43 + 16]; v53 = a1; while ( v9 < OPENSSL_sk_num((int)v6) - 1 ) { v10 = (int *)OPENSSL_sk_value(v6, v9); v31 = (int *)OPENSSL_sk_value(v6, v9 + 1); if ( !sub_A61B28(v10, (char *)v55, v56, v52) || !sub_A61B28(v31, v57, (char *)v58, v52) || memcmp(v55, v56, v8) > 0 || memcmp(v57, v58, v8) > 0 || memcmp(v56, v57, v8) >= 0 ) { return 0; } if ( v45 == -1 ) goto LABEL_48; v11 = *(v46 - 32); *(v46 - 32) = v11 - 1; if ( v11 ) goto LABEL_68; if ( v44 < 0 ) goto LABEL_68; v12 = *(v47 - 32); *(v47 - 32) = v12 - 1; if ( v12 ) goto LABEL_68; if ( v5 < 0 ) goto LABEL_68; v13 = *(v48 - 32); *(v48 - 32) = v13 - 1; if ( v13 ) goto LABEL_68; if ( v41 < 0 ) goto LABEL_68; v14 = *(v49 - 32); *(v49 - 32) = v14 - 1; if ( v14 ) goto LABEL_68; if ( v42 < 0 ) goto LABEL_68; v15 = *(v50 - 32); *(v50 - 32) = v15 - 1; if ( v15 ) goto LABEL_68; if ( v43 < 0 ) goto LABEL_68; v16 = *(v51 - 32); *(v51 - 32) = v16 - 1; if ( v16 ) goto LABEL_68; if ( v32 < 0 ) goto LABEL_68; v17 = (unsigned __int8)v57[v32]; v57[v32] = v17 - 1; if ( v17 ) goto LABEL_68; if ( v33 < 0 ) goto LABEL_68; v18 = (unsigned __int8)v57[v33]; v57[v33] = v18 - 1; if ( v18 ) goto LABEL_68; if ( v34 < 0 ) goto LABEL_68; v19 = (unsigned __int8)v57[v34]; v57[v34] = v19 - 1; if ( v19 ) goto LABEL_68; if ( v35 < 0 ) goto LABEL_68; v20 = (unsigned __int8)v57[v35]; v57[v35] = v20 - 1; if ( v20 ) goto LABEL_68; if ( v36 < 0 ) goto LABEL_68; v21 = (unsigned __int8)v57[v36]; v57[v36] = v21 - 1; if ( v21 ) goto LABEL_68; if ( v37 < 0 ) goto LABEL_68; v22 = (unsigned __int8)v57[v37]; v57[v37] = v22 - 1; if ( v22 || v38 < 0 || (v23 = (unsigned __int8)v57[v38], v57[v38] = v23 - 1, v23) || v39 < 0 || (v24 = (unsigned __int8)v57[v39], v57[v39] = v24 - 1, v24) || v40 < 0 || (v25 = (unsigned __int8)v57[v40], v57[v40] = v25 - 1, v25) || v52 != 16 ) { LABEL_68: if ( !memcmp(v56, v57, v8) ) goto LABEL_50; LABEL_48: ++v9; } else { --v57[0]; if ( memcmp(v56, v57, v8) ) goto LABEL_48; LABEL_50: v26 = sub_A6143C(v55, v58, v52); if ( v26 < 0 ) v27 = sub_A62760(&v54, (int)v55, (int)v58, v52); else v27 = sub_A62688(&v54, (int)v55, v26); if ( !v27 ) return 0; OPENSSL_sk_set(v6, v9, v54); OPENSSL_sk_delete(v6, v9 + 1); IPAddressOrRange_free(v10); IPAddressOrRange_free(v31); } } a1 = v53; v29 = OPENSSL_sk_num((int)v6); v30 = (int *)OPENSSL_sk_value(v6, v29 - 1); if ( v30 && *v30 == 1 && (!sub_A61B28(v30, v57, (char *)v58, v52) || memcmp(v57, v58, v8) > 0) ) return 0; } OPENSSL_sk_set_cmp_func((int)a1, (int)sub_A615C8); OPENSSL_sk_sort((int)a1); if ( !X509v3_addr_is_canonical(a1) ) OPENSSL_die("assertion failed: X509v3_addr_is_canonical(addr)", "crypto/x509v3/v3_addr.c", 878); return 1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source