node/lib/metasm/metasm/debug.rb
# resolves an expression involving register values and/or memory indirection using the current context
# uses #register_list, #get_reg_value, @mem, @cpu
# :tid/:pid resolve to current thread
resolves an expression involving register values and/or memory indirection using the current context
uses #register_list, #get_reg_value, @mem, @cpu
:tid/:pid resolve to current thread
resolves an expression involving register values and / or memory indirection using the current context uses #register_list #get_reg_value @mem @cpu : tid / : pid resolve to current thread
def resolve_expr(e)
		e = parse_expr(e) if e.kind_of? ::String
		bd = { :tid => @tid, :pid => @pid }
		Expression[e].externals.each { |ex|
			next if bd[ex]
			case ex
			when ::Symbol; bd[ex] = get_reg_value(ex)
			when ::String; bd[ex] = @symbols.index(ex) || @disassembler.prog_binding[ex] || 0
			end
		}
		Expression[e].bind(bd).reduce { |i|
			if i.kind_of? Indirection and p = i.pointer.reduce and p.kind_of? ::Integer
				i.len ||= @cpu.size/8
				p &= (1 << @cpu.size) - 1 if p < 0
				Expression.decode_imm(@memory, i.len, @cpu, p)
			end
		}
	end
def resolve_expr ( e ) e = parse_expr ( e ) if e . kind_of? :: String bd = { :tid => @tid , :pid => @pid } Expression [ e ] . externals . each { | ex | next if bd [ ex ] case ex when :: Symbol ; bd [ ex ] = get_reg_value ( ex ) when :: String ; bd [ ex ] = @symbols . index ( ex ) || @disassembler . prog_binding [ ex ] || 0 end } Expression [ e ] . bind ( bd ) . reduce { | i | if i . kind_of? Indirection and p = i . pointer . reduce and p . kind_of? :: Integer i . len ||= @cpu . size / 8 p &= ( 1 << @cpu . size ) - 1 if p < 0 Expression . decode_imm ( @memory , i . len , @cpu , p ) end } end
resolves an expression involving register values and/or memory indirection using the current context
uses #register_list, #get_reg_value, @mem, @cpu
:tid/:pid resolve to current thread
resolves an expression involving register values and / or memory indirection using the current context uses #register_list #get_reg_value @mem @cpu : tid / : pid resolve to current thread
e