class Metasm::C::CRenderString

used to render a C to a source string, while keeping the information of which each character comes from which C object

Attributes

my_c[RW]

Public Class Methods

new(*a) click to toggle source
Calls superclass method
# File metasm/parse_c.rb, line 3361
def initialize(*a)
        if cs = a.grep(Statement).first
                a -= [cs]
                @my_c = cs
                c_at_offset[0] = cs
        end
        super(*a)
end

Public Instance Methods

<<(o) click to toggle source

concatenate another CRenderString: merge @c_at_offset

Calls superclass method
# File metasm/parse_c.rb, line 3350
def <<(o)
        if o.kind_of?(self.class)
                o.c_at_offset.each { |k, v|
                        c_at_offset[length+k] ||= v
                }
        elsif my_c
                c_at_offset[length] ||= my_c
        end
        super(o)
end
c_at_offset() click to toggle source

hash offset => C::Statement, means bytes from this offset to the next entry comes from rendering this C object

# File metasm/parse_c.rb, line 3345
def c_at_offset
        @c_at_offset ||= {}
end