Skip to content

Commit

Permalink
dasm: add backtrace_one helper func
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyg committed Nov 2, 2020
1 parent e1186a5 commit 72e3094
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions metasm/disassemble_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,14 @@ def rebase_delta(delta)
delta
end

# backtrace, if the result is one value, return it, else return nil
def backtrace_one(*args)
ret = backtrace(*args)
if ret.length == 1 and ret.first.kind_of?(Expression) and ret.first != Expression::Unknown
normalize(ret.first)
end
end

# dataflow method
# walks a function, starting at addr
# follows the usage of registers, computing the evolution from the value they had at start_addr
Expand Down

0 comments on commit 72e3094

Please sign in to comment.