Class: Rex::OLE::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/ole/propset.rb

Instance Method Summary collapse

Constructor Details

#initialize(id, type, data) ⇒ Property

Returns a new instance of Property


13
14
15
16
17
# File 'lib/rex/ole/propset.rb', line 13

def initialize(id, type, data)
  @id = id
  @type = type
  @data = data
end

Instance Method Details

#pack_dataObject


23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rex/ole/propset.rb', line 23

def pack_data
  buf = [ @type ].pack('V')
  case @type
  when VT_BLOB
    buf << [ @data.length ].pack('V')
  when VT_CF
    buf << [ 4 + @data.length, -1 ].pack('V*')
  end
  buf << @data
  buf
end

#pack_pio(off = 0) ⇒ Object


19
20
21
# File 'lib/rex/ole/propset.rb', line 19

def pack_pio(off = 0)
  [ @id, off ].pack('V*')
end

#to_sObject


35
36
37
# File 'lib/rex/ole/propset.rb', line 35

def to_s
  "Rex::OLE::Property - to_s unimplemented"
end