Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ArcFormats/ImagePNX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class PnxFormat : PngFormat
{
public override string Tag { get { return "PNX"; } }
public override string Description { get { return "Encrypted PNG image"; } }
public override uint Signature { get { return 0x2F2638E1; } }
public override uint Signature { get { return 0; } }
public override bool CanWrite { get { return false; } }

public override ImageMetaData ReadMetaData (IBinaryStream file)
Expand Down
18 changes: 18 additions & 0 deletions ArcFormats/KiriKiri/CryptAlgorithms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,4 +1671,22 @@ private byte[] InitKey(uint hash)
}
}

[Serializable]
public class HoneyCombCrypt : ICrypt
{
public override void Decrypt(Xp3Entry entry, long offset, byte[] buffer, int pos, int count)
{
uint seed = entry.Hash ^ 0xABCD9876;
byte key = (byte)((seed >> 24) ^ (seed >> 16) ^ (seed >> 8) ^ seed);
if (key == 0)
key = 0xA5;
for (int i = 0; i < count; ++i)
buffer[pos + i] ^= key;
}

public override void Encrypt(Xp3Entry entry, long offset, byte[] values, int pos, int count)
{
Decrypt(entry, offset, values, pos, count);
}
}
}
Loading