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.35 lib/rex/image_source/memory.rb
librex-0.0.34 lib/rex/image_source/memory.rb
librex-0.0.33 lib/rex/image_source/memory.rb
librex-0.0.32 lib/rex/image_source/memory.rb
librex-0.0.31 lib/rex/image_source/memory.rb
librex-0.0.30 lib/rex/image_source/memory.rb
librex-0.0.29 lib/rex/image_source/memory.rb
librex-0.0.28 lib/rex/image_source/memory.rb
librex-0.0.27 lib/rex/image_source/memory.rb
librex-0.0.26 lib/rex/image_source/memory.rb
librex-0.0.25 lib/rex/image_source/memory.rb
librex-0.0.23 lib/rex/image_source/memory.rb
librex-0.0.21 lib/rex/image_source/memory.rb
librex-0.0.19 lib/rex/image_source/memory.rb
librex-0.0.17 lib/rex/image_source/memory.rb
librex-0.0.13 lib/rex/image_source/memory.rb
librex-0.0.12 lib/rex/image_source/memory.rb
librex-0.0.7 lib/rex/image_source/memory.rb
librex-0.0.6 lib/rex/image_source/memory.rb
librex-0.0.5 lib/rex/image_source/memory.rb