From a0e5aa09d780c1e81a6675338b0f11e19ac4ebb3 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 3 May 2025 18:27:38 -0400 Subject: [PATCH] Arguments are encoded with Base64 padding --- src/blowfish.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/blowfish.rs b/src/blowfish.rs index 71434ff..8c333c9 100644 --- a/src/blowfish.rs +++ b/src/blowfish.rs @@ -2,7 +2,7 @@ const checksum_table: [char; 16] = [ 'f', 'X', '1', 'p', 'G', 't', 'd', 'S', '5', 'C', 'A', 'P', '4', '_', 'V', 'L', ]; -use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD}; +use base64::{Engine as _, engine::general_purpose::URL_SAFE}; use physis::blowfish::Blowfish; use windows::Win32::System::SystemInformation::*; @@ -30,8 +30,9 @@ pub fn decrypt_arguments(commandline: &str) -> String { let index = commandline.find("sqex").unwrap(); let base64 = &commandline[index + 8..commandline.len() - 6]; + let blowfish = initialize_blowfish(); - let decoded = URL_SAFE_NO_PAD.decode(base64.as_bytes()).unwrap(); + let decoded = URL_SAFE.decode(base64.as_bytes()).unwrap(); let result = blowfish.decrypt(&decoded).unwrap(); @@ -43,7 +44,7 @@ pub fn encrypt_arguments(commandline: &str) -> String { let blowfish = initialize_blowfish(); let encrypted = blowfish.encrypt(commandline.as_bytes()).unwrap(); - let encoded = URL_SAFE_NO_PAD.encode(encrypted); + let encoded = URL_SAFE.encode(encrypted); let checksum = calculate_checksum(calculate_blowfish_key()); format!("//**sqex0003{}{}**//", encoded, checksum)