node/lib/metasm/metasm/disassemble.rb
def dump_block_header(block, &b)
		b ||= lambda { |l| puts l }
		xr = []
		each_xref(block.address) { |x|
			case x.type
			when :x; xr << Expression[x.origin]
			when :r, :w; xr << "#{x.type}#{x.len}:#{Expression[x.origin]}"
			end
		}
		if not xr.empty?
			b["\n// Xrefs: #{xr[0, 8].join(' ')}#{' ...' if xr.length > 8}"]
		end
		if block.edata.inv_export[block.edata_ptr] and label_alias[block.address]
			b["\n"] if xr.empty?
			label_alias[block.address].each { |name| b["#{name}:"] }
		end
		if c = @comment[block.address]
			c = c.join("\n") if c.kind_of? ::Array
			c.each_line { |l| b["// #{l}"] }
		end
	end
# shows the xrefs/labels at block start
shows the xrefs/labels at block start
shows the xrefs / labels at block start
def dump_block_header(block, &b)
		b ||= lambda { |l| puts l }
		xr = []
		each_xref(block.address) { |x|
			case x.type
			when :x; xr << Expression[x.origin]
			when :r, :w; xr << "#{x.type}#{x.len}:#{Expression[x.origin]}"
			end
		}
		if not xr.empty?
			b["\n// Xrefs: #{xr[0, 8].join(' ')}#{' ...' if xr.length > 8}"]
		end
		if block.edata.inv_export[block.edata_ptr] and label_alias[block.address]
			b["\n"] if xr.empty?
			label_alias[block.address].each { |name| b["#{name}:"] }
		end
		if c = @comment[block.address]
			c = c.join("\n") if c.kind_of? ::Array
			c.each_line { |l| b["// #{l}"] }
		end
	end
def dump_block_header ( block , & b ) b ||= lambda { | l | puts l } xr = [ ] each_xref ( block . address ) { | x | case x . type when :x ; xr << Expression [ x . origin ] when :r , :w ; xr << "#{x.type}#{x.len}:#{Expression[x.origin]}" end } if not xr . empty? b [ "\n// Xrefs: #{xr[0, 8].join(' ')}#{' ...' if xr.length > 8}" ] end if block . edata . inv_export [ block . edata_ptr ] and label_alias [ block . address ] b [ "\n" ] if xr . empty? label_alias [ block . address ] . each { | name | b [ "#{name}:" ] } end if c = @comment [ block . address ] c = c . join ( "\n" ) if c . kind_of? :: Array c . each_line { | l | b [ "// #{l}" ] } end end
shows the xrefs/labels at block start
shows the xrefs / labels at block start
block
b