Add JPEG Support for HG3

This commit is contained in:
2025-08-14 22:53:55 +08:00
parent 3973f3bb43
commit db8feced48
5 changed files with 137 additions and 29 deletions

View File

@@ -7,6 +7,7 @@ use crate::utils::blowfish::Blowfish;
use crate::utils::crc32::CRC32NORMAL_TABLE;
use crate::utils::encoding::{decode_to_string, encode_string};
use anyhow::Result;
use overf::wrapping;
use std::io::{Read, Seek, SeekFrom};
use std::sync::{Arc, Mutex};
@@ -352,7 +353,7 @@ impl<T: Read + Seek + std::fmt::Debug> CSIntArc<T> {
}
fn decrypt_name(name: &mut [u8; 0x40], key: u32, encoding: Encoding) -> Result<String> {
let mut k = ((key >> 24) + (key >> 16) + (key >> 8) + key) & 0xFF;
let mut k = wrapping! {((key >> 24) + (key >> 16) + (key >> 8) + key) & 0xFF};
let mut i = 0;
while i < 0x40 && name[i] != 0 {
let v = name[i];