1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00
metasploit-framework/tools/pattern_offset.rb
Ramon de C Valle f124597a56 Code cleanups
git-svn-id: file:///home/svn/framework3/trunk@5773 4d416f70-5f16-0410-b530-b9f4589650da
2008-10-19 21:03:39 +00:00

20 lines
564 B
Ruby
Executable File

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rex'
if ARGV.length < 1
$stderr.puts("Usage: #{File.basename($0)} <search item> <length of buffer>")
$stderr.puts("Default length of buffer if none is inserted: 8192")
$stderr.puts("This buffer is generated by pattern_create() in the Rex library automatically")
exit
end
value = ARGV.shift
len = ARGV.shift || 8192
value = value.hex if (value.length >= 8 and value.hex > 0)
buffer = Rex::Text.pattern_create(len.to_i)
puts Rex::Text.pattern_offset(buffer, value)