Sha256: e0a98812b35785783444a57febe161dfb5dd066027a616f7ae32c82c8766caf7

Contents?: true

Size: 613 Bytes

Versions: 43

Compression:

Stored size: 613 Bytes

Contents

#!/usr/bin/env ruby

# $Id: memory.rb 5401 2008-02-09 04:35:21Z ramon $

require 'rex/image_source/image_source'
require 'rex/struct2'

module Rex
module ImageSource
class Memory < ImageSource

	attr_accessor :rawdata, :size, :file_offset

	def initialize(_rawdata, _file_offset = 0)
		self.rawdata     = _rawdata
		self.size        = _rawdata.length
		self.file_offset = _file_offset
	end

	def read(offset, len)
		rawdata[offset, len]
	end

	def subsource(offset, len)
		self.class.new(rawdata[offset, len], offset + file_offset)
	end

	def close
	end

	def index(*args)
		rawdata.index(*args)
	end
end

end
end

Version data entries

43 entries across 43 versions & 1 rubygems

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