Files
metasploit-gs/api/Msf/Encoder/XorAdditiveFeedback.html
T
jenkins-metasploit c3f5bd3de2 Reboot gh-pages
2026-05-08 17:08:43 +00:00

906 lines
62 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Msf::Encoder::XorAdditiveFeedback
&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 = "Msf::Encoder::XorAdditiveFeedback";
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 (X)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../Msf.html" title="Msf (module)">Msf</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Encoder.html" title="Msf::Encoder (class)">Encoder</a></span></span>
&raquo;
<span class="title">XorAdditiveFeedback</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::Encoder::XorAdditiveFeedback
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="Xor.html" title="Msf::Encoder::Xor (class)">Xor</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="../Module.html" title="Msf::Module (class)">Module</a></span></li>
<li class="next"><span class='object_link'><a href="../Encoder.html" title="Msf::Encoder (class)">Msf::Encoder</a></span></li>
<li class="next"><span class='object_link'><a href="Xor.html" title="Msf::Encoder::Xor (class)">Xor</a></span></li>
<li class="next">Msf::Encoder::XorAdditiveFeedback</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/msf/core/encoder/xor_additive_feedback.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>This class performs per-block XOR additive feedback encoding.</p>
</div>
</div>
<div class="tags">
</div>
<h2>Constant Summary</h2>
<h3 class="inherited">Constants inherited
from <span class='object_link'><a href="../Module.html" title="Msf::Module (class)">Module</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module.html#REPLICANT_EXTENSION_DS_KEY-constant" title="Msf::Module::REPLICANT_EXTENSION_DS_KEY (constant)">Module::REPLICANT_EXTENSION_DS_KEY</a></span></p>
<h3 class="inherited">Constants included
from <span class='object_link'><a href="../Module/ModuleInfo.html" title="Msf::Module::ModuleInfo (module)">Module::ModuleInfo</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/ModuleInfo.html#ReferencesWithOptionalThirdElement-constant" title="Msf::Module::ModuleInfo::ReferencesWithOptionalThirdElement (constant)">Module::ModuleInfo::ReferencesWithOptionalThirdElement</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#UpdateableOptions-constant" title="Msf::Module::ModuleInfo::UpdateableOptions (constant)">Module::ModuleInfo::UpdateableOptions</a></span></p>
<h3 class="inherited">Constants included
from <span class='object_link'><a href="../Module/Failure.html" title="Msf::Module::Failure (module)">Module::Failure</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Failure.html#BadConfig-constant" title="Msf::Module::Failure::BadConfig (constant)">Module::Failure::BadConfig</a></span>, <span class='object_link'><a href="../Module/Failure.html#Disconnected-constant" title="Msf::Module::Failure::Disconnected (constant)">Module::Failure::Disconnected</a></span>, <span class='object_link'><a href="../Module/Failure.html#NoAccess-constant" title="Msf::Module::Failure::NoAccess (constant)">Module::Failure::NoAccess</a></span>, <span class='object_link'><a href="../Module/Failure.html#NoTarget-constant" title="Msf::Module::Failure::NoTarget (constant)">Module::Failure::NoTarget</a></span>, <span class='object_link'><a href="../Module/Failure.html#None-constant" title="Msf::Module::Failure::None (constant)">Module::Failure::None</a></span>, <span class='object_link'><a href="../Module/Failure.html#NotFound-constant" title="Msf::Module::Failure::NotFound (constant)">Module::Failure::NotFound</a></span>, <span class='object_link'><a href="../Module/Failure.html#NotVulnerable-constant" title="Msf::Module::Failure::NotVulnerable (constant)">Module::Failure::NotVulnerable</a></span>, <span class='object_link'><a href="../Module/Failure.html#PayloadFailed-constant" title="Msf::Module::Failure::PayloadFailed (constant)">Module::Failure::PayloadFailed</a></span>, <span class='object_link'><a href="../Module/Failure.html#TimeoutExpired-constant" title="Msf::Module::Failure::TimeoutExpired (constant)">Module::Failure::TimeoutExpired</a></span>, <span class='object_link'><a href="../Module/Failure.html#UnexpectedReply-constant" title="Msf::Module::Failure::UnexpectedReply (constant)">Module::Failure::UnexpectedReply</a></span>, <span class='object_link'><a href="../Module/Failure.html#Unknown-constant" title="Msf::Module::Failure::Unknown (constant)">Module::Failure::Unknown</a></span>, <span class='object_link'><a href="../Module/Failure.html#Unreachable-constant" title="Msf::Module::Failure::Unreachable (constant)">Module::Failure::Unreachable</a></span>, <span class='object_link'><a href="../Module/Failure.html#UserInterrupt-constant" title="Msf::Module::Failure::UserInterrupt (constant)">Module::Failure::UserInterrupt</a></span></p>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Encoder.html" title="Msf::Encoder (class)">Msf::Encoder</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Encoder.html#available_space-instance_method" title="Msf::Encoder#available_space (method)">#available_space</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Module.html" title="Msf::Module (class)">Module</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module.html#error-instance_method" title="Msf::Module#error (method)">#error</a></span>, <span class='object_link'><a href="../Module.html#job_id-instance_method" title="Msf::Module#job_id (method)">#job_id</a></span>, <span class='object_link'><a href="../Module.html#license-instance_method" title="Msf::Module#license (method)">#license</a></span>, <span class='object_link'><a href="../Module.html#platform-instance_method" title="Msf::Module#platform (method)">#platform</a></span>, <span class='object_link'><a href="../Module.html#privileged=-instance_method" title="Msf::Module#privileged= (method)">#privileged</a></span>, <span class='object_link'><a href="../Module.html#references-instance_method" title="Msf::Module#references (method)">#references</a></span>, <span class='object_link'><a href="../Module.html#user_data-instance_method" title="Msf::Module#user_data (method)">#user_data</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Framework/Offspring.html" title="Msf::Framework::Offspring (module)">Framework::Offspring</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Framework/Offspring.html#framework-instance_method" title="Msf::Framework::Offspring#framework (method)">#framework</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/UUID.html" title="Msf::Module::UUID (module)">Module::UUID</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/UUID.html#uuid-instance_method" title="Msf::Module::UUID#uuid (method)">#uuid</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../../Rex/Ui/Subscriber/Input.html" title="Rex::Ui::Subscriber::Input (module)">Rex::Ui::Subscriber::Input</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../../Rex/Ui/Subscriber/Input.html#user_input-instance_method" title="Rex::Ui::Subscriber::Input#user_input (method)">#user_input</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html" title="Rex::Ui::Subscriber::Output (module)">Rex::Ui::Subscriber::Output</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#user_output-instance_method" title="Rex::Ui::Subscriber::Output#user_output (method)">#user_output</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/Privileged.html" title="Msf::Module::Privileged (module)">Module::Privileged</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Privileged.html#priveli=-instance_method" title="Msf::Module::Privileged#priveli= (method)">#priveli</a></span>, <span class='object_link'><a href="../Module/Privileged.html#privileged-instance_method" title="Msf::Module::Privileged#privileged (method)">#privileged</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/Options.html" title="Msf::Module::Options (module)">Module::Options</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Options.html#options-instance_method" title="Msf::Module::Options#options (method)">#options</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/ModuleStore.html" title="Msf::Module::ModuleStore (module)">Module::ModuleStore</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/ModuleStore.html#module_store-instance_method" title="Msf::Module::ModuleStore#module_store (method)">#module_store</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/ModuleInfo.html" title="Msf::Module::ModuleInfo (module)">Module::ModuleInfo</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/ModuleInfo.html#module_info-instance_method" title="Msf::Module::ModuleInfo#module_info (method)">#module_info</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/FullName.html" title="Msf::Module::FullName (module)">Module::FullName</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/FullName.html#aliased_as-instance_method" title="Msf::Module::FullName#aliased_as (method)">#aliased_as</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/DataStore.html" title="Msf::Module::DataStore (module)">Module::DataStore</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/DataStore.html#datastore-instance_method" title="Msf::Module::DataStore#datastore (method)">#datastore</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/Author.html" title="Msf::Module::Author (module)">Module::Author</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Author.html#author-instance_method" title="Msf::Module::Author#author (method)">#author</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/Arch.html" title="Msf::Module::Arch (module)">Module::Arch</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Arch.html#arch-instance_method" title="Msf::Module::Arch#arch (method)">#arch</a></span></p>
<h3 class="inherited">Attributes included from <span class='object_link'><a href="../Module/Alert.html" title="Msf::Module::Alert (module)">Module::Alert</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Alert.html#alerts-instance_method" title="Msf::Module::Alert#alerts (method)">#alerts</a></span>, <span class='object_link'><a href="../Module/Alert.html#you_have_been_warned-instance_method" title="Msf::Module::Alert#you_have_been_warned (method)">#you_have_been_warned</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="#encode_block-instance_method" title="#encode_block (instance method)">#<strong>encode_block</strong>(state, block) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Encodes a block using the XOR additive feedback algorithm.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#find_key-instance_method" title="#find_key (instance method)">#<strong>find_key</strong>(buf, badchars, state = Msf::EncoderState.new) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Finds a key that is compatible with the badchars list.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(info) &#x21d2; XorAdditiveFeedback </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of XorAdditiveFeedback.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Xor.html" title="Msf::Encoder::Xor (class)">Xor</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Xor.html#find_bad_keys-instance_method" title="Msf::Encoder::Xor#find_bad_keys (method)">#find_bad_keys</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Encoder.html" title="Msf::Encoder (class)">Msf::Encoder</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Encoder.html#can_preserve_registers%3F-instance_method" title="Msf::Encoder#can_preserve_registers? (method)">#can_preserve_registers?</a></span>, <span class='object_link'><a href="../Encoder.html#decoder_block_size-instance_method" title="Msf::Encoder#decoder_block_size (method)">#decoder_block_size</a></span>, <span class='object_link'><a href="../Encoder.html#decoder_hash-instance_method" title="Msf::Encoder#decoder_hash (method)">#decoder_hash</a></span>, <span class='object_link'><a href="../Encoder.html#decoder_key_offset-instance_method" title="Msf::Encoder#decoder_key_offset (method)">#decoder_key_offset</a></span>, <span class='object_link'><a href="../Encoder.html#decoder_key_pack-instance_method" title="Msf::Encoder#decoder_key_pack (method)">#decoder_key_pack</a></span>, <span class='object_link'><a href="../Encoder.html#decoder_key_size-instance_method" title="Msf::Encoder#decoder_key_size (method)">#decoder_key_size</a></span>, <span class='object_link'><a href="../Encoder.html#decoder_stub-instance_method" title="Msf::Encoder#decoder_stub (method)">#decoder_stub</a></span>, <span class='object_link'><a href="../Encoder.html#do_encode-instance_method" title="Msf::Encoder#do_encode (method)">#do_encode</a></span>, <span class='object_link'><a href="../Encoder.html#encode-instance_method" title="Msf::Encoder#encode (method)">#encode</a></span>, <span class='object_link'><a href="../Encoder.html#encode_begin-instance_method" title="Msf::Encoder#encode_begin (method)">#encode_begin</a></span>, <span class='object_link'><a href="../Encoder.html#encode_end-instance_method" title="Msf::Encoder#encode_end (method)">#encode_end</a></span>, <span class='object_link'><a href="../Encoder.html#encode_finalize_stub-instance_method" title="Msf::Encoder#encode_finalize_stub (method)">#encode_finalize_stub</a></span>, <span class='object_link'><a href="../Encoder.html#encoder_type-instance_method" title="Msf::Encoder#encoder_type (method)">#encoder_type</a></span>, <span class='object_link'><a href="../Encoder.html#find_bad_keys-instance_method" title="Msf::Encoder#find_bad_keys (method)">#find_bad_keys</a></span>, <span class='object_link'><a href="../Encoder.html#find_context_key-instance_method" title="Msf::Encoder#find_context_key (method)">#find_context_key</a></span>, <span class='object_link'><a href="../Encoder.html#find_key_verify-instance_method" title="Msf::Encoder#find_key_verify (method)">#find_key_verify</a></span>, <span class='object_link'><a href="../Encoder.html#has_badchars%3F-instance_method" title="Msf::Encoder#has_badchars? (method)">#has_badchars?</a></span>, <span class='object_link'><a href="../Encoder.html#init_platform-instance_method" title="Msf::Encoder#init_platform (method)">#init_platform</a></span>, <span class='object_link'><a href="../Encoder.html#init_state-instance_method" title="Msf::Encoder#init_state (method)">#init_state</a></span>, <span class='object_link'><a href="../Encoder.html#integer_to_key_bytes-instance_method" title="Msf::Encoder#integer_to_key_bytes (method)">#integer_to_key_bytes</a></span>, <span class='object_link'><a href="../Encoder.html#key_bytes_to_buffer-instance_method" title="Msf::Encoder#key_bytes_to_buffer (method)">#key_bytes_to_buffer</a></span>, <span class='object_link'><a href="../Encoder.html#key_bytes_to_integer-instance_method" title="Msf::Encoder#key_bytes_to_integer (method)">#key_bytes_to_integer</a></span>, <span class='object_link'><a href="../Encoder.html#modified_registers-instance_method" title="Msf::Encoder#modified_registers (method)">#modified_registers</a></span>, <span class='object_link'><a href="../Encoder.html#obtain_key-instance_method" title="Msf::Encoder#obtain_key (method)">#obtain_key</a></span>, <span class='object_link'><a href="../Encoder.html#prepend_buf-instance_method" title="Msf::Encoder#prepend_buf (method)">#prepend_buf</a></span>, <span class='object_link'><a href="../Encoder.html#preserves_stack%3F-instance_method" title="Msf::Encoder#preserves_stack? (method)">#preserves_stack?</a></span>, <span class='object_link'><a href="../Encoder.html#to_native-instance_method" title="Msf::Encoder#to_native (method)">#to_native</a></span>, <span class='object_link'><a href="../Encoder.html#type-class_method" title="Msf::Encoder.type (method)">type</a></span>, <span class='object_link'><a href="../Encoder.html#type-instance_method" title="Msf::Encoder#type (method)">#type</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Module.html" title="Msf::Module (class)">Module</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module.html#adapted_refname-instance_method" title="Msf::Module#adapted_refname (method)">#adapted_refname</a></span>, <span class='object_link'><a href="../Module.html#adapter_refname-instance_method" title="Msf::Module#adapter_refname (method)">#adapter_refname</a></span>, <span class='object_link'><a href="../Module.html#black_listed_auth_filenames-instance_method" title="Msf::Module#black_listed_auth_filenames (method)">#black_listed_auth_filenames</a></span>, <span class='object_link'><a href="../Module.html#cached%3F-class_method" title="Msf::Module.cached? (method)">cached?</a></span>, <span class='object_link'><a href="../Module.html#debugging%3F-instance_method" title="Msf::Module#debugging? (method)">#debugging?</a></span>, <span class='object_link'><a href="../Module.html#default_cred%3F-instance_method" title="Msf::Module#default_cred? (method)">#default_cred?</a></span>, <span class='object_link'><a href="../Module.html#default_options-instance_method" title="Msf::Module#default_options (method)">#default_options</a></span>, <span class='object_link'><a href="../Module.html#fail_with-instance_method" title="Msf::Module#fail_with (method)">#fail_with</a></span>, <span class='object_link'><a href="../Module.html#file_path-instance_method" title="Msf::Module#file_path (method)">#file_path</a></span>, <span class='object_link'><a href="../Module.html#framework-instance_method" title="Msf::Module#framework (method)">#framework</a></span>, <span class='object_link'><a href="../Module.html#has_check%3F-instance_method" title="Msf::Module#has_check? (method)">#has_check?</a></span>, <span class='object_link'><a href="../Module.html#merge_module_info_with_target_info-instance_method" title="Msf::Module#merge_module_info_with_target_info (method)">#merge_module_info_with_target_info</a></span>, <span class='object_link'><a href="../Module.html#orig_cls-instance_method" title="Msf::Module#orig_cls (method)">#orig_cls</a></span>, <span class='object_link'><a href="../Module.html#owner-instance_method" title="Msf::Module#owner (method)">#owner</a></span>, <span class='object_link'><a href="../Module.html#perform_extensions-instance_method" title="Msf::Module#perform_extensions (method)">#perform_extensions</a></span>, <span class='object_link'><a href="../Module.html#platform%3F-instance_method" title="Msf::Module#platform? (method)">#platform?</a></span>, <span class='object_link'><a href="../Module.html#platform_to_s-instance_method" title="Msf::Module#platform_to_s (method)">#platform_to_s</a></span>, <span class='object_link'><a href="../Module.html#post_auth%3F-instance_method" title="Msf::Module#post_auth? (method)">#post_auth?</a></span>, <span class='object_link'><a href="../Module.html#register_extensions-instance_method" title="Msf::Module#register_extensions (method)">#register_extensions</a></span>, <span class='object_link'><a href="../Module.html#register_parent-instance_method" title="Msf::Module#register_parent (method)">#register_parent</a></span>, <span class='object_link'><a href="../Module.html#replicant-instance_method" title="Msf::Module#replicant (method)">#replicant</a></span>, <span class='object_link'><a href="../Module.html#required_cred_options-instance_method" title="Msf::Module#required_cred_options (method)">#required_cred_options</a></span>, <span class='object_link'><a href="../Module.html#set_defaults-instance_method" title="Msf::Module#set_defaults (method)">#set_defaults</a></span>, <span class='object_link'><a href="../Module.html#stage_refname-instance_method" title="Msf::Module#stage_refname (method)">#stage_refname</a></span>, <span class='object_link'><a href="../Module.html#stager_refname-instance_method" title="Msf::Module#stager_refname (method)">#stager_refname</a></span>, <span class='object_link'><a href="../Module.html#workspace-instance_method" title="Msf::Module#workspace (method)">#workspace</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Reliability.html" title="Msf::Module::Reliability (module)">Module::Reliability</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Reliability.html#reliability-instance_method" title="Msf::Module::Reliability#reliability (method)">#reliability</a></span>, <span class='object_link'><a href="../Module/Reliability.html#reliability_to_s-instance_method" title="Msf::Module::Reliability#reliability_to_s (method)">#reliability_to_s</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Stability.html" title="Msf::Module::Stability (module)">Module::Stability</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Stability.html#stability-instance_method" title="Msf::Module::Stability#stability (method)">#stability</a></span>, <span class='object_link'><a href="../Module/Stability.html#stability_to_s-instance_method" title="Msf::Module::Stability#stability_to_s (method)">#stability_to_s</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/SideEffects.html" title="Msf::Module::SideEffects (module)">Module::SideEffects</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/SideEffects.html#side_effects-instance_method" title="Msf::Module::SideEffects#side_effects (method)">#side_effects</a></span>, <span class='object_link'><a href="../Module/SideEffects.html#side_effects_to_s-instance_method" title="Msf::Module::SideEffects#side_effects_to_s (method)">#side_effects_to_s</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/UI.html" title="Msf::Module::UI (module)">Module::UI</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/UI.html#init_ui-instance_method" title="Msf::Module::UI#init_ui (method)">#init_ui</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/UI/Message.html" title="Msf::Module::UI::Message (module)">Module::UI::Message</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/UI/Message.html#print_error-instance_method" title="Msf::Module::UI::Message#print_error (method)">#print_error</a></span>, <span class='object_link'><a href="../Module/UI/Message.html#print_good-instance_method" title="Msf::Module::UI::Message#print_good (method)">#print_good</a></span>, <span class='object_link'><a href="../Module/UI/Message.html#print_prefix-instance_method" title="Msf::Module::UI::Message#print_prefix (method)">#print_prefix</a></span>, <span class='object_link'><a href="../Module/UI/Message.html#print_status-instance_method" title="Msf::Module::UI::Message#print_status (method)">#print_status</a></span>, <span class='object_link'><a href="../Module/UI/Message.html#print_warning-instance_method" title="Msf::Module::UI::Message#print_warning (method)">#print_warning</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/UI/Message/Verbose.html" title="Msf::Module::UI::Message::Verbose (module)">Module::UI::Message::Verbose</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/UI/Message/Verbose.html#vprint_error-instance_method" title="Msf::Module::UI::Message::Verbose#vprint_error (method)">#vprint_error</a></span>, <span class='object_link'><a href="../Module/UI/Message/Verbose.html#vprint_good-instance_method" title="Msf::Module::UI::Message::Verbose#vprint_good (method)">#vprint_good</a></span>, <span class='object_link'><a href="../Module/UI/Message/Verbose.html#vprint_status-instance_method" title="Msf::Module::UI::Message::Verbose#vprint_status (method)">#vprint_status</a></span>, <span class='object_link'><a href="../Module/UI/Message/Verbose.html#vprint_warning-instance_method" title="Msf::Module::UI::Message::Verbose#vprint_warning (method)">#vprint_warning</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/UI/Line.html" title="Msf::Module::UI::Line (module)">Module::UI::Line</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/UI/Line.html#print_line-instance_method" title="Msf::Module::UI::Line#print_line (method)">#print_line</a></span>, <span class='object_link'><a href="../Module/UI/Line.html#print_line_prefix-instance_method" title="Msf::Module::UI::Line#print_line_prefix (method)">#print_line_prefix</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/UI/Line/Verbose.html" title="Msf::Module::UI::Line::Verbose (module)">Module::UI::Line::Verbose</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/UI/Line/Verbose.html#vprint_line-instance_method" title="Msf::Module::UI::Line::Verbose#vprint_line (method)">#vprint_line</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../Rex/Ui/Subscriber.html" title="Rex::Ui::Subscriber (module)">Rex::Ui::Subscriber</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../../Rex/Ui/Subscriber.html#copy_ui-instance_method" title="Rex::Ui::Subscriber#copy_ui (method)">#copy_ui</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber.html#init_ui-instance_method" title="Rex::Ui::Subscriber#init_ui (method)">#init_ui</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber.html#reset_ui-instance_method" title="Rex::Ui::Subscriber#reset_ui (method)">#reset_ui</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../Rex/Ui/Subscriber/Input.html" title="Rex::Ui::Subscriber::Input (module)">Rex::Ui::Subscriber::Input</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../../Rex/Ui/Subscriber/Input.html#gets-instance_method" title="Rex::Ui::Subscriber::Input#gets (method)">#gets</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html" title="Rex::Ui::Subscriber::Output (module)">Rex::Ui::Subscriber::Output</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#flush-instance_method" title="Rex::Ui::Subscriber::Output#flush (method)">#flush</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#print-instance_method" title="Rex::Ui::Subscriber::Output#print (method)">#print</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#print_blank_line-instance_method" title="Rex::Ui::Subscriber::Output#print_blank_line (method)">#print_blank_line</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#print_error-instance_method" title="Rex::Ui::Subscriber::Output#print_error (method)">#print_error</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#print_good-instance_method" title="Rex::Ui::Subscriber::Output#print_good (method)">#print_good</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#print_line-instance_method" title="Rex::Ui::Subscriber::Output#print_line (method)">#print_line</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#print_status-instance_method" title="Rex::Ui::Subscriber::Output#print_status (method)">#print_status</a></span>, <span class='object_link'><a href="../../Rex/Ui/Subscriber/Output.html#print_warning-instance_method" title="Rex::Ui::Subscriber::Output#print_warning (method)">#print_warning</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Type.html" title="Msf::Module::Type (module)">Module::Type</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Type.html#auxiliary%3F-instance_method" title="Msf::Module::Type#auxiliary? (method)">#auxiliary?</a></span>, <span class='object_link'><a href="../Module/Type.html#encoder%3F-instance_method" title="Msf::Module::Type#encoder? (method)">#encoder?</a></span>, <span class='object_link'><a href="../Module/Type.html#evasion%3F-instance_method" title="Msf::Module::Type#evasion? (method)">#evasion?</a></span>, <span class='object_link'><a href="../Module/Type.html#exploit%3F-instance_method" title="Msf::Module::Type#exploit? (method)">#exploit?</a></span>, <span class='object_link'><a href="../Module/Type.html#nop%3F-instance_method" title="Msf::Module::Type#nop? (method)">#nop?</a></span>, <span class='object_link'><a href="../Module/Type.html#payload%3F-instance_method" title="Msf::Module::Type#payload? (method)">#payload?</a></span>, <span class='object_link'><a href="../Module/Type.html#post%3F-instance_method" title="Msf::Module::Type#post? (method)">#post?</a></span>, <span class='object_link'><a href="../Module/Type.html#type-instance_method" title="Msf::Module::Type#type (method)">#type</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Ranking.html" title="Msf::Module::Ranking (module)">Module::Ranking</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Ranking.html#rank-instance_method" title="Msf::Module::Ranking#rank (method)">#rank</a></span>, <span class='object_link'><a href="../Module/Ranking.html#rank_to_h-instance_method" title="Msf::Module::Ranking#rank_to_h (method)">#rank_to_h</a></span>, <span class='object_link'><a href="../Module/Ranking.html#rank_to_s-instance_method" title="Msf::Module::Ranking#rank_to_s (method)">#rank_to_s</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Privileged.html" title="Msf::Module::Privileged (module)">Module::Privileged</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Privileged.html#privileged%3F-instance_method" title="Msf::Module::Privileged#privileged? (method)">#privileged?</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Options.html" title="Msf::Module::Options (module)">Module::Options</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Options.html#deregister_option_group-instance_method" title="Msf::Module::Options#deregister_option_group (method)">#deregister_option_group</a></span>, <span class='object_link'><a href="../Module/Options.html#deregister_options-instance_method" title="Msf::Module::Options#deregister_options (method)">#deregister_options</a></span>, <span class='object_link'><a href="../Module/Options.html#register_advanced_options-instance_method" title="Msf::Module::Options#register_advanced_options (method)">#register_advanced_options</a></span>, <span class='object_link'><a href="../Module/Options.html#register_evasion_options-instance_method" title="Msf::Module::Options#register_evasion_options (method)">#register_evasion_options</a></span>, <span class='object_link'><a href="../Module/Options.html#register_option_group-instance_method" title="Msf::Module::Options#register_option_group (method)">#register_option_group</a></span>, <span class='object_link'><a href="../Module/Options.html#register_options-instance_method" title="Msf::Module::Options#register_options (method)">#register_options</a></span>, <span class='object_link'><a href="../Module/Options.html#validate-instance_method" title="Msf::Module::Options#validate (method)">#validate</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Network.html" title="Msf::Module::Network (module)">Module::Network</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Network.html#comm-instance_method" title="Msf::Module::Network#comm (method)">#comm</a></span>, <span class='object_link'><a href="../Module/Network.html#support_ipv6%3F-instance_method" title="Msf::Module::Network#support_ipv6? (method)">#support_ipv6?</a></span>, <span class='object_link'><a href="../Module/Network.html#target_host-instance_method" title="Msf::Module::Network#target_host (method)">#target_host</a></span>, <span class='object_link'><a href="../Module/Network.html#target_port-instance_method" title="Msf::Module::Network#target_port (method)">#target_port</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/ModuleStore.html" title="Msf::Module::ModuleStore (module)">Module::ModuleStore</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/ModuleStore.html#[]-instance_method" title="Msf::Module::ModuleStore#[] (method)">#[]</a></span>, <span class='object_link'><a href="../Module/ModuleStore.html#[]=-instance_method" title="Msf::Module::ModuleStore#[]= (method)">#[]=</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/ModuleInfo.html" title="Msf::Module::ModuleInfo (module)">Module::ModuleInfo</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/ModuleInfo.html#alias-instance_method" title="Msf::Module::ModuleInfo#alias (method)">#alias</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#description-instance_method" title="Msf::Module::ModuleInfo#description (method)">#description</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#disclosure_date-instance_method" title="Msf::Module::ModuleInfo#disclosure_date (method)">#disclosure_date</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#info_fixups-instance_method" title="Msf::Module::ModuleInfo#info_fixups (method)">#info_fixups</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_check_key-instance_method" title="Msf::Module::ModuleInfo#merge_check_key (method)">#merge_check_key</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info-instance_method" title="Msf::Module::ModuleInfo#merge_info (method)">#merge_info</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_advanced_options-instance_method" title="Msf::Module::ModuleInfo#merge_info_advanced_options (method)">#merge_info_advanced_options</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_alias-instance_method" title="Msf::Module::ModuleInfo#merge_info_alias (method)">#merge_info_alias</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_description-instance_method" title="Msf::Module::ModuleInfo#merge_info_description (method)">#merge_info_description</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_evasion_options-instance_method" title="Msf::Module::ModuleInfo#merge_info_evasion_options (method)">#merge_info_evasion_options</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_name-instance_method" title="Msf::Module::ModuleInfo#merge_info_name (method)">#merge_info_name</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_options-instance_method" title="Msf::Module::ModuleInfo#merge_info_options (method)">#merge_info_options</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_string-instance_method" title="Msf::Module::ModuleInfo#merge_info_string (method)">#merge_info_string</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#merge_info_version-instance_method" title="Msf::Module::ModuleInfo#merge_info_version (method)">#merge_info_version</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#name-instance_method" title="Msf::Module::ModuleInfo#name (method)">#name</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#notes-instance_method" title="Msf::Module::ModuleInfo#notes (method)">#notes</a></span>, <span class='object_link'><a href="../Module/ModuleInfo.html#update_info-instance_method" title="Msf::Module::ModuleInfo#update_info (method)">#update_info</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/FullName.html" title="Msf::Module::FullName (module)">Module::FullName</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/FullName.html#aliases-instance_method" title="Msf::Module::FullName#aliases (method)">#aliases</a></span>, <span class='object_link'><a href="../Module/FullName.html#fullname-instance_method" title="Msf::Module::FullName#fullname (method)">#fullname</a></span>, <span class='object_link'><a href="../Module/FullName.html#promptname-instance_method" title="Msf::Module::FullName#promptname (method)">#promptname</a></span>, <span class='object_link'><a href="../Module/FullName.html#realname-instance_method" title="Msf::Module::FullName#realname (method)">#realname</a></span>, <span class='object_link'><a href="../Module/FullName.html#refname-instance_method" title="Msf::Module::FullName#refname (method)">#refname</a></span>, <span class='object_link'><a href="../Module/FullName.html#shortname-instance_method" title="Msf::Module::FullName#shortname (method)">#shortname</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Failure.html" title="Msf::Module::Failure (module)">Module::Failure</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Failure.html#fail_reason_from_check_code-class_method" title="Msf::Module::Failure.fail_reason_from_check_code (method)">fail_reason_from_check_code</a></span>, <span class='object_link'><a href="../Module/Failure.html#report_failure-instance_method" title="Msf::Module::Failure#report_failure (method)">#report_failure</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/DataStore.html" title="Msf::Module::DataStore (module)">Module::DataStore</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/DataStore.html#import_defaults-instance_method" title="Msf::Module::DataStore#import_defaults (method)">#import_defaults</a></span>, <span class='object_link'><a href="../Module/DataStore.html#import_target_defaults-instance_method" title="Msf::Module::DataStore#import_target_defaults (method)">#import_target_defaults</a></span>, <span class='object_link'><a href="../Module/DataStore.html#share_datastore-instance_method" title="Msf::Module::DataStore#share_datastore (method)">#share_datastore</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Compatibility.html" title="Msf::Module::Compatibility (module)">Module::Compatibility</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Compatibility.html#compat-instance_method" title="Msf::Module::Compatibility#compat (method)">#compat</a></span>, <span class='object_link'><a href="../Module/Compatibility.html#compatible%3F-instance_method" title="Msf::Module::Compatibility#compatible? (method)">#compatible?</a></span>, <span class='object_link'><a href="../Module/Compatibility.html#init_compat-instance_method" title="Msf::Module::Compatibility#init_compat (method)">#init_compat</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Author.html" title="Msf::Module::Author (module)">Module::Author</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Author.html#author_to_s-instance_method" title="Msf::Module::Author#author_to_s (method)">#author_to_s</a></span>, <span class='object_link'><a href="../Module/Author.html#each_author-instance_method" title="Msf::Module::Author#each_author (method)">#each_author</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Auth.html" title="Msf::Module::Auth (module)">Module::Auth</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Auth.html#store_valid_credential-instance_method" title="Msf::Module::Auth#store_valid_credential (method)">#store_valid_credential</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Arch.html" title="Msf::Module::Arch (module)">Module::Arch</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Arch.html#arch%3F-instance_method" title="Msf::Module::Arch#arch? (method)">#arch?</a></span>, <span class='object_link'><a href="../Module/Arch.html#arch_to_s-instance_method" title="Msf::Module::Arch#arch_to_s (method)">#arch_to_s</a></span>, <span class='object_link'><a href="../Module/Arch.html#each_arch-instance_method" title="Msf::Module::Arch#each_arch (method)">#each_arch</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Module/Alert.html" title="Msf::Module::Alert (module)">Module::Alert</a></span></h3>
<p class="inherited"><span class='object_link'><a href="../Module/Alert.html#add_alert-instance_method" title="Msf::Module::Alert#add_alert (method)">#add_alert</a></span>, <span class='object_link'><a href="../Module/Alert.html#add_error-instance_method" title="Msf::Module::Alert#add_error (method)">#add_error</a></span>, <span class='object_link'><a href="../Module/Alert.html#add_info-instance_method" title="Msf::Module::Alert#add_info (method)">#add_info</a></span>, <span class='object_link'><a href="../Module/Alert.html#add_warning-instance_method" title="Msf::Module::Alert#add_warning (method)">#add_warning</a></span>, <span class='object_link'><a href="../Module/Alert.html#alert_user-instance_method" title="Msf::Module::Alert#alert_user (method)">#alert_user</a></span>, <span class='object_link'><a href="../Module/Alert.html#errors-instance_method" title="Msf::Module::Alert#errors (method)">#errors</a></span>, <span class='object_link'><a href="../Module/Alert.html#get_alerts-instance_method" title="Msf::Module::Alert#get_alerts (method)">#get_alerts</a></span>, <span class='object_link'><a href="../Module/Alert.html#included-class_method" title="Msf::Module::Alert.included (method)">included</a></span>, <span class='object_link'><a href="../Module/Alert.html#infos-instance_method" title="Msf::Module::Alert#infos (method)">#infos</a></span>, <span class='object_link'><a href="../Module/Alert.html#is_usable%3F-instance_method" title="Msf::Module::Alert#is_usable? (method)">#is_usable?</a></span>, <span class='object_link'><a href="../Module/Alert.html#warnings-instance_method" title="Msf::Module::Alert#warnings (method)">#warnings</a></span>, <span class='object_link'><a href="../Module/Alert.html#without_prompt-instance_method" title="Msf::Module::Alert#without_prompt (method)">#without_prompt</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>(info) &#x21d2; <tt><span class='object_link'><a href="" title="Msf::Encoder::XorAdditiveFeedback (class)">XorAdditiveFeedback</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of XorAdditiveFeedback.</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/msf/core/encoder/xor_additive_feedback.rb', line 10</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='rparen'>)</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='rparen'>)</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="encode_block-instance_method">
#<strong>encode_block</strong>(state, block) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Encodes a block using the XOR additive feedback algorithm.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
17
18
19
20
21
22
23
24
25
26
27</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/encoder/xor_additive_feedback.rb', line 17</span>
<span class='kw'>def</span> <span class='id identifier rubyid_encode_block'>encode_block</span><span class='lparen'>(</span><span class='id identifier rubyid_state'>state</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='comment'># XOR the key with the current block
</span> <span class='id identifier rubyid_orig'>orig</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_unpack'>unpack</span><span class='lparen'>(</span><span class='id identifier rubyid_decoder_key_pack'>decoder_key_pack</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_oblock'>oblock</span> <span class='op'>=</span> <span class='id identifier rubyid_orig'>orig</span> <span class='op'>^</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span>
<span class='comment'># Add the original block contents to the key
</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span> <span class='op'>+</span> <span class='id identifier rubyid_orig'>orig</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='lparen'>(</span><span class='int'>1</span> <span class='op'>&lt;&lt;</span> <span class='lparen'>(</span><span class='id identifier rubyid_decoder_key_size'>decoder_key_size</span> <span class='op'>*</span> <span class='int'>8</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='comment'># Return the XOR&#39;d block
</span> <span class='kw'>return</span> <span class='lbracket'>[</span> <span class='id identifier rubyid_oblock'>oblock</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pack'>pack</span><span class='lparen'>(</span><span class='id identifier rubyid_decoder_key_pack'>decoder_key_pack</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="find_key-instance_method">
#<strong>find_key</strong>(buf, badchars, state = Msf::EncoderState.new) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Finds a key that is compatible with the badchars list.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
32
33
34
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/encoder/xor_additive_feedback.rb', line 32</span>
<span class='kw'>def</span> <span class='id identifier rubyid_find_key'>find_key</span><span class='lparen'>(</span><span class='id identifier rubyid_buf'>buf</span><span class='comma'>,</span> <span class='id identifier rubyid_badchars'>badchars</span><span class='comma'>,</span> <span class='id identifier rubyid_state'>state</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../EncoderState.html" title="Msf::EncoderState (class)">EncoderState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../EncoderState.html#initialize-instance_method" title="Msf::EncoderState#initialize (method)">new</a></span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_key_bytes'>key_bytes</span> <span class='op'>=</span> <span class='id identifier rubyid_integer_to_key_bytes'>integer_to_key_bytes</span><span class='lparen'>(</span><span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_buf'>buf</span><span class='comma'>,</span> <span class='id identifier rubyid_badchars'>badchars</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='id identifier rubyid_valid'>valid</span> <span class='op'>=</span> <span class='kw'>false</span>
<span class='comment'># Save the original key_bytes so we can tell if we loop around
</span> <span class='id identifier rubyid_orig_key_bytes'>orig_key_bytes</span> <span class='op'>=</span> <span class='id identifier rubyid_key_bytes'>key_bytes</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
<span class='comment'># While we haven&#39;t found a valid key, keep trying the encode operation
</span> <span class='kw'>while</span> <span class='lparen'>(</span><span class='op'>!</span><span class='id identifier rubyid_valid'>valid</span><span class='rparen'>)</span>
<span class='comment'># Initialize the state back to defaults since we&#39;re trying to find a
</span> <span class='comment'># key.
</span> <span class='id identifier rubyid_init_state'>init_state</span><span class='lparen'>(</span><span class='id identifier rubyid_state'>state</span><span class='rparen'>)</span>
<span class='kw'>begin</span>
<span class='comment'># Reset the encoder state&#39;s key to the current set of key bytes
</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span><span class='lparen'>(</span><span class='id identifier rubyid_key_bytes_to_integer'>key_bytes_to_integer</span><span class='lparen'>(</span><span class='id identifier rubyid_key_bytes'>key_bytes</span><span class='rparen'>)</span><span class='rparen'>)</span>
<span class='comment'># If the key itself contains a bad character, throw the bad
</span> <span class='comment'># character exception with the index of the bad character in the
</span> <span class='comment'># key. Use a stub_size of zero to bypass the check to in the
</span> <span class='comment'># rescue block.
</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_idx'>idx</span> <span class='op'>=</span> <span class='id identifier rubyid_has_badchars?'>has_badchars?</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pack'>pack</span><span class='lparen'>(</span><span class='id identifier rubyid_decoder_key_pack'>decoder_key_pack</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_badchars'>badchars</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../BadcharError.html" title="Msf::BadcharError (class)">BadcharError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../BadcharError.html#initialize-instance_method" title="Msf::BadcharError#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_idx'>idx</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Perform the encode operation...if it encounters a bad character
</span> <span class='comment'># an exception will be thrown
</span> <span class='id identifier rubyid_valid'>valid</span> <span class='op'>=</span> <span class='id identifier rubyid_do_encode'>do_encode</span><span class='lparen'>(</span><span class='id identifier rubyid_state'>state</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../BadcharError.html" title="Msf::BadcharError (class)">BadcharError</a></span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_info'>info</span>
<span class='comment'># If the decoder stub contains a bad character, then there&#39;s not
</span> <span class='comment'># much we can do about it
</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_stub_size'>stub_size</span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> decoder stub contains a bad character.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_caller'>caller</span>
<span class='kw'>end</span>
<span class='comment'># Determine the actual index to the bad character inside the
</span> <span class='comment'># encoded payload by removing the decoder stub from the index and
</span> <span class='comment'># modulus off the decoder&#39;s key size
</span> <span class='id identifier rubyid_idx'>idx</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span> <span class='op'>-</span> <span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_stub_size'>stub_size</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='lparen'>(</span><span class='id identifier rubyid_decoder_key_size'>decoder_key_size</span><span class='rparen'>)</span>
<span class='comment'># Increment the key byte at the index that the bad character was
</span> <span class='comment'># detected
</span> <span class='id identifier rubyid_key_bytes'>key_bytes</span><span class='lbracket'>[</span><span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_key_bytes'>key_bytes</span><span class='lbracket'>[</span><span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>%</span> <span class='int'>255</span><span class='rparen'>)</span>
<span class='comment'># If we looped around, then give up.
</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_key_bytes'>key_bytes</span><span class='lbracket'>[</span><span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_orig_key_bytes'>orig_key_bytes</span><span class='lbracket'>[</span><span class='id identifier rubyid_idx'>idx</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_info'>info</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> encoder failed to encode without bad characters.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
<span class='id identifier rubyid_caller'>caller</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Return the original key
</span> <span class='kw'>return</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_orig_key'>orig_key</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Fri May 8 17:03:37 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>