lib/rex/image_source/memory.rb in librex-0.0.68 vs lib/rex/image_source/memory.rb in librex-0.0.70

- old
+ new

@@ -1,38 +1,35 @@ -#!/usr/bin/env ruby # -*- coding: binary -*- -# $Id: memory.rb 15548 2012-06-29 06:08:20Z rapid7 $ - require 'rex/image_source/image_source' require 'rex/struct2' module Rex module ImageSource class Memory < ImageSource - attr_accessor :rawdata, :size, :file_offset + 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 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 read(offset, len) + rawdata[offset, len] + end - def subsource(offset, len) - self.class.new(rawdata[offset, len], offset + file_offset) - end + def subsource(offset, len) + self.class.new(rawdata[offset, len], offset + file_offset) + end - def close - end + def close + end - def index(*args) - rawdata.index(*args) - end + def index(*args) + rawdata.index(*args) + end end end end