Class: Ronin::Exploits::Loot Private
- Inherits:
-
Object
- Object
- Ronin::Exploits::Loot
- Includes:
- Enumerable
- Defined in:
- lib/ronin/exploits/loot.rb,
lib/ronin/exploits/loot/file.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents an exploit's loot store.
Defined Under Namespace
Classes: File
Instance Method Summary collapse
-
#[](path) ⇒ File?
private
Accesses a loot file in the loot store.
-
#add(path, contents, **kwargs) ⇒ Object
Adds a captured loot file to the loot store.
-
#each {|file| ... } ⇒ Enumerator
private
Enumerates over each loot file.
-
#empty? ⇒ Boolean
private
Determines if the loot store is empty or not.
-
#initialize ⇒ Loot
constructor
private
Initializes the loot store.
-
#save(output_dir) ⇒ Object
private
Saves the loot files to the output directory.
Constructor Details
#initialize ⇒ Loot
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the loot store.
42 43 44 |
# File 'lib/ronin/exploits/loot.rb', line 42 def initialize @files = {} end |
Instance Method Details
#[](path) ⇒ File?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Accesses a loot file in the loot store.
76 77 78 |
# File 'lib/ronin/exploits/loot.rb', line 76 def [](path) @files[path] end |
#add(path, contents, **kwargs) ⇒ Object
Adds a captured loot file to the loot store.
63 64 65 |
# File 'lib/ronin/exploits/loot.rb', line 63 def add(path,contents,**kwargs) @files[path] = File.new(path,contents,**kwargs) end |
#each {|file| ... } ⇒ Enumerator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Enumerates over each loot file.
92 93 94 |
# File 'lib/ronin/exploits/loot.rb', line 92 def each(&block) @files.each_value(&block) end |
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Determines if the loot store is empty or not.
101 102 103 |
# File 'lib/ronin/exploits/loot.rb', line 101 def empty? @files.empty? end |
#save(output_dir) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Saves the loot files to the output directory.
110 111 112 113 114 115 116 |
# File 'lib/ronin/exploits/loot.rb', line 110 def save(output_dir) FileUtils.mkdir_p(output_dir) @files.each_value do |file| file.save(output_dir) end end |