// // BN_gcd from 0xe1856c to 0xe1872c (448 bytes) // // 3 xrefs: // > RSA_generate_key_ex @ 0xe6aaac // > RSA_generate_key_ex @ 0xe6ac18 // > @ 0x859c8 // // 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 // bool __fastcall BN_gcd(unsigned __int64 *a1, __int64 a2, __int64 a3, int32x2_t *a4) { __int64 v7; // x20 __int64 v8; // x19 int v9; // w22 __int64 v10; // x0 __int64 v12; // x0 _BOOL4 v13; // w19 BN_CTX_start((unsigned __int64)a4); v7 = BN_CTX_get(a4); v8 = BN_CTX_get(a4); if ( !v8 || !v7 || !BN_copy((unsigned __int64 *)v7, a2) || !BN_copy((unsigned __int64 *)v8, a3) ) { LABEL_16: BN_CTX_end((__int64)a4); return 0; } *(_DWORD *)(v7 + 16) = 0; *(_DWORD *)(v8 + 16) = 0; if ( (BN_cmp((__int64 *)v7, (__int64 *)v8) & 0x80000000) != 0 ) { v12 = v7; v7 = v8; v8 = v12; } v9 = 0; while ( !BN_is_zero(v8) ) { if ( (unsigned int)BN_is_odd(v7) ) { if ( (unsigned int)BN_is_odd(v8) ) { if ( !(unsigned int)BN_sub(v7, v7, v8) ) goto LABEL_16; LABEL_12: if ( !(unsigned int)BN_rshift1(v7, v7) ) goto LABEL_16; goto LABEL_13; } if ( !(unsigned int)BN_rshift1(v8, v8) ) goto LABEL_16; LABEL_13: if ( (BN_cmp((__int64 *)v7, (__int64 *)v8) & 0x80000000) != 0 ) { v10 = v7; v7 = v8; v8 = v10; } } else { if ( (unsigned int)BN_is_odd(v8) ) goto LABEL_12; if ( !(unsigned int)BN_rshift1(v7, v7) || !(unsigned int)BN_rshift1(v8, v8) ) goto LABEL_16; ++v9; } } if ( v9 && !(unsigned int)BN_lshift(v7, (__int64 *)v7, v9) ) goto LABEL_16; v13 = BN_copy(a1, v7) != nullptr; BN_CTX_end((__int64)a4); return v13; }
GD Web Decomp Icon

GD Web Decomp

Raw Source