652 lines
27 KiB
HTML
652 lines
27 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>
|
||
Class: Msf::ModuleDataStore
|
||
|
||
— Documentation by YARD 0.9.37
|
||
|
||
</title>
|
||
|
||
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
||
|
||
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
||
|
||
<script type="text/javascript">
|
||
pathId = "Msf::ModuleDataStore";
|
||
relpath = '../';
|
||
</script>
|
||
|
||
|
||
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
||
|
||
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
||
|
||
|
||
</head>
|
||
<body>
|
||
<div class="nav_wrap">
|
||
<iframe id="nav" src="../class_list.html?1"></iframe>
|
||
<div id="resizer"></div>
|
||
</div>
|
||
|
||
<div id="main" tabindex="-1">
|
||
<div id="header">
|
||
<div id="menu">
|
||
|
||
<a href="../_index.html">Index (M)</a> »
|
||
<span class='title'><span class='object_link'><a href="../Msf.html" title="Msf (module)">Msf</a></span></span>
|
||
»
|
||
<span class="title">ModuleDataStore</span>
|
||
|
||
</div>
|
||
|
||
<div id="search">
|
||
|
||
<a class="full_list_link" id="class_list_link"
|
||
href="../class_list.html">
|
||
|
||
<svg width="24" height="24">
|
||
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
||
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
||
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
||
</svg>
|
||
</a>
|
||
|
||
</div>
|
||
<div class="clear"></div>
|
||
</div>
|
||
|
||
<div id="content"><h1>Class: Msf::ModuleDataStore
|
||
|
||
|
||
|
||
</h1>
|
||
<div class="box_info">
|
||
|
||
<dl>
|
||
<dt>Inherits:</dt>
|
||
<dd>
|
||
<span class="inheritName"><span class='object_link'><a href="DataStore.html" title="Msf::DataStore (class)">DataStore</a></span></span>
|
||
|
||
<ul class="fullTree">
|
||
<li>Object</li>
|
||
|
||
<li class="next"><span class='object_link'><a href="DataStore.html" title="Msf::DataStore (class)">DataStore</a></span></li>
|
||
|
||
<li class="next">Msf::ModuleDataStore</li>
|
||
|
||
</ul>
|
||
<a href="#" class="inheritanceTree">show all</a>
|
||
|
||
</dd>
|
||
</dl>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<dl>
|
||
<dt>Defined in:</dt>
|
||
<dd>lib/msf/core/module_data_store.rb</dd>
|
||
</dl>
|
||
|
||
</div>
|
||
|
||
<h2>Overview</h2><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>DataStore wrapper for modules that will attempt to back values against the framework’s datastore if they aren’t found in the module’s datastore. This is done to simulate global data store values.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<h2>Constant Summary</h2>
|
||
|
||
<h3 class="inherited">Constants inherited
|
||
from <span class='object_link'><a href="DataStore.html" title="Msf::DataStore (class)">DataStore</a></span></h3>
|
||
<p class="inherited"><span class='object_link'><a href="DataStore.html#GLOBAL_KEYS-constant" title="Msf::DataStore::GLOBAL_KEYS (constant)">DataStore::GLOBAL_KEYS</a></span>, <span class='object_link'><a href="DataStore.html#GLOBAL_OPTION_DEFINITIONS-constant" title="Msf::DataStore::GLOBAL_OPTION_DEFINITIONS (constant)">DataStore::GLOBAL_OPTION_DEFINITIONS</a></span></p>
|
||
|
||
|
||
|
||
|
||
<h2>Instance Attribute Summary</h2>
|
||
|
||
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="DataStore.html" title="Msf::DataStore (class)">DataStore</a></span></h3>
|
||
<p class="inherited"><span class='object_link'><a href="DataStore.html#aliases-instance_method" title="Msf::DataStore#aliases (method)">#aliases</a></span>, <span class='object_link'><a href="DataStore.html#defaults-instance_method" title="Msf::DataStore#defaults (method)">#defaults</a></span>, <span class='object_link'><a href="DataStore.html#options-instance_method" title="Msf::DataStore#options (method)">#options</a></span>, <span class='object_link'><a href="DataStore.html#user_defined-instance_method" title="Msf::DataStore#user_defined (method)">#user_defined</a></span></p>
|
||
|
||
|
||
|
||
<h2>
|
||
Instance Method Summary
|
||
<small><a href="#" class="summary_toggle">collapse</a></small>
|
||
</h2>
|
||
|
||
<ul class="summary">
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#copy-instance_method" title="#copy (instance method)">#<strong>copy</strong> ⇒ Msf::DataStore </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Return a copy of this datastore.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(m) ⇒ ModuleDataStore </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
<span class="note title constructor">constructor</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>A new instance of ModuleDataStore.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="public ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#search_for-instance_method" title="#search_for (instance method)">#<strong>search_for</strong>(key) ⇒ DataStoreSearchResult </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Search for a value within the current datastore, taking into consideration any registered aliases, fallbacks, etc.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="protected ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#search_framework_datastore-instance_method" title="#search_framework_datastore (instance method)">#<strong>search_framework_datastore</strong>(key) ⇒ DataStoreSearchResult </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
<span class="note title protected">protected</span>
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'>
|
||
<p>Search the framework datastore.</p>
|
||
</div></span>
|
||
|
||
</li>
|
||
|
||
|
||
<li class="protected ">
|
||
<span class="summary_signature">
|
||
|
||
<a href="#search_result-instance_method" title="#search_result (instance method)">#<strong>search_result</strong>(result, value, fallback_key: nil) ⇒ Object </a>
|
||
|
||
|
||
|
||
</span>
|
||
|
||
|
||
|
||
<span class="note title protected">protected</span>
|
||
|
||
|
||
|
||
|
||
|
||
<span class="summary_desc"><div class='inline'></div></span>
|
||
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="DataStore.html" title="Msf::DataStore (class)">DataStore</a></span></h3>
|
||
<p class="inherited"><span class='object_link'><a href="DataStore.html#[]-instance_method" title="Msf::DataStore#[] (method)">#[]</a></span>, <span class='object_link'><a href="DataStore.html#[]=-instance_method" title="Msf::DataStore#[]= (method)">#[]=</a></span>, <span class='object_link'><a href="DataStore.html#clear-instance_method" title="Msf::DataStore#clear (method)">#clear</a></span>, <span class='object_link'><a href="DataStore.html#copy_state-instance_method" title="Msf::DataStore#copy_state (method)">#copy_state</a></span>, <span class='object_link'><a href="DataStore.html#default%3F-instance_method" title="Msf::DataStore#default? (method)">#default?</a></span>, <span class='object_link'><a href="DataStore.html#delete-instance_method" title="Msf::DataStore#delete (method)">#delete</a></span>, <span class='object_link'><a href="DataStore.html#each-instance_method" title="Msf::DataStore#each (method)">#each</a></span>, <span class='object_link'><a href="DataStore.html#each_key-instance_method" title="Msf::DataStore#each_key (method)">#each_key</a></span>, <span class='object_link'><a href="DataStore.html#find_key_case-instance_method" title="Msf::DataStore#find_key_case (method)">#find_key_case</a></span>, <span class='object_link'><a href="DataStore.html#from_file-instance_method" title="Msf::DataStore#from_file (method)">#from_file</a></span>, <span class='object_link'><a href="DataStore.html#import_defaults_from_hash-instance_method" title="Msf::DataStore#import_defaults_from_hash (method)">#import_defaults_from_hash</a></span>, <span class='object_link'><a href="DataStore.html#import_option-instance_method" title="Msf::DataStore#import_option (method)">#import_option</a></span>, <span class='object_link'><a href="DataStore.html#import_options-instance_method" title="Msf::DataStore#import_options (method)">#import_options</a></span>, <span class='object_link'><a href="DataStore.html#import_options_from_hash-instance_method" title="Msf::DataStore#import_options_from_hash (method)">#import_options_from_hash</a></span>, <span class='object_link'><a href="DataStore.html#import_options_from_s-instance_method" title="Msf::DataStore#import_options_from_s (method)">#import_options_from_s</a></span>, <span class='object_link'><a href="DataStore.html#key%3F-instance_method" title="Msf::DataStore#key? (method)">#key?</a></span>, <span class='object_link'><a href="DataStore.html#key_error_for-instance_method" title="Msf::DataStore#key_error_for (method)">#key_error_for</a></span>, <span class='object_link'><a href="DataStore.html#keys-instance_method" title="Msf::DataStore#keys (method)">#keys</a></span>, <span class='object_link'><a href="DataStore.html#length-instance_method" title="Msf::DataStore#length (method)">#length</a></span>, <span class='object_link'><a href="DataStore.html#merge-instance_method" title="Msf::DataStore#merge (method)">#merge</a></span>, <span class='object_link'><a href="DataStore.html#merge!-instance_method" title="Msf::DataStore#merge! (method)">#merge!</a></span>, <span class='object_link'><a href="DataStore.html#remove_option-instance_method" title="Msf::DataStore#remove_option (method)">#remove_option</a></span>, <span class='object_link'><a href="DataStore.html#reverse_merge!-instance_method" title="Msf::DataStore#reverse_merge! (method)">#reverse_merge!</a></span>, <span class='object_link'><a href="DataStore.html#store-instance_method" title="Msf::DataStore#store (method)">#store</a></span>, <span class='object_link'><a href="DataStore.html#to_external_message_h-instance_method" title="Msf::DataStore#to_external_message_h (method)">#to_external_message_h</a></span>, <span class='object_link'><a href="DataStore.html#to_file-instance_method" title="Msf::DataStore#to_file (method)">#to_file</a></span>, <span class='object_link'><a href="DataStore.html#to_h-instance_method" title="Msf::DataStore#to_h (method)">#to_h</a></span>, <span class='object_link'><a href="DataStore.html#to_s-instance_method" title="Msf::DataStore#to_s (method)">#to_s</a></span>, <span class='object_link'><a href="DataStore.html#unset-instance_method" title="Msf::DataStore#unset (method)">#unset</a></span>, <span class='object_link'><a href="DataStore.html#update_value-instance_method" title="Msf::DataStore#update_value (method)">#update_value</a></span></p>
|
||
<div id="constructor_details" class="method_details_list">
|
||
<h2>Constructor Details</h2>
|
||
|
||
<div class="method_details first">
|
||
<h3 class="signature first" id="initialize-instance_method">
|
||
|
||
#<strong>initialize</strong>(m) ⇒ <tt><span class='object_link'><a href="" title="Msf::ModuleDataStore (class)">ModuleDataStore</a></span></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Returns a new instance of ModuleDataStore.</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>m</span>
|
||
|
||
|
||
<span class='type'>(<tt><span class='object_link'><a href="Module.html" title="Msf::Module (class)">Msf::Module</a></span></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
14
|
||
15
|
||
16
|
||
17
|
||
18</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/module_data_store.rb', line 14</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_m'>m</span><span class='rparen'>)</span>
|
||
<span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
||
|
||
<span class='ivar'>@_module</span> <span class='op'>=</span> <span class='id identifier rubyid_m'>m</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
|
||
<div id="instance_method_details" class="method_details_list">
|
||
<h2>Instance Method Details</h2>
|
||
|
||
|
||
<div class="method_details first">
|
||
<h3 class="signature first" id="copy-instance_method">
|
||
|
||
#<strong>copy</strong> ⇒ <tt><span class='object_link'><a href="DataStore.html" title="Msf::DataStore (class)">Msf::DataStore</a></span></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Return a copy of this datastore. Only string values will be duplicated, other values will share the same reference</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt><span class='object_link'><a href="DataStore.html" title="Msf::DataStore (class)">Msf::DataStore</a></span></tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>a new datastore instance</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
24
|
||
25
|
||
26
|
||
27
|
||
28</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/module_data_store.rb', line 24</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_copy'>copy</span>
|
||
<span class='id identifier rubyid_new_instance'>new_instance</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@_module</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_new_instance'>new_instance</span><span class='period'>.</span><span class='id identifier rubyid_copy_state'>copy_state</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_new_instance'>new_instance</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="search_for-instance_method">
|
||
|
||
#<strong>search_for</strong>(key) ⇒ <tt><span class='object_link'><a href="DataStore/DataStoreSearchResult.html" title="Msf::DataStore::DataStoreSearchResult (class)">DataStoreSearchResult</a></span></tt>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Search for a value within the current datastore, taking into consideration any registered aliases, fallbacks, etc. If a value is not present in the current datastore, the global parent store will be referenced instead</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>key</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The key to search for</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt><span class='object_link'><a href="DataStore/DataStoreSearchResult.html" title="Msf::DataStore::DataStoreSearchResult (class)">DataStoreSearchResult</a></span></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
35
|
||
36
|
||
37
|
||
38
|
||
39
|
||
40
|
||
41
|
||
42
|
||
43
|
||
44
|
||
45
|
||
46
|
||
47
|
||
48
|
||
49
|
||
50
|
||
51
|
||
52
|
||
53
|
||
54
|
||
55
|
||
56
|
||
57
|
||
58
|
||
59
|
||
60
|
||
61
|
||
62</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/module_data_store.rb', line 35</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_search_for'>search_for</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
||
<span class='id identifier rubyid_k'>k</span> <span class='op'>=</span> <span class='id identifier rubyid_find_key_case'>find_key_case</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
||
<span class='kw'>return</span> <span class='id identifier rubyid_search_result'>search_result</span><span class='lparen'>(</span><span class='symbol'>:user_defined</span><span class='comma'>,</span> <span class='ivar'>@user_defined</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@user_defined</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span>
|
||
|
||
<span class='comment'># Preference globally set values over a module's option default
|
||
</span> <span class='id identifier rubyid_framework_datastore_search'>framework_datastore_search</span> <span class='op'>=</span> <span class='id identifier rubyid_search_framework_datastore'>search_framework_datastore</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
||
<span class='kw'>return</span> <span class='id identifier rubyid_framework_datastore_search'>framework_datastore_search</span> <span class='kw'>if</span> <span class='id identifier rubyid_framework_datastore_search'>framework_datastore_search</span><span class='period'>.</span><span class='id identifier rubyid_found?'>found?</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_framework_datastore_search'>framework_datastore_search</span><span class='period'>.</span><span class='id identifier rubyid_default?'>default?</span>
|
||
|
||
<span class='id identifier rubyid_option'>option</span> <span class='op'>=</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_option_name'>option_name</span><span class='comma'>,</span> <span class='id identifier rubyid__option'>_option</span><span class='op'>|</span> <span class='id identifier rubyid_option_name'>option_name</span><span class='period'>.</span><span class='id identifier rubyid_casecmp?'>casecmp?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='op'>&.</span><span class='id identifier rubyid_last'>last</span> <span class='rbrace'>}</span>
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_option'>option</span>
|
||
<span class='comment'># If the key isn't present - check any additional fallbacks that have been registered with the option.
|
||
</span> <span class='comment'># i.e. handling the scenario of SMBUser not being explicitly set, but the option has registered a more
|
||
</span> <span class='comment'># generic 'Username' fallback
|
||
</span> <span class='id identifier rubyid_option'>option</span><span class='period'>.</span><span class='id identifier rubyid_fallbacks'>fallbacks</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_fallback'>fallback</span><span class='op'>|</span>
|
||
<span class='id identifier rubyid_fallback_search'>fallback_search</span> <span class='op'>=</span> <span class='id identifier rubyid_search_for'>search_for</span><span class='lparen'>(</span><span class='id identifier rubyid_fallback'>fallback</span><span class='rparen'>)</span>
|
||
<span class='kw'>if</span> <span class='id identifier rubyid_fallback_search'>fallback_search</span><span class='period'>.</span><span class='id identifier rubyid_found?'>found?</span>
|
||
<span class='kw'>return</span> <span class='id identifier rubyid_search_result'>search_result</span><span class='lparen'>(</span><span class='symbol'>:option_fallback</span><span class='comma'>,</span> <span class='id identifier rubyid_fallback_search'>fallback_search</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>fallback_key:</span> <span class='id identifier rubyid_fallback'>fallback</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span>
|
||
<span class='kw'>end</span>
|
||
<span class='kw'>end</span>
|
||
|
||
<span class='comment'># Checking for imported default values, ignoring case again TODO: add Alias test for this
|
||
</span> <span class='id identifier rubyid_imported_default_match'>imported_default_match</span> <span class='op'>=</span> <span class='ivar'>@defaults</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_default_key'>default_key</span><span class='comma'>,</span> <span class='id identifier rubyid__default_value'>_default_value</span><span class='op'>|</span> <span class='id identifier rubyid_default_key'>default_key</span><span class='period'>.</span><span class='id identifier rubyid_casecmp?'>casecmp?</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
||
<span class='kw'>return</span> <span class='id identifier rubyid_search_result'>search_result</span><span class='lparen'>(</span><span class='symbol'>:imported_default</span><span class='comma'>,</span> <span class='id identifier rubyid_imported_default_match'>imported_default_match</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_imported_default_match'>imported_default_match</span>
|
||
<span class='kw'>return</span> <span class='id identifier rubyid_search_result'>search_result</span><span class='lparen'>(</span><span class='symbol'>:option_default</span><span class='comma'>,</span> <span class='id identifier rubyid_option'>option</span><span class='period'>.</span><span class='id identifier rubyid_default'>default</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_option'>option</span>
|
||
|
||
<span class='id identifier rubyid_search_framework_datastore'>search_framework_datastore</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="search_framework_datastore-instance_method">
|
||
|
||
#<strong>search_framework_datastore</strong>(key) ⇒ <tt><span class='object_link'><a href="DataStore/DataStoreSearchResult.html" title="Msf::DataStore::DataStoreSearchResult (class)">DataStoreSearchResult</a></span></tt> <span class="extras">(protected)</span>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><div class="docstring">
|
||
<div class="discussion">
|
||
|
||
<p>Search the framework datastore</p>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="tags">
|
||
<p class="tag_title">Parameters:</p>
|
||
<ul class="param">
|
||
|
||
<li>
|
||
|
||
<span class='name'>key</span>
|
||
|
||
|
||
<span class='type'>(<tt>String</tt>)</span>
|
||
|
||
|
||
|
||
—
|
||
<div class='inline'>
|
||
<p>The key to search for</p>
|
||
</div>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
<p class="tag_title">Returns:</p>
|
||
<ul class="return">
|
||
|
||
<li>
|
||
|
||
|
||
<span class='type'>(<tt><span class='object_link'><a href="DataStore/DataStoreSearchResult.html" title="Msf::DataStore::DataStoreSearchResult (class)">DataStoreSearchResult</a></span></tt>)</span>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</div><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
70
|
||
71
|
||
72
|
||
73
|
||
74</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/module_data_store.rb', line 70</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_search_framework_datastore'>search_framework_datastore</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
||
<span class='kw'>return</span> <span class='id identifier rubyid_search_result'>search_result</span><span class='lparen'>(</span><span class='symbol'>:not_found</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@_module</span><span class='op'>&.</span><span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
||
|
||
<span class='ivar'>@_module</span><span class='period'>.</span><span class='id identifier rubyid_framework'>framework</span><span class='period'>.</span><span class='id identifier rubyid_datastore'>datastore</span><span class='period'>.</span><span class='id identifier rubyid_search_for'>search_for</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="method_details ">
|
||
<h3 class="signature " id="search_result-instance_method">
|
||
|
||
#<strong>search_result</strong>(result, value, fallback_key: nil) ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
||
|
||
|
||
|
||
|
||
|
||
</h3><table class="source_code">
|
||
<tr>
|
||
<td>
|
||
<pre class="lines">
|
||
|
||
|
||
76
|
||
77
|
||
78</pre>
|
||
</td>
|
||
<td>
|
||
<pre class="code"><span class="info file"># File 'lib/msf/core/module_data_store.rb', line 76</span>
|
||
|
||
<span class='kw'>def</span> <span class='id identifier rubyid_search_result'>search_result</span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>fallback_key:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
||
<span class='const'><span class='object_link'><a href="DataStore/DataStoreSearchResult.html" title="Msf::DataStore::DataStoreSearchResult (class)">DataStoreSearchResult</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DataStore/DataStoreSearchResult.html#initialize-instance_method" title="Msf::DataStore::DataStoreSearchResult#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_result'>result</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='label'>namespace:</span> <span class='symbol'>:module_data_store</span><span class='comma'>,</span> <span class='label'>fallback_key:</span> <span class='id identifier rubyid_fallback_key'>fallback_key</span><span class='rparen'>)</span>
|
||
<span class='kw'>end</span></pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div id="footer">
|
||
Generated on Fri May 8 17:03:27 2026 by
|
||
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
||
0.9.37 (ruby-3.1.5).
|
||
</div>
|
||
|
||
</div>
|
||
</body>
|
||
</html> |