// // CRYPTO_secure_free from 0x1034e00 to 0x10353f8 (1528 bytes) // // 9 xrefs: // > BN_free @ 0xff8f18 // > BN_clear_free @ 0xff8fd8 // > bn_expand2 @ 0xff91c8 // > BUF_MEM_free @ 0xffdc54 // > BUF_MEM_grow @ 0xffdd78 // > BUF_MEM_grow_clean @ 0xffded4 // > sub_101970C @ 0x1019730 // > sub_1019F3C @ 0x101a008 // > @ 0xd2838 // // 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:16:23 +0000 // void __fastcall CRYPTO_secure_free(unsigned __int64 a1, __int64 a2, __int64 a3) { unsigned __int64 v3; // x19 unsigned __int64 v4; // x21 unsigned __int64 v5; // x0 __int64 v6; // x3 __int64 v7; // x5 int v8; // w23 unsigned __int64 v9; // x4 __int64 v10; // x22 unsigned __int64 *v11; // x0 __int64 v12; // x22 unsigned __int64 v13; // x20 unsigned __int64 *v14; // x25 unsigned __int64 v15; // x5 unsigned __int64 v16; // x5 __int64 v17; // x0 unsigned __int64 v18; // x0 __int64 v19; // x2 __int64 v20; // x1 unsigned __int64 v21; // x2 __int64 v22; // x0 __int64 v23; // x0 unsigned __int64 v24; // x0 unsigned __int64 v25; // x2 __int64 v26; // x28 __int64 v27; // x26 unsigned __int64 v28; // x4 unsigned __int64 v29; // x3 unsigned __int64 v30; // x6 v3 = a1; if ( a1 ) { if ( CRYPTO_secure_allocated(a1) ) { CRYPTO_THREAD_write_lock(qword_1567F60); v4 = sub_1034208(v3); OPENSSL_cleanse((_BYTE *)v3, v4); qword_1567F68 -= v4; if ( v3 < qword_1567F18 || v3 >= qword_1567F18 + qword_1567F20 ) OPENSSL_die("assertion failed: WITHIN_ARENA(ptr)", "crypto/mem_sec.c", 538); v5 = (v3 + qword_1567F20 - qword_1567F18) / qword_1567F38; v6 = qword_1567F30 - 1; if ( v5 ) { v7 = qword_1567F40; if ( ((*(unsigned __int8 *)(qword_1567F40 + (v5 >> 3)) >> (v5 & 7)) & 1) == 0 ) { do { if ( (v5 & 1) != 0 ) OPENSSL_die("assertion failed: (bit & 1) == 0", "crypto/mem_sec.c", 259); v5 >>= 1; --v6; } while ( v5 && ((*(unsigned __int8 *)(qword_1567F40 + (v5 >> 3)) >> (v5 & 7)) & 1) == 0 ); } } else { v7 = qword_1567F40; } v8 = v6; if ( (v6 & 0x80000000) != 0 || qword_1567F30 <= (int)v6 ) LABEL_66: OPENSSL_die("assertion failed: list >= 0 && list < sh.freelist_size", "crypto/mem_sec.c", 270); if ( ((((unsigned __int64)qword_1567F20 >> v6) - 1) & (v3 - qword_1567F18)) != 0 ) LABEL_69: sub_632B7C(); v9 = (v3 - qword_1567F18) / ((unsigned __int64)qword_1567F20 >> v6) + (1LL << v6); if ( !v9 || v9 >= qword_1567F50 ) LABEL_67: OPENSSL_die("assertion failed: bit > 0 && bit < sh.bittable_size", "crypto/mem_sec.c", 273); if ( (*(unsigned __int8 *)(v7 + (v9 >> 3)) & (unsigned int)(1LL << (v9 & 7))) == 0 ) OPENSSL_die("assertion failed: sh_testbit(ptr, list, sh.bittable)", "crypto/mem_sec.c", 543); v10 = 8 * v6; sub_1034120(v3, v6, qword_1567F48); v11 = (unsigned __int64 *)(qword_1567F28 + v10); v12 = v10 - 8; sub_103402C(v11, (unsigned __int64 *)v3); while ( 1 ) { v26 = 1LL << v8; v27 = qword_1567F18; v28 = (unsigned __int64)qword_1567F20 >> v8; v29 = (v3 - qword_1567F18) / ((unsigned __int64)qword_1567F20 >> v8) + (1LL << v8); v30 = (v29 ^ 1) >> 3; if ( ((*(unsigned __int8 *)(qword_1567F40 + v30) >> ((v29 ^ 1) & 7)) & 1) == 0 ) break; if ( ((*(unsigned __int8 *)(qword_1567F48 + v30) >> ((v29 ^ 1) & 7)) & 1) != 0 ) break; v13 = ((v29 ^ 1) & (v26 - 1)) * v28; v14 = (unsigned __int64 *)(qword_1567F18 + v13); if ( !(qword_1567F18 + v13) ) break; v15 = (v13 / v28 + v26) ^ 1; if ( ((*(unsigned __int8 *)(qword_1567F40 + (v15 >> 3)) >> (v15 & 7)) & 1) != 0 ) { if ( ((*(unsigned __int8 *)(qword_1567F48 + (v15 >> 3)) >> (v15 & 7)) & 1) != 0 ) v16 = (*(unsigned __int8 *)(qword_1567F48 + v30) >> ((v29 ^ 1) & 7)) & 1LL; else v16 = qword_1567F18 + (v15 & (v26 - 1)) * v28; } else { v16 = (*(unsigned __int8 *)(qword_1567F40 + (v15 >> 3)) >> (v15 & 7)) & 1LL; } if ( v3 != v16 ) OPENSSL_die("assertion failed: ptr == sh_find_my_buddy(buddy, list)", "crypto/mem_sec.c", 549); if ( !v3 ) OPENSSL_die("assertion failed: ptr != NULL", "crypto/mem_sec.c", 550); if ( v8 < 0 || v8 >= qword_1567F30 ) goto LABEL_66; if ( ((v28 - 1) & (v3 - qword_1567F18)) != 0 ) goto LABEL_69; if ( !v29 || qword_1567F50 <= v29 ) goto LABEL_67; if ( (*(unsigned __int8 *)(qword_1567F48 + (v29 >> 3)) & (unsigned int)(1LL << (v29 & 7))) != 0 ) OPENSSL_die("assertion failed: !sh_testbit(ptr, list, sh.bitmalloc)", "crypto/mem_sec.c", 551); sub_1034120(v3, v8, qword_1567F40); v17 = *(_QWORD *)v3; if ( *(_QWORD *)v3 ) *(_QWORD *)(v17 + 8) = *(_QWORD *)(v3 + 8); **(_QWORD **)(v3 + 8) = v17; if ( *(_QWORD *)v3 ) { v18 = *(_QWORD *)(*(_QWORD *)v3 + 8LL); if ( v18 < qword_1567F28 || (v19 = qword_1567F30, v18 >= qword_1567F28 + 8 * qword_1567F30) ) { if ( v18 < qword_1567F18 || v18 >= qword_1567F18 + qword_1567F20 ) goto LABEL_70; v19 = qword_1567F30; } v20 = qword_1567F48; } else { v20 = qword_1567F48; v19 = qword_1567F30; } if ( v8 >= v19 ) goto LABEL_66; if ( ((((unsigned __int64)qword_1567F20 >> v8) - 1) & (v3 - qword_1567F18)) != 0 ) goto LABEL_69; v21 = (v3 - qword_1567F18) / ((unsigned __int64)qword_1567F20 >> v8) + v26; if ( !v21 || v21 >= qword_1567F50 ) goto LABEL_67; if ( (*(unsigned __int8 *)(v20 + (v21 >> 3)) & (unsigned int)(1LL << (v21 & 7))) != 0 ) OPENSSL_die("assertion failed: !sh_testbit(ptr, list, sh.bitmalloc)", "crypto/mem_sec.c", 554); sub_1034120(v27 + v13, v8, qword_1567F40); v22 = *(_QWORD *)(v27 + v13); if ( v22 ) *(_QWORD *)(v22 + 8) = v14[1]; *(_QWORD *)v14[1] = v22; v23 = *(_QWORD *)(v27 + v13); if ( v23 ) { v24 = *(_QWORD *)(v23 + 8); if ( (v24 < qword_1567F28 || v24 >= qword_1567F28 + 8 * qword_1567F30) && (v24 < qword_1567F18 || v24 >= qword_1567F18 + qword_1567F20) ) { LABEL_70: sub_632B9C(); } } --v8; if ( (unsigned __int64)v14 > v3 ) v14 = (unsigned __int64 *)v3; if ( v8 < 0 || qword_1567F30 <= v8 ) goto LABEL_66; if ( (((unsigned __int64)v14 - qword_1567F18) & (((unsigned __int64)qword_1567F20 >> v8) - 1)) != 0 ) goto LABEL_69; v25 = ((unsigned __int64)v14 - qword_1567F18) / ((unsigned __int64)qword_1567F20 >> v8) + (1LL << v8); if ( !v25 || v25 >= qword_1567F50 ) goto LABEL_67; if ( (*(unsigned __int8 *)(qword_1567F48 + (v25 >> 3)) & (unsigned int)(1LL << (v25 & 7))) != 0 ) OPENSSL_die("assertion failed: !sh_testbit(ptr, list, sh.bitmalloc)", "crypto/mem_sec.c", 563); sub_1033F44((__int64)v14, v8, qword_1567F40); sub_103402C((unsigned __int64 *)(qword_1567F28 + v12), v14); v3 = *(_QWORD *)(qword_1567F28 + v12); v12 -= 8; if ( (unsigned __int64 *)v3 != v14 ) OPENSSL_die("assertion failed: sh.freelist[list] == ptr", "crypto/mem_sec.c", 566); } CRYPTO_THREAD_unlock(qword_1567F60); } else { CRYPTO_free((void *)v3, a2, a3); } } }
GD Web Decomp Icon

GD Web Decomp

Raw Source