//
// -[NSData makeCryptedVersionWithKeyData:ofLength:decrypt:] from 0x1002ee5f8 to 0x1002ee7d8 (480 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009ce3d0
//
// 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 11:02:54 +0000
//
id __cdecl -[NSData makeCryptedVersionWithKeyData:ofLength:decrypt:](
NSData *self,
SEL a2,
const void *a3,
int a4,
bool a5)
{
CCOperation v5; // w19
int v7; // w8
char *dataOutAvailable; // x22
void *dataOut; // x20
CCCryptorStatus v10; // w0
__CFString *v11; // x0
const char *v13; // x8
size_t v14; // [xsp+18h] [xbp-68h] BYREF
_OWORD key[2]; // [xsp+20h] [xbp-60h] BYREF
v5 = a5;
memset(key, 0, sizeof(key));
if ( a4 >= 32 )
v7 = 32;
else
v7 = a4;
__memcpy_chk(key, a3, v7, 32);
dataOutAvailable = (char *)-[NSData length](self, "length") + 16;
dataOut = malloc((size_t)dataOutAvailable);
v10 = CCCrypt(
v5,
0,
3u,
key,
0x20u,
nullptr,
-[NSData bytes](self, "bytes"),
-[NSData length](self, "length"),
dataOut,
(size_t)dataOutAvailable,
&v14);
if ( v10 <= -4303 )
{
switch ( v10 )
{
case -4305:
v11 = CFSTR("Error: NSData: Could not %s data: Unimplemented");
goto LABEL_20;
case -4304:
v11 = CFSTR("Error: NSData: Could not %s data: Decode error");
goto LABEL_20;
case -4303:
v11 = CFSTR("Error: NSData: Could not %s data: Alignment error");
goto LABEL_20;
}
LABEL_16:
v11 = CFSTR("Error: NSData: Could not %s data: Unknown error");
goto LABEL_20;
}
if ( v10 > -4301 )
{
if ( v10 == -4300 )
{
v11 = CFSTR("Error: NSData: Could not %s data: Param error");
goto LABEL_20;
}
if ( !v10 )
return +[NSData dataWithBytesNoCopy:length:](&OBJC_CLASS___NSData, "dataWithBytesNoCopy:length:", dataOut, v14);
goto LABEL_16;
}
if ( v10 == -4302 )
v11 = CFSTR("Error: NSData: Could not %s data: Memory failure");
else
v11 = CFSTR("Error: NSData: Could not %s data: Buffer too small");
LABEL_20:
v13 = "encrypt";
if ( v5 )
v13 = "decrypt";
NSLog(&v11->isa, v13);
free(dataOut);
return nullptr;
}