node/lib/metasm/metasm/disassemble_api.rb
# call this function on a function entrypoint if the function is in fact a __noreturn
# will cut the to_subfuncret of callers
call this function on a function entrypoint if the function is in fact a __noreturn
will cut the to_subfuncret of callers
call this function on a function entrypoint if the function is in fact a __noreturn will cut the to_subfuncret of callers
def fix_noreturn(o)
		each_xref(o, :x) { |a|
			a = normalize(a.origin)
			next if not di = di_at(a) or not di.opcode.props[:saveip]
			di.block.each_to_subfuncret { |to|
				next if not tdi = di_at(to) or not tdi.block.from_subfuncret
				tdi.block.from_subfuncret.delete_if { |aa| normalize(aa) == di.address }
				tdi.block.from_subfuncret = nil if tdi.block.from_subfuncret.empty?
			}
			di.block.to_subfuncret = nil
		}
	end
def fix_noreturn ( o ) each_xref ( o , :x ) { | a | a = normalize ( a . origin ) next if not di = di_at ( a ) or not di . opcode . props [ :saveip ] di . block . each_to_subfuncret { | to | next if not tdi = di_at ( to ) or not tdi . block . from_subfuncret tdi . block . from_subfuncret . delete_if { | aa | normalize ( aa ) == di . address } tdi . block . from_subfuncret = nil if tdi . block . from_subfuncret . empty? } di . block . to_subfuncret = nil } end
call this function on a function entrypoint if the function is in fact a __noreturn
will cut the to_subfuncret of callers
call this function on a function entrypoint if the function is in fact a __noreturn will cut the to_subfuncret of callers
# XXX should check if caller also becomes __noreturn
o