Sha256: dde5da3788323a88f2c48b090008f65a706bba5e67d6add54adf1c3ec8658656

Contents?: true

Size: 761 Bytes

Versions: 42

Compression:

Stored size: 761 Bytes

Contents

#!/usr/bin/env ruby

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

42 entries across 42 versions & 1 rubygems

Version Path
librex-0.0.65 lib/rex/ole/samples/dump_stream.rb
librex-0.0.63 lib/rex/ole/samples/dump_stream.rb
librex-0.0.54 lib/rex/ole/samples/dump_stream.rb
librex-0.0.53 lib/rex/ole/samples/dump_stream.rb
librex-0.0.52 lib/rex/ole/samples/dump_stream.rb
librex-0.0.51 lib/rex/ole/samples/dump_stream.rb
librex-0.0.50 lib/rex/ole/samples/dump_stream.rb
librex-0.0.49 lib/rex/ole/samples/dump_stream.rb
librex-0.0.48 lib/rex/ole/samples/dump_stream.rb
librex-0.0.47 lib/rex/ole/samples/dump_stream.rb
librex-0.0.46 lib/rex/ole/samples/dump_stream.rb
librex-0.0.44 lib/rex/ole/samples/dump_stream.rb
librex-0.0.43 lib/rex/ole/samples/dump_stream.rb
librex-0.0.42 lib/rex/ole/samples/dump_stream.rb
librex-0.0.41 lib/rex/ole/samples/dump_stream.rb
librex-0.0.40 lib/rex/ole/samples/dump_stream.rb
librex-0.0.39 lib/rex/ole/samples/dump_stream.rb
librex-0.0.38 lib/rex/ole/samples/dump_stream.rb
librex-0.0.37 lib/rex/ole/samples/dump_stream.rb
librex-0.0.36 lib/rex/ole/samples/dump_stream.rb