Crypt

Trait Crypt 

Source
pub trait Crypt: Debug {
Show 13 methods // Required methods fn hash_after_crypt(&self) -> bool; fn startup_tjs_not_encrypted(&self) -> bool; fn obfuscated_index(&self) -> bool; // Provided methods fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()> { ... } fn read_name<'a>( &self, reader: &mut Box<dyn Read + 'a>, ) -> Result<(String, u64)> { ... } fn decrypt<'a>( &self, _entry: &Xp3Entry, _cur_seg: &Segment, _stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>> { ... } fn decrypt_with_seek<'a>( &self, _entry: &Xp3Entry, _cur_seg: &Segment, _stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>> { ... } fn decrypt_supported(&self) -> bool { ... } fn decrypt_seek_supported(&self) -> bool { ... } fn need_filter(&self, _filename: &str, _buf: &[u8], _buf_len: usize) -> bool { ... } fn filter_seek_supported(&self) -> bool { ... } fn filter<'a>( &self, _entry: Entry<'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>> { ... } fn filter_with_seek<'a>( &self, _entry: Entry<'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>> { ... }
}
Available on crate features kirikiri and kirikiri-arc only.

Required Methods§

Source

fn hash_after_crypt(&self) -> bool

whether Adler32 checksum should be calculated after contents have been encrypted.

Source

fn startup_tjs_not_encrypted(&self) -> bool

whether the startup.tjs script is not encrypted even when the archive is encrypted.

Source

fn obfuscated_index(&self) -> bool

whether XP3 index is obfuscated:

  • duplicate entries
  • entries have additional dummy segments

Provided Methods§

Source

fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>

Initializes the cryptographic context for the archive.

Source

fn read_name<'a>( &self, reader: &mut Box<dyn Read + 'a>, ) -> Result<(String, u64)>

Read a entry name from archive index

Source

fn decrypt<'a>( &self, _entry: &Xp3Entry, _cur_seg: &Segment, _stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Decrypts the given stream of data for the specified entry and segment.

Source

fn decrypt_with_seek<'a>( &self, _entry: &Xp3Entry, _cur_seg: &Segment, _stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Decrypts the given stream of data for the specified entry and segment, with seek support.

Source

fn decrypt_supported(&self) -> bool

Returns true if this crypt support decrypt

Source

fn decrypt_seek_supported(&self) -> bool

Returns true if this crypt support seek when decrypting

Source

fn need_filter(&self, _filename: &str, _buf: &[u8], _buf_len: usize) -> bool

Determine whether the file with the given name and content need to be extra processed after decryption. (e.g. extra decryption by file type)

Source

fn filter_seek_supported(&self) -> bool

Returns true if this crypt support seek when filtering

Source

fn filter<'a>( &self, _entry: Entry<'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Apply extra processing to the decrypted content of the file.

Source

fn filter_with_seek<'a>( &self, _entry: Entry<'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Apply extra processing to the decrypted content of the file, with seek support.

Implementations on Foreign Types§

Source§

impl Crypt for Arc<CabbageCxCrypt>

Source§

fn hash_after_crypt(&self) -> bool

Source§

fn startup_tjs_not_encrypted(&self) -> bool

Source§

fn obfuscated_index(&self) -> bool

Source§

fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>

Source§

fn decrypt_supported(&self) -> bool

Source§

fn decrypt_seek_supported(&self) -> bool

Source§

fn decrypt<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Source§

fn decrypt_with_seek<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Source§

impl Crypt for Arc<CxEncryption>

Source§

fn hash_after_crypt(&self) -> bool

Source§

fn startup_tjs_not_encrypted(&self) -> bool

Source§

fn obfuscated_index(&self) -> bool

Source§

fn decrypt_supported(&self) -> bool

Source§

fn decrypt_seek_supported(&self) -> bool

Source§

fn decrypt<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Source§

fn decrypt_with_seek<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Source§

impl Crypt for Arc<HxCryptLite>

Source§

fn hash_after_crypt(&self) -> bool

Source§

fn startup_tjs_not_encrypted(&self) -> bool

Source§

fn obfuscated_index(&self) -> bool

Source§

fn decrypt_supported(&self) -> bool

Source§

fn decrypt_seek_supported(&self) -> bool

Source§

fn decrypt<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Source§

fn decrypt_with_seek<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Source§

impl Crypt for Arc<NanaCxCrypt>

Source§

fn hash_after_crypt(&self) -> bool

Source§

fn startup_tjs_not_encrypted(&self) -> bool

Source§

fn obfuscated_index(&self) -> bool

Source§

fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>

Source§

fn decrypt_supported(&self) -> bool

Source§

fn decrypt_seek_supported(&self) -> bool

Source§

fn decrypt<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Source§

fn decrypt_with_seek<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Source§

impl Crypt for Arc<RiddleCxCrypt>

Source§

fn hash_after_crypt(&self) -> bool

Source§

fn startup_tjs_not_encrypted(&self) -> bool

Source§

fn obfuscated_index(&self) -> bool

Source§

fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>

Source§

fn decrypt_supported(&self) -> bool

Source§

fn decrypt_seek_supported(&self) -> bool

Source§

fn decrypt<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Source§

fn decrypt_with_seek<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Source§

impl Crypt for Arc<SenrenCxCrypt>

Source§

fn hash_after_crypt(&self) -> bool

Source§

fn startup_tjs_not_encrypted(&self) -> bool

Source§

fn obfuscated_index(&self) -> bool

Source§

fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>

Source§

fn decrypt_supported(&self) -> bool

Source§

fn decrypt_seek_supported(&self) -> bool

Source§

fn decrypt<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>

Source§

fn decrypt_with_seek<'a>( &self, entry: &Xp3Entry, cur_seg: &Segment, stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>

Implementors§

Source§

impl Crypt for ChainReactionCrypt

Source§

impl Crypt for SisMikoCrypt

Source§

impl Crypt for XanaduCrypt

Source§

impl Crypt for HxCrypt

Source§

impl Crypt for Hxv4Crypt

Source§

impl Crypt for KissCrypt

Source§

impl Crypt for NVLCrypt

Source§

impl Crypt for AkabeiCrypt

Source§

impl Crypt for AlteredPinkCrypt

Source§

impl Crypt for AppliqueCrypt

Source§

impl Crypt for DameganeCrypt

Source§

impl Crypt for DieselmineCrypt

Source§

impl Crypt for ExaCrypt

Source§

impl Crypt for FateCrypt

Source§

impl Crypt for FestivalCrypt

Source§

impl Crypt for FlyingShineCrypt

Source§

impl Crypt for HaikuoCrypt

Source§

impl Crypt for HashCrypt

Source§

impl Crypt for HibikiCrypt

Source§

impl Crypt for HighRunningCrypt

Source§

impl Crypt for HybridCrypt

Source§

impl Crypt for Kano2Crypt

Source§

impl Crypt for LeaveSLeaveCrypt

Source§

impl Crypt for MadoCrypt

Source§

impl Crypt for MiburoCrypt

Source§

impl Crypt for MizukakeCrypt

Source§

impl Crypt for NatsupochiCrypt

Source§

impl Crypt for NekoWorksCrypt

Source§

impl Crypt for NephriteCrypt

Source§

impl Crypt for NinkiSeiyuuCrypt

Source§

impl Crypt for NoCrypt

Source§

impl Crypt for OkibaCrypt

Source§

impl Crypt for PinPointCrypt

Source§

impl Crypt for PoringSoftCrypt

Source§

impl Crypt for PuCaCrypt

Source§

impl Crypt for PureMoreCrypt

Source§

impl Crypt for RhapsodyCrypt

Source§

impl Crypt for SeitenCrypt

Source§

impl Crypt for SmileCrypt

Source§

impl Crypt for SmxCrypt

Source§

impl Crypt for SourireCrypt

Source§

impl Crypt for StripeCrypt

Source§

impl Crypt for SyangrilaSmartCrypt

Source§

impl Crypt for TokidokiCrypt

Source§

impl Crypt for Xor2Crypt

Source§

impl Crypt for XorCrypt

Source§

impl Crypt for YuzuCrypt