Parent

Methods

Class/Module Index [+]

Quicksearch

Rex::OLE::CLSID

Public Class Methods

new(buf=nil) click to toggle source
# File lib/rex/ole/clsid.rb, line 17
def initialize(buf=nil)
        @buf = buf
        @buf ||= "\x00" * 16
end

Public Instance Methods

pack() click to toggle source
# File lib/rex/ole/clsid.rb, line 22
def pack
        @buf
end
to_s() click to toggle source
# File lib/rex/ole/clsid.rb, line 26
def to_s
        ret = ""
        ret << "%08x" % Util.get32(@buf, 0)
        ret << "-"
        ret << "%04x" % Util.get16(@buf, 4)
        ret << "-"
        ret << "%04x" % Util.get16(@buf, 6)
        ret << "-"
        idx = 0
        last8 = @buf[8,8]
        last8.unpack('C*').each { |byte|
                ret << [byte].pack('C').unpack('H*')[0]
                ret << "-" if (idx == 1)
                idx += 1
        }
        ret
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.