Trying to find the best Rust method to search for four consecutive values in a Vec array.
Using this as a start but not getting the results I expect. Value is populated by reading in binary data from various sources; files, registry, ... .
value: &Vec<u8>
if value.windows(4).any(|b|
b[0] == 0x4D &&
b[1] == 0x5A &&
b[2] == 0x90 &&
b[3] == 0x00) { println!("found"}; }
Basically I'm looking for a Windows PE MZ header. I'm obviously not understanding something.