Add ExaCrypt (untested)

This commit is contained in:
2026-04-10 14:04:42 +08:00
parent bf11009b1f
commit b02e033873
2 changed files with 21 additions and 0 deletions

View File

@@ -1425,6 +1425,10 @@
"$type": "HashCrypt",
"Title": "女体化パニック! ~オンナのコのカラダってキモチイイ~"
},
"Oazuke Fetish!": {
"$type": "ExaCrypt",
"Title": "おあずけフェティッシュ!"
},
"Ochiteiku Wakazuma Maiko": {
"$type": "NephriteCrypt",
"Title": "堕ちていく若妻麻衣子"

View File

@@ -180,6 +180,7 @@ enum CryptType {
StripeCrypt {
key: u8,
},
ExaCrypt,
}
#[derive(Clone, Debug, Deserialize)]
@@ -281,6 +282,7 @@ impl Schema {
CryptType::AkabeiCrypt { seed } => Box::new(AkabeiCrypt::new(self.base.clone(), *seed)),
CryptType::HaikuoCrypt => Box::new(HaikuoCrypt::new(self.base.clone())),
CryptType::StripeCrypt { key } => Box::new(StripeCrypt::new(self.base.clone(), *key)),
CryptType::ExaCrypt => Box::new(ExaCrypt::new(self.base.clone())),
})
}
}
@@ -1192,6 +1194,21 @@ impl<R: Read> Read for StripeCryptReader<R> {
}
}
seek_crypt_filehash_key_impl!(ExaCrypt, ExaCryptReader<T>);
impl<R: Read> Read for ExaCryptReader<R> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
let readed = self.inner.read(buf)?;
let mut shift = ((self.seg_start + self.pos) % 5) as u32;
for t in (&mut buf[..readed]).iter_mut() {
*t ^= (self.key >> shift) as u8;
shift = (shift + 1) % 5;
}
self.pos += readed as u64;
Ok(readed)
}
}
#[test]
fn test_deserialize_crypt() {
for (key, schema) in CRYPT_SCHEMA.iter() {