//
// sub_1054B98 from 0x1054b98 to 0x1054cac (276 bytes)
//
// 1 xrefs:
// > ??> @ 0x140df48
//
// 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:40 +0000
//
__int64 __fastcall sub_1054B98(__int64 a1, __int64 a2)
{
_DWORD *v4; // x0
_DWORD *v5; // x19
__int64 v6; // x20
__int64 v7; // x0
unsigned __int64 *v8; // x0
__int64 v9; // x2
__int64 v10; // x1
__int64 v11; // x0
void *v12; // x0
v4 = CRYPTO_zalloc(off_50, (__int64)"crypto/rsa/rsa_pmeth.c", 48);
v5 = v4;
if ( !v4 )
return 0;
*v4 = 1024;
v4[12] = -2;
v4[6] = 1;
*(_QWORD *)(a1 + 40) = v4;
*(_QWORD *)(a1 + 64) = v4 + 4;
v6 = *(_QWORD *)(a2 + 40);
*(_DWORD *)(a1 + 72) = 2;
v7 = *(_QWORD *)(v6 + 8);
*v5 = *(_DWORD *)v6;
if ( v7 )
{
v8 = BN_dup(v7);
*((_QWORD *)v5 + 1) = v8;
if ( !v8 )
return 0;
}
v9 = *(_QWORD *)(v6 + 32);
v10 = *(_QWORD *)(v6 + 40);
v11 = *(_QWORD *)(v6 + 64);
v5[6] = *(_DWORD *)(v6 + 24);
*((_QWORD *)v5 + 4) = v9;
*((_QWORD *)v5 + 5) = v10;
if ( v11 )
{
CRYPTO_free(*((void **)v5 + 8), (__int64)"crypto/rsa/rsa_pmeth.c", 78);
v12 = CRYPTO_memdup(*(const void **)(v6 + 64), *(void **)(v6 + 72), (__int64)"crypto/rsa/rsa_pmeth.c", 0x4Fu);
*((_QWORD *)v5 + 8) = v12;
if ( v12 )
{
*((_QWORD *)v5 + 9) = *(_QWORD *)(v6 + 72);
return 1;
}
return 0;
}
return 1;
}