mirror of
https://github.com/a2x/cs2-dumper.git
synced 2025-04-04 08:35:34 +08:00
Fix jmp target for negative displacement
This commit is contained in:
parent
7bf035aaf6
commit
82ff77772c
@ -179,7 +179,7 @@ impl Process {
|
||||
) -> Result<usize> {
|
||||
let displacement = self.read_memory::<i32>(address + offset.unwrap_or(0x1))?;
|
||||
|
||||
Ok((address + length.unwrap_or(0x5)) + displacement as usize)
|
||||
Ok(((address + length.unwrap_or(0x5)) as isize + displacement as isize) as usize)
|
||||
}
|
||||
|
||||
pub fn resolve_rip(
|
||||
@ -190,7 +190,7 @@ impl Process {
|
||||
) -> Result<usize> {
|
||||
let displacement = self.read_memory::<i32>(address + offset.unwrap_or(0x3))?;
|
||||
|
||||
Ok((address + length.unwrap_or(0x7)) + displacement as usize)
|
||||
Ok(((address + length.unwrap_or(0x7)) as isize + displacement as isize) as usize)
|
||||
}
|
||||
|
||||
fn get_process_id_by_name(process_name: &str) -> Result<u32> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user