Sha256: b09e94a0625f2ca32185fba515e7c6fa2d023c7d756dada8b3b5ae12a101f294

Contents?: true

Size: 786 Bytes

Versions: 2

Compression:

Stored size: 786 Bytes

Contents

#!/usr/bin/env ruby
# -*- 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

2 entries across 2 versions & 1 rubygems

Version Path
librex-0.0.68 lib/rex/ole/samples/dump_stream.rb
librex-0.0.66 lib/rex/ole/samples/dump_stream.rb