Class: Rex::ImageSource::Memory
- Inherits:
-
Rex::ImageSource
- Object
- Rex::ImageSource
- Rex::ImageSource::Memory
- Defined in:
- lib/rex/image_source/memory.rb
Instance Attribute Summary collapse
-
#file_offset ⇒ Object
Returns the value of attribute file_offset.
-
#rawdata ⇒ Object
Returns the value of attribute rawdata.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #close ⇒ Object
- #index(*args) ⇒ Object
-
#initialize(_rawdata, _file_offset = 0) ⇒ Memory
constructor
A new instance of Memory.
- #read(offset, len) ⇒ Object
- #subsource(offset, len) ⇒ Object
Constructor Details
#initialize(_rawdata, _file_offset = 0) ⇒ Memory
Returns a new instance of Memory.
12 13 14 15 16 |
# File 'lib/rex/image_source/memory.rb', line 12 def initialize(_rawdata, _file_offset = 0) self.rawdata = _rawdata self.size = _rawdata.length self.file_offset = _file_offset end |
Instance Attribute Details
#file_offset ⇒ Object
Returns the value of attribute file_offset.
10 11 12 |
# File 'lib/rex/image_source/memory.rb', line 10 def file_offset @file_offset end |
#rawdata ⇒ Object
Returns the value of attribute rawdata.
10 11 12 |
# File 'lib/rex/image_source/memory.rb', line 10 def rawdata @rawdata end |
#size ⇒ Object
Returns the value of attribute size.
10 11 12 |
# File 'lib/rex/image_source/memory.rb', line 10 def size @size end |
Instance Method Details
#close ⇒ Object
26 27 |
# File 'lib/rex/image_source/memory.rb', line 26 def close end |
#index(*args) ⇒ Object
29 30 31 |
# File 'lib/rex/image_source/memory.rb', line 29 def index(*args) rawdata.index(*args) end |
#read(offset, len) ⇒ Object
18 19 20 |
# File 'lib/rex/image_source/memory.rb', line 18 def read(offset, len) rawdata[offset, len] end |
#subsource(offset, len) ⇒ Object
22 23 24 |
# File 'lib/rex/image_source/memory.rb', line 22 def subsource(offset, len) self.class.new(rawdata[offset, len], offset + file_offset) end |