Sha256: 149aa1adef42115b3b3e335d45824868350f3a5e3a70eef796dd9d63a6888d12

Contents?: true

Size: 786 Bytes

Versions: 24

Compression:

Stored size: 786 Bytes

Contents

# -*- coding: binary -*-

msfbase = __FILE__
while File.symlink?(msfbase)
  msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
path = File.expand_path(File.dirname(msfbase))
path += "/../../../"
$:.unshift(path)

require 'rex/ole'

if (ARGV.length < 2)
  $stderr.puts "usage: dump_stream <file> <stream>"
  exit(1)
end

document = ARGV.shift
stream = ARGV.shift

if (stg = Rex::OLE::Storage.new(document))
  if (stm = stg.open_stream(stream))
    data = stm.read(stm.length)
    data ||= ""
    $stderr.puts "Successfully opened the \"%s\" stream (%u bytes)" % [stream, data.length]
    $stdout.print data
    stm.close
  else
    $stderr.puts "Unable to open stream: #{stream}"
  end
  stg.close
else
  $stderr.puts "Unable to open storage: #{document}"
end

Version data entries

24 entries across 24 versions & 4 rubygems

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