Files
metasploit-gs/api/Metasploit/Framework/Obfuscation/CRandomizer/RandomStatements.html
T
jenkins-metasploit c3f5bd3de2 Reboot gh-pages
2026-05-08 17:08:43 +00:00

566 lines
14 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Metasploit::Framework::Obfuscation::CRandomizer::RandomStatements
&mdash; 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 = "Metasploit::Framework::Obfuscation::CRandomizer::RandomStatements";
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 (R)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../../../Metasploit.html" title="Metasploit (module)">Metasploit</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../../Framework.html" title="Metasploit::Framework (module)">Framework</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Obfuscation.html" title="Metasploit::Framework::Obfuscation (module)">Obfuscation</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../CRandomizer.html" title="Metasploit::Framework::Obfuscation::CRandomizer (module)">CRandomizer</a></span></span>
&raquo;
<span class="title">RandomStatements</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: Metasploit::Framework::Obfuscation::CRandomizer::RandomStatements
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Metasploit::Framework::Obfuscation::CRandomizer::RandomStatements</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/metasploit/framework/obfuscation/crandomizer/random_statements.rb</dd>
</dl>
</div>
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#fake_function_collection-instance_method" title="#fake_function_collection (instance method)">#<strong>fake_function_collection</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute fake_function_collection.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#parser-instance_method" title="#parser (instance method)">#<strong>parser</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute parser.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#statements-instance_method" title="#statements (instance method)">#<strong>statements</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute statements.</p>
</div></span>
</li>
</ul>
<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="#get-instance_method" title="#get (instance method)">#<strong>get</strong> &#x21d2; Array&lt;Metasm::C::CExpression&gt;, Array&lt;Metasm::C::Declaration&gt; </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a random statement.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(p, fake_functions, s = nil) &#x21d2; RandomStatements </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>Initializes the RandomStatements class.</p>
</div></span>
</li>
</ul>
<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>(p, fake_functions, s = nil) &#x21d2; <tt><span class='object_link'><a href="" title="Metasploit::Framework::Obfuscation::CRandomizer::RandomStatements (class)">RandomStatements</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Initializes the RandomStatements class.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>fake_functions</span>
<span class='type'>(<tt><span class='object_link'><a href="CodeFactory/FakeFunctionCollection.html" title="Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::FakeFunctionCollection (class)">Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::FakeFunctionCollection</a></span></tt>)</span>
</li>
<li>
<span class='name'>s</span>
<span class='type'>(<tt>Metasm::C::Declaration</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
18
19
20
21
22
23
24
25
26
27
28</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/obfuscation/crandomizer/random_statements.rb', line 18</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='comma'>,</span> <span class='id identifier rubyid_fake_functions'>fake_functions</span><span class='comma'>,</span> <span class='id identifier rubyid_s'>s</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
<span class='ivar'>@parser</span> <span class='op'>=</span> <span class='id identifier rubyid_p'>p</span>
<span class='ivar'>@fake_function_collection</span> <span class='op'>=</span> <span class='id identifier rubyid_fake_functions'>fake_functions</span>
<span class='ivar'>@statements</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='const'>Proc</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_get_random_statements'>get_random_statements</span> <span class='rbrace'>}</span> <span class='rbracket'>]</span>
<span class='comment'># Only generate fake function calls when the function we are modifying isn&#39;t
</span> <span class='comment'># from one of those fake functions (to avoid a recursion).
</span> <span class='kw'>if</span> <span class='id identifier rubyid_s'>s</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_fake_function_collection'>fake_function_collection</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_fake_function_collection'>fake_function_collection</span><span class='period'>.</span><span class='id identifier rubyid_has_function_name?'>has_function_name?</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_var'>var</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='ivar'>@statements</span> <span class='op'>&lt;&lt;</span> <span class='const'>Proc</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_get_random_function_call'>get_random_function_call</span> <span class='rbrace'>}</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id=""></span>
<div class="method_details first">
<h3 class="signature first" id="fake_function_collection-instance_method">
#<strong>fake_function_collection</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute fake_function_collection.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
11
12
13</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/obfuscation/crandomizer/random_statements.rb', line 11</span>
<span class='kw'>def</span> <span class='id identifier rubyid_fake_function_collection'>fake_function_collection</span>
<span class='ivar'>@fake_function_collection</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="parser-instance_method">
#<strong>parser</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute parser.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
10
11
12</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/obfuscation/crandomizer/random_statements.rb', line 10</span>
<span class='kw'>def</span> <span class='id identifier rubyid_parser'>parser</span>
<span class='ivar'>@parser</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="statements-instance_method">
#<strong>statements</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute statements.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
12
13
14</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/obfuscation/crandomizer/random_statements.rb', line 12</span>
<span class='kw'>def</span> <span class='id identifier rubyid_statements'>statements</span>
<span class='ivar'>@statements</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="get-instance_method">
#<strong>get</strong> &#x21d2; <tt>Array&lt;Metasm::C::CExpression&gt;</tt>, <tt>Array&lt;Metasm::C::Declaration&gt;</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a random statement.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Array&lt;Metasm::C::CExpression&gt;</tt>)</span>
</li>
<li>
<span class='type'>(<tt>Array&lt;Metasm::C::Declaration&gt;</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
34
35
36</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/metasploit/framework/obfuscation/crandomizer/random_statements.rb', line 34</span>
<span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span>
<span class='id identifier rubyid_statements'>statements</span><span class='period'>.</span><span class='id identifier rubyid_sample'>sample</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Fri May 8 17:04:04 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>