//
// ASN1_INTEGER_set_uint64 from 0x1088d70 to 0x1088df4 (132 bytes)
//
// 4 xrefs:
// > PKCS5_pbe2_set_scrypt @ 0x10f0f64
// > PKCS5_pbe2_set_scrypt @ 0x10f0f74
// > PKCS5_pbe2_set_scrypt @ 0x10f0f84
// > ??> @ 0x61918
//
// 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:17:14 +0000
//
__int64 __fastcall ASN1_INTEGER_set_uint64(__int64 a1, unsigned __int64 a2)
{
__int64 v2; // x2
unsigned __int64 v4; // x4
__int64 i; // x3
char *v6; // x3
char v7[8]; // [xsp+18h] [xbp+18h] BYREF
*(_DWORD *)(a1 + 4) = 2;
if ( a2 <= 0xFF )
{
LODWORD(v2) = 1;
v7[0] = a2;
return (unsigned int)ASN1_STRING_set(a1, v7, v2);
}
v4 = a2;
for ( i = 0; ; ++i )
{
v4 >>= 8;
v2 = i + 1;
if ( !v4 )
break;
}
v6 = &v7[i];
do
{
*v6-- = a2;
a2 >>= 8;
}
while ( v6 >= v7 );
if ( v2 )
return (unsigned int)ASN1_STRING_set(a1, v7, v2);
return 0;
}