lib/metasm/metasm/disassemble_api.rb
# iterates over the blocks of a function, yields each func block address
# returns the graph of blocks (block address => [list of samefunc blocks])
iterates over the blocks of a function, yields each func block address
returns the graph of blocks (block address => [list of samefunc blocks])
iterates over the blocks of a function yields each func block address returns the graph of blocks ( block address = > [ list of samefunc blocks ] )
def each_function_block(addr, incl_subfuncs = false, find_func_start = true)
		addr = @function.index(addr) if addr.kind_of? DecodedFunction
		addr = addr.address if addr.kind_of? DecodedInstruction
		addr = find_function_start(addr) if not @function[addr] and find_func_start
		todo = [addr]
		ret = {}
		while a = todo.pop
			next if not di = di_at(a)
			a = di.block.address
			next if ret[a]
			ret[a] = []
			yield a if block_given?
			di.block.each_to_samefunc(self) { |f| ret[a] << f ; todo << f }
			di.block.each_to_otherfunc(self) { |f| ret[a] << f ; todo << f } if incl_subfuncs
		end
		ret
	end
def each_function_block ( addr , incl_subfuncs = false , find_func_start = true ) addr = @function . index ( addr ) if addr . kind_of? DecodedFunction addr = addr . address if addr . kind_of? DecodedInstruction addr = find_function_start ( addr ) if not @function [ addr ] and find_func_start todo = [ addr ] ret = { } while a = todo . pop next if not di = di_at ( a ) a = di . block . address next if ret [ a ] ret [ a ] = [ ] yield a if block_given? di . block . each_to_samefunc ( self ) { | f | ret [ a ] << f ; todo << f } di . block . each_to_otherfunc ( self ) { | f | ret [ a ] << f ; todo << f } if incl_subfuncs end ret end
iterates over the blocks of a function, yields each func block address
returns the graph of blocks (block address => [list of samefunc blocks])
iterates over the blocks of a function yields each func block address returns the graph of blocks ( block address = > [ list of samefunc blocks ] )
addr
incl_subfuncs
find_func_start