class Rex::OLE::PropertySet

Public Class Methods

new(fmtid = nil) click to toggle source
# File lib/rex/ole/propset.rb, line 42
def initialize(fmtid = nil)
  @fmtid = CLSID.new(fmtid)
  @properties = []
end

Public Instance Methods

<<(val) click to toggle source
# File lib/rex/ole/propset.rb, line 47
def <<(val)
  @properties << val
end
pack_data() click to toggle source
# File lib/rex/ole/propset.rb, line 55
def pack_data
  # Pack all the property data
  data = []
  dlen = 0
  @properties.each { |p|
    dat = p.pack_data
    dlen += dat.length
    data << dat
  }

  buf = ''
  # First the header
  off = 8 + (@properties.length * 8)
  buf << [ off + dlen, @properties.length ].pack('V*')
  # Now, the Property Id and Offset for each
  @properties.each_with_index { |p,x|
    buf << p.pack_pio(off)
    off += data[x].length
  }
  # Finally, all the data
  buf << data.join
  buf
end
pack_fno(off = 0) click to toggle source
# File lib/rex/ole/propset.rb, line 51
def pack_fno(off = 0)
  @fmtid.pack + [ off ].pack('V')
end
to_s() click to toggle source
# File lib/rex/ole/propset.rb, line 79
def to_s
  "Rex::OLE::PropertySet - to_s unimplemented"
end