[kwm] fix: KWMv1 key generation

This commit is contained in:
鲁树人 2024-09-15 16:20:54 +01:00
parent 785b2f6f0d
commit 440df8a06b

View File

@ -11,7 +11,10 @@ const KEY: [u8; 0x20] = [
impl CipherV1 { impl CipherV1 {
pub fn new(resource_id: u32) -> Self { pub fn new(resource_id: u32) -> Self {
let mut key = KEY; let mut key = KEY;
for (k, r) in key.iter_mut().zip(resource_id.to_string().as_bytes()) { for (k, r) in key
.iter_mut()
.zip(resource_id.to_string().as_bytes().iter().cycle())
{
*k ^= r; *k ^= r;
} }