node/lib/metasm/metasm/gui/dasm_decomp.rb
# focus on addr
# returns true on success (address exists & decompiled)
focus on addr
returns true on success (address exists & decompiled)
focus on addr returns true on success ( address exists & decompiled )
def focus_addr(addr)
		if @dasm.c_parser and (@dasm.c_parser.toplevel.symbol[addr] or @dasm.c_parser.toplevel.struct[addr].kind_of?(C::Union))
			@curaddr = addr
			@caret_x = @caret_y = 0
			gui_update
			return true
		end
		return if not addr = @parent_widget.normalize(addr)
		todo = [addr]
		done = []
		ep = @dasm.entrypoints.to_a.inject({}) { |h, e| h.update @dasm.normalize(e) => true }
		while addr = todo.pop
			next if not di = @dasm.di_at(addr)
			addr = di.block.address
			next if done.include?(addr) or not @dasm.di_at(addr)
			done << addr
			break if @dasm.function[addr] or ep[addr]
			empty = true
			@dasm.decoded[addr].block.each_from_samefunc(@dasm) { |na| empty = false ; todo << na }
			break if empty
		end
		@dasm.auto_label_at(addr, 'loc') if @dasm.get_section_at(addr) and not @dasm.get_label_at(addr)
		return if not l = @dasm.get_label_at(addr)
		@curaddr = l
		@caret_x = @caret_y = 0
		gui_update
		true
	end
def focus_addr ( addr ) if @dasm . c_parser and ( @dasm . c_parser . toplevel . symbol [ addr ] or @dasm . c_parser . toplevel . struct [ addr ] . kind_of? ( C :: Union ) ) @curaddr = addr @caret_x = @caret_y = 0 gui_update return true end return if not addr = @parent_widget . normalize ( addr ) todo = [ addr ] done = [ ] ep = @dasm . entrypoints . to_a . inject ( { } ) { | h , e | h . update @dasm . normalize ( e ) => true } while addr = todo . pop next if not di = @dasm . di_at ( addr ) addr = di . block . address next if done . include? ( addr ) or not @dasm . di_at ( addr ) done << addr break if @dasm . function [ addr ] or ep [ addr ] empty = true @dasm . decoded [ addr ] . block . each_from_samefunc ( @dasm ) { | na | empty = false ; todo << na } break if empty end @dasm . auto_label_at ( addr , 'loc' ) if @dasm . get_section_at ( addr ) and not @dasm . get_label_at ( addr ) return if not l = @dasm . get_label_at ( addr ) @curaddr = l @caret_x = @caret_y = 0 gui_update true end
focus on addr
returns true on success (address exists & decompiled)
focus on addr returns true on success ( address exists & decompiled )
# scan up to func start/entrypoint
addr