Sha256: b016c4617a40bef3cdf8170dd4d7392000e18e11129f7a9b1f049e2a8c76822e

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

# -*- coding: binary -*-
##
# $Id: stream.rb 15548 2012-06-29 06:08:20Z rapid7 $
# Version: $Revision: 15548 $
##

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

module Rex
module OLE

class Stream < DirEntry

	def initialize(stg)
		super

		# for reading/writing from this
		@offset = 0
		@_mse = STGTY_STREAM
	end

	def close
		@mode = nil
		@offset = nil
	end

	def seek(offset)
		@offset = offset
	end

	def read(len)
		return nil if (not @data)

		ret = @data[@offset, len]
		@offset += len
		ret
	end

	def <<(expr)
		if (not @data)
			@data = expr.dup
		else
			@data << expr
		end
		@_ulSize = @data.length
	end

end

end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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