ensure copy exists on DataStore too

GSoC/Meterpreter_Web_Console
Brent Cook 2018-04-24 06:32:38 -05:00
parent 505810ffd6
commit 1d376c78e2
1 changed files with 12 additions and 0 deletions

View File

@ -275,6 +275,18 @@ class DataStore < Hash
list.each(&block)
end
#
# Return a deep copy of this datastore.
#
def copy
clone = self.class.new
self.keys.each do |k|
clone.import_option(k, self[k].kind_of?(String) ? self[k].dup : self[k], @imported[k], @imported_by[k])
end
clone.aliases = self.aliases.dup
clone
end
protected
#