Sha256: d7b367c9b8d72a990fe97582548a8b436aa413eaf617db19ebfad5bef283684d

Contents?: true

Size: 661 Bytes

Versions: 4

Compression:

Stored size: 661 Bytes

Contents

#    This file is part of Metasm, the Ruby assembly manipulation suite
#    Copyright (C) 2006-2009 Yoann GUILLOT
#
#    Licence is LGPL, see LICENCE in the top-level directory


# metasm dasm plugin: try to demangle all labels as c++ names, add them as
# comment if successful

def demangle_all_cppnames
	cnt = 0
	prog_binding.each { |name, addr|
		cname = name.sub(/^thunk_/, '')
		if dname = demangle_cppname(cname)
			cnt += 1
			add_comment(addr, dname)
			each_xref(addr, :x) { |xr|
				if di = di_at(xr.origin)
					di.add_comment dname
					di.comment.delete "x:#{name}"
				end
			}
		end
	}
	cnt
end

if gui
	demangle_all_cppnames
	gui.gui_update
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metasm-1.0.5 samples/dasm-plugins/demangle_cpp.rb
metasm-1.0.4 samples/dasm-plugins/demangle_cpp.rb
metasm-1.0.3 samples/dasm-plugins/demangle_cpp.rb
metasm-1.0.2 samples/dasm-plugins/demangle_cpp.rb