Hi.
Long time lurker, first time poster.
After seeing
coyotebean's references to Kirk4, Kirk7 and Kirk1 functions calling 0x1e40, 0x1cd0 and 0x24d0 in the SPU disasm, I've been looking for other similar functions that could be calling these handlers. Here're my findings so far:
Code: Select all
// Encrypt
ENCRYPT_CBC(0x0003F000, 0x0003E000, 4096, unkkey, 128, stack + 784 + 32);
ENCRYPT_CBC(0x0003F000, 0x0003E000, calcsize, stack + 768, 128, stack + 784 + 32);
ENCRYPT_CBC(stack + 1792 + 32, stack + 1648 + 32, 32, 59312, 128, stack + 1616 + 32);
HMAC(stack + 1824 + 32, stack + 1648 + 96, 48, stack + 1792 + 16, 128);
// Decrypt
DECRYPT_CBC(0x0003F000, 0x0003E000, 4096, stack + 1792 + 32 + 16, 128, stack + 1616 + 32);
DECRYPT_CBC(0x0003F000, 0x0003E000, calcsize, stack + 1792 + 32 + 16, 128, stack + 1616 + 32);
DECRYPT_CBC(0x0003F000, 0x0003E000, 4096, stack + 1792 + 32, 128, stack + 1616 + 32);
DECRYPT_CBC(0x0003F000, 0x0003E000, calcsize, stack + 1792 + 32, 128, stack + 1616 + 32);
HMAC(stack + 1824 + 32, 0x0003E000, 16, stack + 1792 + 32 + 16, 128);
I'm assuming DECRYPT/ENCRYPT_CBC(outbuf, inbuf, insize, key, bits, iv) and HMAC(outbuf, inbuf, insize, key, bits) just for conveniece, as these can mean something completely different.
Most of the params are obtained from the stack and some of them, like unkkey and calcsize, result from several rot and xor operations.
EDIT: By the way, in the posted PSPHEADER struct, is the decryptMode supposed to match the last param passed to sceUtilsBufferCopyWithRange, or is it something else? I've noticed this parameter is mostly 09 in post 2.00 FW, UMD signed EBOOT's, but I've also came across another PSPHEADER struct (with less params), prior to 2.00 FW, that, as decryptMode, can also accept encrypt modes (4 and 6, so far).