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.



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

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

Instance Method Details

#pack_dataObject



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

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



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

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

#to_sObject



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

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