On 1.76, act.dat is loaded and updated by the SceShellCore process.
Beyond 1.76, act.dat is loaded and updated directly by the kernel.
A HMACSHA256 of the entire act.dat file using the SHA256 of the OpenPsId as the key is stored in Vtrm using SceShellCore's authority-id (0x3800000000000010) in slot 0.
hmacsha256(sha256(sceKernelGetOpenPsIdForSystem()), act.dat) (pseudo-code)
sceSblVtrmStoreNth(0x3800000000000010, hmac, 64, 0)
sceSblVtrmRetrieveNth(0x3800000000000010, hmac, 64, 0)
Note: sceSblVtrm* are kernel functions.
This prevents easily adding or replacing the act.dat file directly. You will need to update this HMAC to prevent the act.dat file from being deleted when adding or replacing it.
An act.dat file is made up of 1 to 21 sequential activation structures.
The file is truncated to valid activation structures, so its size will be a multiple of 512.
Activation structure on 1.76
Fields are big-endian.
||2 or 3|
|PSN Account ID||
||Start timestamp (unix/epoch)|
||End timestamp (unix/epoch), typically INT64_MAX|
|DeviceId (OpenPsId SHA256 Hash)||
||32||-||Found to match exactly for different users and consoles. Maybe system version SHA256 hash?|
|RIF Secret Encryption IV||
|RIF Secret Encryption Key Seed||
||16||-||Used to decrypt rif secret (KDS RIF only)|
||256||-||Verified using same public key as RIF type 0|