Add specs for #read_asciiz and fix bugs there
parent
f804d42ddc
commit
a677749f5b
|
@ -29,8 +29,12 @@ class ImageSource
|
|||
# FIXME, make me better
|
||||
string = ''
|
||||
loop do
|
||||
begin
|
||||
char = read(offset, 1)
|
||||
break if char == "\x00"
|
||||
rescue RangeError
|
||||
break
|
||||
end
|
||||
break if char.nil? || char == "\x00"
|
||||
offset += 1
|
||||
string << char
|
||||
end
|
||||
|
|
|
@ -17,6 +17,8 @@ describe Rex::ImageSource::Disk do
|
|||
described_class.new(file)
|
||||
end
|
||||
|
||||
it_should_behave_like 'Rex::ImageSource::ImageSource'
|
||||
|
||||
describe "#initialize" do
|
||||
subject(:disk_class) do
|
||||
described_class.allocate
|
||||
|
|
|
@ -11,6 +11,8 @@ describe Rex::ImageSource::Memory do
|
|||
described_class.new(raw_data)
|
||||
end
|
||||
|
||||
it_should_behave_like 'Rex::ImageSource::ImageSource'
|
||||
|
||||
describe "#initialize" do
|
||||
subject(:memory_class) do
|
||||
described_class.allocate
|
||||
|
|
Loading…
Reference in New Issue