samples/bindiff.rb in metasm-1.0.1 vs samples/bindiff.rb in metasm-1.0.2
- old
+ new
@@ -292,11 +292,10 @@
}
set_status('match funcs') {
# refine the layout matching with actual function matching
already_matched = []
- match_score = {}
layout_match.each { |f1, list|
puts "matching #{Expression[f1]}" if $VERBOSE
begin
f2 = (list - already_matched).sort_by { |f| match_func(f1, f, false, false) }.first
if f2
@@ -427,12 +426,12 @@
end
# show in window 1 the match of the function found in win 2
def sync1
c2 = curfunc2
- if a1 = match_funcs.find { |k, (a2, s)| a2 == c2 }
- @dasm1.gui.focus_addr(a1[0])
+ if a1 = match_funcs.find_key { |k| match_funcs[k][0] == c2 }
+ @dasm1.gui.focus_addr(a1)
end
end
def sync2
if a2 = match_funcs[curfunc1]
@@ -489,10 +488,10 @@
$VERBOSE = true
# parse arguments
opts = {}
OptionParser.new { |opt|
- opt.banner = 'Usage: bindiff.rb [options] <executable> [<entrypoints>]'
+ opt.banner = 'Usage: bindiff.rb [options] <exe1> <exe2> [<entrypoints>]'
opt.on('-P <plugin>', '--plugin <plugin>', 'load a metasm disassembler plugin') { |h| (opts[:plugin] ||= []) << h }
opt.on('-e <code>', '--eval <code>', 'eval a ruby code') { |h| (opts[:hookstr] ||= []) << h }
opt.on('--map1 <mapfile>', 'load a map file (addr <-> name association)') { |f| opts[:map1] = f }
opt.on('--map2 <mapfile>', 'load a map file (addr <-> name association)') { |f| opts[:map2] = f }
opt.on('-c <header>', '--c-header <header>', 'read C function prototypes (for external library functions)') { |h| opts[:cheader] = h }