class Metasm::ARM64::Memref
Attributes
base[RW]
incr[RW]
index[RW]
offset[RW]
scale[RW]
sz[RW]
Public Class Methods
new(base, index, scale, offset, sz, incr=nil)
click to toggle source
# File metasm/cpu/arm64/main.rb, line 69 def initialize(base, index, scale, offset, sz, incr=nil) @base, @index, @scale, @offset, @sz, @incr = base, index, scale, offset, sz, incr end
Public Instance Methods
render()
click to toggle source
# File metasm/cpu/arm64/render.rb, line 49 def render o = Expression[@base] if @index i = @index i = Expression[@scale, :*, @index] if @scale != 1 o = Expression[o, :+, i] end case @incr when nil o = Expression[o, :+, @offset] if @offset and @offset != Expression[0] ['[', o, ']'] when :pre o = Expression[o, :+, @offset] ['[', o, ']!'] when :post ['[', o, '], ', @offset] end end
symbolic(di=nil)
click to toggle source
# File metasm/cpu/arm64/main.rb, line 73 def symbolic(di=nil) o = Expression[@base.symbolic] if @index si = @index.symbolic si = Expression[@scale, :*, @index] if @scale != 1 o = Expression[o, :+, si] end o = Expression[o, :+, @offset] if @offset and @incr != :post Indirection[o.reduce, @sz, (di.address if di)] end