node/lib/metasm/metasm/gui/dasm_graph.rb
# focus on addr
# addr may be a dasm label, dasm address, dasm address in string form (eg "0DEADBEEFh")
# addr must point to a decodedinstruction
# if the addr is not found in curcontext, the code flow is walked up until a function
# start or an entrypoint is found, then the graph is created from there
# will call gui_update then
focus on addr
addr may be a dasm label, dasm address, dasm address in string form
addr must point to a decodedinstruction
if the addr is not found in curcontext, the code flow is walked up until a function
start or an entrypoint is found, then the graph is created from there
will call gui_update then
focus on addr addr may be a dasm label dasm address dasm address in string form addr must point to a decodedinstruction if the addr is not found in curcontext the code flow is walked up until a function start or an entrypoint is found then the graph is created from there will call gui_update then
def focus_addr(addr, can_update_context=true)
		return if @parent_widget and not addr = @parent_widget.normalize(addr)
		return if not @dasm.di_at(addr)
		if b = @curcontext.box.find { |b_| b_[:line_address].index(addr) }
			@caret_box, @caret_x, @caret_y = b, 0, b[:line_address].rindex(addr)
			@curcontext.view_x += (width/2 / @zoom - width/2)
			@curcontext.view_y += (height/2 / @zoom - height/2)
			@zoom = 1.0
			update_caret
		elsif can_update_context
			@curcontext = Graph.new 'testic'
			@curcontext.root_addrs = dasm_find_roots(addr)
			@want_focus_addr = addr
			gui_update
		else
			return
		end
		true
	end
def focus_addr ( addr , can_update_context = true ) return if @parent_widget and not addr = @parent_widget . normalize ( addr ) return if not @dasm . di_at ( addr ) if b = @curcontext . box . find { | b_ | b_ [ :line_address ] . index ( addr ) } @caret_box , @caret_x , @caret_y = b , 0 , b [ :line_address ] . rindex ( addr ) @curcontext . view_x += ( width / 2 / @zoom - width / 2 ) @curcontext . view_y += ( height / 2 / @zoom - height / 2 ) @zoom = 1.0 update_caret elsif can_update_context @curcontext = Graph . new 'testic' @curcontext . root_addrs = dasm_find_roots ( addr ) @want_focus_addr = addr gui_update else return end true end
focus on addr
addr may be a dasm label, dasm address, dasm address in string form (eg "0DEADBEEFh")
addr must point to a decodedinstruction
if the addr is not found in curcontext, the code flow is walked up until a function
start or an entrypoint is found, then the graph is created from there
will call gui_update then
focus on addr addr may be a dasm label dasm address dasm address in string form ( eg " 0DEADBEEFh " ) addr must point to a decodedinstruction if the addr is not found in curcontext the code flow is walked up until a function start or an entrypoint is found then the graph is created from there will call gui_update then
# move window / change curcontext
addr
can_update_context