1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-05 14:57:30 +01:00

Commit some testing tools

git-svn-id: file:///home/svn/framework3/trunk@7106 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2009-10-01 16:04:48 +00:00
parent 5f010aa4b9
commit 43a3b80401
3 changed files with 27 additions and 0 deletions

10
test/hooks/array_to_s.rb Normal file
View File

@ -0,0 +1,10 @@
class Array
@@to_s_reported = {}
def to_s(*args)
if(not @@to_s_reported[caller[0].to_s])
$stderr.puts "HOOK: Array#to_s at #{caller.join("\t")}"
@@to_s_reported[caller[0].to_s] = true
end
super(*args)
end
end

11
test/hooks/string_idx.rb Normal file
View File

@ -0,0 +1,11 @@
class String
@@idx_reported = {}
def [](*args)
if(args.length == 1 and args[0].class == ::Fixnum and not @@idx_reported[caller[0].to_s])
$stderr.puts "HOOK: String[idx] #{caller.join("\t")}\n\n"
@@idx_reported[caller[0].to_s] = true
end
slice(*args)
end
end

6
test/testbase.rb Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env
$:.unshift(File.join(File.expand_path(File.dirname(__FILE__))), '..', 'lib')
require 'rex'
require 'msf/core'