Skip to content

Commit

Permalink
dasm-plugins/scanxrefs: fix 64b
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyg committed Nov 9, 2020
1 parent a4c799a commit ea25e2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions samples/dasm-plugins/scanxrefs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ def scanxrefs(target)
(0..raw.length-csz/8).each { |off|
r = raw[off, csz/8].unpack(upq).first
ans << (s_addr + off) if (r + off+csz/8 + s_addr) & msk == target or r == target
next if csz != 64
# on 64bit platforms, also search for 32bit offsets
r = Expression.make_signed(r & 0xffffffff, 32)
next if r == 0
ans << (s_addr + off) if (r + off+4 + s_addr) & msk == target or r == target
}
}
ans
Expand Down

0 comments on commit ea25e2c

Please sign in to comment.