Handle non-hex input properly

This commit is contained in:
HD Moore 2012-11-19 22:13:21 -06:00
parent c682bb6bb1
commit 5274a1331a
1 changed files with 6 additions and 1 deletions

View File

@ -25,7 +25,12 @@ end
value = ARGV.shift
len = ARGV.shift || 8192
value = value.hex if (value.length >= 8 and value.hex > 0)
if (value.length >= 8 and value.hex > 0)
value = value.hex
else
value = value[0,4].unpack("V").first
end
buffer = Rex::Text.pattern_create(len.to_i)
offset = Rex::Text.pattern_offset(buffer, value)