Sha256: 28d0fd5597efbb49bd14d0cc87b8c84d42a48424b61acf24cc3eb02d939d0065

Contents?: true

Size: 656 Bytes

Versions: 25

Compression:

Stored size: 656 Bytes

Contents

# -*- coding: binary -*-

##
# Rex::OLE - an OLE implementation
# written in 2010 by Joshua J. Drake <jduck [at] metasploit.com>
##


module Rex
module OLE

class CLSID

  def initialize(buf=nil)
    @buf = buf
    @buf ||= "\x00" * 16
  end

  def pack
    @buf
  end

  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

end

end
end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
rex-ole-0.1.9 lib/rex/ole/clsid.rb
rex-ole-0.1.8 lib/rex/ole/clsid.rb
rex-ole-0.1.7 lib/rex/ole/clsid.rb
rex-2.0.13 lib/rex/ole/clsid.rb
rex-2.0.12 lib/rex/ole/clsid.rb
rex-2.0.11 lib/rex/ole/clsid.rb
rex-ole-0.1.6 lib/rex/ole/clsid.rb
rex-ole-0.1.5 lib/rex/ole/clsid.rb
rex-ole-0.1.4 lib/rex/ole/clsid.rb
rex-ole-0.1.3 lib/rex/ole/clsid.rb
rex-ole-0.1.2 lib/rex/ole/clsid.rb
rex-ole-0.1.1 lib/rex/ole/clsid.rb
rex-ole-0.1.0 lib/rex/ole/clsid.rb
rex-2.0.10 lib/rex/ole/clsid.rb
rex-2.0.9 lib/rex/ole/clsid.rb
rex-2.0.8 lib/rex/ole/clsid.rb
rex-2.0.7 lib/rex/ole/clsid.rb
rex-2.0.5 lib/rex/ole/clsid.rb
rex-2.0.4 lib/rex/ole/clsid.rb
dstruct-0.0.1 lib/rex/ole/clsid.rb