Files
metasploit-gs/lib/rex/image_source/image_source.rb
T

49 lines
704 B
Ruby
Raw Normal View History

# -*- coding: binary -*-
module Rex
module ImageSource
class ImageSource
2013-08-30 16:28:33 -05:00
#
# Um, just some abstract class stuff I guess, this is the interface
# that any image sources should subscribe to...
#
def subsource(offset, len)
raise "do something"
end
def size
raise "do something"
end
def file_offset
raise "do something"
end
def close
raise "do something"
end
def read_asciiz(offset)
# FIXME, make me better
string = ''
loop do
begin
char = read(offset, 1)
rescue RangeError
break
end
break if char.nil? || char == "\x00"
2013-08-30 16:28:33 -05:00
offset += 1
string << char
end
return string
end
2013-03-07 18:16:57 -06:00
end
2008-02-09 04:35:21 +00:00
end
2012-04-15 23:35:38 -05:00
end