diff --git a/libs/deob/src/deob.c b/libs/deob/src/deob.c index 78252ec..63b3e81 100644 --- a/libs/deob/src/deob.c +++ b/libs/deob/src/deob.c @@ -24,13 +24,16 @@ #include "deob.h" -void deob(char * in) { - const long long s[2] = { S0, S1 }; +void deob(char *in) { + const long long s[2] = {S0, S1}; char d[] = "OSTAR.password$OSB"; for (size_t i = 0; i < DL; i++) d[i] = (CS)[i]; size_t l = strlen(in) / 2; for (size_t i = 0; i < l; i++) { - for (size_t j = 0; j < DL; j++) { DLT(0); DLT(1); } + for (size_t j = 0; j < DL; j++) { + DLT(0); + DLT(1); + } DLS(i); } INZ(l); diff --git a/libs/deob/src/deob.h b/libs/deob/src/deob.h index 877795b..52d4c25 100644 --- a/libs/deob/src/deob.h +++ b/libs/deob/src/deob.h @@ -32,12 +32,12 @@ #define S0 8373972096940928081 #define S1 7378413942531504450 #define CS (char*)&s -#define DL sizeof(d) / sizeof(d[0]) - 2 +#define DL sizeof(d) / sizeof(d[0]) - 3 #define I2 i*2 #define INZ(var) in[var] = 0 #define DLS(idx) in[idx] = (d[DL+1]<<4)|d[DL] #define DLT(idx) d[DL+idx] = (in[I2+idx] == d[j]) ? (char)j : d[DL+idx] -void deob(char * in); +void deob(char *in); #endif //OSC_VARIANT_DEOB_H diff --git a/src/file_io.rs b/src/file_io.rs index 5e1daf1..4941fa2 100644 --- a/src/file_io.rs +++ b/src/file_io.rs @@ -141,7 +141,7 @@ impl InputFile { } } else { return Err(FileError::Parsing( - filename.into(), + filename, "Kann OSB-Datei nicht lesen".to_string(), )); } diff --git a/src/unzip_osb.rs b/src/unzip_osb.rs index e8196f4..bed72c2 100644 --- a/src/unzip_osb.rs +++ b/src/unzip_osb.rs @@ -88,7 +88,7 @@ pub fn unzip_osb_using_password(path: &str, dir: &str, password: &str) { }; let outpath = match file.enclosed_name() { - Some(path) => Path::new(dir).join(path.to_owned()), + Some(path) => Path::new(dir).join(&path), None => continue, };