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.



16
17
18
19
20
# File 'lib/rex/ole/propset.rb', line 16

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

Instance Method Details

#pack_dataObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rex/ole/propset.rb', line 26

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



22
23
24
# File 'lib/rex/ole/propset.rb', line 22

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

#to_sObject



38
39
40
# File 'lib/rex/ole/propset.rb', line 38

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