Files
metasploit-gs/test/hooks/string_idx.rb
T

12 lines
284 B
Ruby
Raw Normal View History

2009-10-01 16:04:48 +00:00
class String
2013-09-30 13:47:53 -05:00
@@idx_reported = {}
def [](*args)
if args.length == 1 && args[0].class == ::Integer && !@@idx_reported[caller[0].to_s]
2013-09-30 13:47:53 -05:00
$stderr.puts "HOOK: String[idx] #{caller.join("\t")}\n\n"
@@idx_reported[caller[0].to_s] = true
end
slice(*args)
end
2009-10-01 16:04:48 +00:00
end