//
// ssl3_do_change_cipher_spec from 0x9a5144 to 0x9a527c (312 bytes)
//
// 2 xrefs:
// > tls_process_change_cipher_spec @ 0x9bb0c4
// > ??> @ 0x74b3c
//
// 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:06:50 +0000
//
int __fastcall ssl3_do_change_cipher_spec(_DWORD *a1)
{
int v1; // r3
int v2; // r1
int v4; // r0
int v5; // r1
int v6; // r2
int v7; // r5
int v9; // r2
int v10; // r12
int v11; // r3
int v12; // r0
int v13; // [sp+Ch] [bp-8h]
v1 = a1[26];
if ( a1[7] )
v2 = 33;
else
v2 = 17;
if ( !*(_DWORD *)(v1 + 564) )
{
v9 = a1[60];
if ( !v9 || !*(_DWORD *)(v9 + 4) )
{
ERR_put_error(20, 292, 133, "ssl/s3_msg.c", 27);
return 0;
}
v10 = *(_DWORD *)(v1 + 528);
v11 = *(_DWORD *)(a1[1] + 100);
*(_DWORD *)(v9 + 172) = v10;
v13 = v2;
v12 = (*(int (**)(void))(v11 + 8))();
v2 = v13;
if ( !v12 )
return 0;
}
if ( !(*(int (__fastcall **)(_DWORD *, int))(*(_DWORD *)(a1[1] + 100) + 16))(a1, v2) )
return 0;
v4 = *(_DWORD *)(a1[1] + 100);
if ( a1[7] )
{
v5 = *(_DWORD *)(v4 + 28);
v6 = *(_DWORD *)(v4 + 32);
}
else
{
v5 = *(_DWORD *)(v4 + 36);
v6 = *(_DWORD *)(v4 + 40);
}
v7 = (*(int (__fastcall **)(_DWORD *, int, int, int))(v4 + 20))(a1, v5, v6, a1[26] + 388);
if ( v7 )
{
*(_DWORD *)(a1[26] + 516) = v7;
return 1;
}
else
{
ERR_put_error(20, 292, 68, "ssl/s3_msg.c", 55);
return 0;
}
}