Add PoringSoftCrypt (tested game: https://vndb.org/v532 )

Add force decrypt option
This commit is contained in:
2026-04-09 13:47:20 +08:00
parent c81689961c
commit d1b1b162df
6 changed files with 85 additions and 1 deletions

View File

@@ -165,6 +165,7 @@ enum CryptType {
NephriteCrypt,
AlteredPinkCrypt,
NatsupochiCrypt,
PoringSoftCrypt,
}
#[derive(Clone, Debug, Deserialize)]
@@ -257,6 +258,7 @@ impl Schema {
CryptType::NephriteCrypt => Box::new(NephriteCrypt::new(self.base.clone())),
CryptType::AlteredPinkCrypt => Box::new(AlteredPinkCrypt::new(self.base.clone())),
CryptType::NatsupochiCrypt => Box::new(NatsupochiCrypt::new(self.base.clone())),
CryptType::PoringSoftCrypt => Box::new(PoringSoftCrypt::new(self.base.clone())),
})
}
}
@@ -910,6 +912,20 @@ impl<R: Read> Read for NatsupochiCryptReader<R> {
}
}
seek_crypt_filehash_key_impl!(PoringSoftCrypt, PoringSoftCryptReader<T>);
impl<R: Read> Read for PoringSoftCryptReader<R> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
let readed = self.inner.read(buf)?;
let key = (!w!(self.key + 1)) as u8;
for t in (&mut buf[..readed]).iter_mut() {
*t ^= key;
}
self.pos += readed as u64;
Ok(readed)
}
}
#[test]
fn test_deserialize_crypt() {
for (key, schema) in CRYPT_SCHEMA.iter() {