I did take a look at it and how it does decrypt the files.
The Filestructure of the pkg it self is more or less already known so I don't go into that.
As for the decrypting (only works on files generated with make_package_npdrm).
Code:
// some pseudo code
// everything in big endian
char key[16]; // from offset 0x60-0x6f
char buffer[64];
uint64 data_size; // offset 0x28
buffer[00..07] = key[00..07];
buffer[08..15] = key[00..07];
buffer[16..23] = key[8..15];
buffer[24..31] = key[8..15];
buffer[32..59] = 0;
char data[data_size];
char hash[20];
for(uint32 offset = 0; offset < data_size; offset += 16)
{
buffer[60..63] = offset / 16; // zero indexed number of the row to decrypt
hash = sha1(buffer);
// xor the first 16 Bytes of the Hash with the row
data[(0..15) + offset] ^= hash[0..15];
}; To put it in words, it takes a key, adds a row number and uses the sha1 hash of it to decrpyt the data.
I didn't look to much into it but it does compute the sha1 hash of the header and stuff as well, didn't look to much into which part of the header exactly was used though.
Still the problem is make_package_npdrm can't decrypt non-dev packages.
BTW: I'm sure I'm not the first one finding it, but as nobody mentioned it so far.
Code:
make_package_npdrm --informal-help