Skip to content

Commit

Permalink
Yeah we're reading unaligned pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Oct 13, 2024
1 parent bcced1e commit 4e4f5a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auxtools/src/sigscan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ impl Signature {
scanner.find(&self.bytes).map(|address| unsafe {
match self.treatment {
SignatureTreatment::NoOffset | SignatureTreatment::OffsetByInt(0) => std::mem::transmute(address as *const std::ffi::c_void),
SignatureTreatment::OffsetByInt(i) => *(address.offset(i) as *const *const std::ffi::c_void),
SignatureTreatment::OffsetByInt(i) => (address.offset(i) as *const *const std::ffi::c_void).read_unaligned(),
SignatureTreatment::OffsetByCall => {
let offset = *(address.offset(1) as *const isize);
let offset = (address.offset(1) as *const isize).read_unaligned();
address.offset(5).offset(offset) as *const () as *const std::ffi::c_void
}
}
Expand Down

0 comments on commit 4e4f5a1

Please sign in to comment.