pub fn aob_scan(pattern: &str, start: usize, length: usize) -> Option<usize> {
  let mut buffer = vec![0u8; length];
  let mut n = length;
  unsafe {
    ReadProcessMemory(
      GetCurrentProcess(),
      start as _,
      buffer.as_mut_ptr() as _,
      length,
      &mut n as *mut _ as _,
    )
  };

  bmh::bmh(&buffer[0..n], &bmh::into_needle(pattern))
}
/// Boyer-Moore implementation for [scanning array of bytes](https://wiki.cheatengine.org/index.php?title=Tutorials:AOBs).
///
/// Memory-safe, but still needs to be thoroughly tested. Tread carefully.
Boyer-Moore implementation for [scanning array of bytes].
Memory-safe, but still needs to be thoroughly tested. Tread carefully.
Boyer - Moore implementation for [ scanning array of bytes ] . Memory - safe but still needs to be thoroughly tested . Tread carefully .
pub fn aob_scan(pattern: &str, start: usize, length: usize) -> Option<usize> {
  let mut buffer = vec![0u8; length];
  let mut n = length;
  unsafe {
    ReadProcessMemory(
      GetCurrentProcess(),
      start as _,
      buffer.as_mut_ptr() as _,
      length,
      &mut n as *mut _ as _,
    )
  };
  bmh::bmh(&buffer[0..n], &bmh::into_needle(pattern))
}
pub fn aob_scan ( pattern : & str , start : usize , length : usize ) -> Option < usize > { let mut buffer = vec ! [ 0u8 length ] ; let mut n = length ; unsafe { ReadProcessMemory ( GetCurrentProcess ( ) , start as _ , buffer . as_mut_ptr ( ) as _ , length , & mut n as * mut _ as _ , ) } ; bmh :: bmh ( & buffer [ 0 .. n ] , & bmh :: into_needle ( pattern ) ) }
Boyer-Moore implementation for [scanning array of bytes](https://wiki.cheatengine.org/index.php?title=Tutorials:AOBs).
Boyer - Moore implementation for [ scanning array of bytes ] ( https : // wiki . cheatengine . org / index . php?title = Tutorials : AOBs ) .
pattern
&str
start
usize
length
usize