You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Theodosius/doxygen/html/d7/de2/classtheo_1_1obf_1_1transfo...

359 lines
20 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Theodosius: theo::obf::transform::operation_t Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Theodosius
&#160;<span id="projectnumber">v3.0</span>
</div>
<div id="projectbrief">Jit linker, mapper, obfuscator, and mutator</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="../../da/de6/namespacetheo.html">theo</a></li><li class="navelem"><a class="el" href="../../d5/da8/namespacetheo_1_1obf.html">obf</a></li><li class="navelem"><a class="el" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html">transform</a></li><li class="navelem"><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html">operation_t</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="../../d3/daa/classtheo_1_1obf_1_1transform_1_1operation__t-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">theo::obf::transform::operation_t Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html" title="operation_t is the base class for all types of transformations. classes that inherit this class are s...">operation_t</a> is the base class for all types of transformations. classes that inherit this class are singleton and simply call the super constructor (<a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a3876ca1c7904aed54940e1519fc9fdf4" title="explicit constructor for operation_t">operation_t::operation_t</a>).
<a href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="../../">operation.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for theo::obf::transform::operation_t:</div>
<div class="dyncontent">
<div class="center">
<img src="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.png" usemap="#theo::obf::transform::operation_5Ft_map" alt=""/>
<map id="theo::obf::transform::operation_5Ft_map" name="theo::obf::transform::operation_5Ft_map">
<area href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html" alt="theo::obf::transform::add_op_t" shape="rect" coords="0,56,188,80"/>
<area href="../../d6/d52/classtheo_1_1obf_1_1transform_1_1rol__op__t.html" alt="theo::obf::transform::rol_op_t" shape="rect" coords="198,56,386,80"/>
<area href="../../db/d8f/classtheo_1_1obf_1_1transform_1_1ror__op__t.html" alt="theo::obf::transform::ror_op_t" shape="rect" coords="396,56,584,80"/>
<area href="../../d6/d52/classtheo_1_1obf_1_1transform_1_1sub__op__t.html" alt="theo::obf::transform::sub_op_t" shape="rect" coords="594,56,782,80"/>
<area href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html" alt="theo::obf::transform::xor_op_t" shape="rect" coords="792,56,980,80"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3876ca1c7904aed54940e1519fc9fdf4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a3876ca1c7904aed54940e1519fc9fdf4">operation_t</a> (<a class="el" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html#a875984c1ce09aa998fe48cca55270ecc">transform_t</a> op, xed_iclass_enum_t <a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a8558c2a8e78ef8da59674396bc76157f">type</a>)</td></tr>
<tr class="memdesc:a3876ca1c7904aed54940e1519fc9fdf4"><td class="mdescLeft">&#160;</td><td class="mdescRight">explicit constructor for <a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html" title="operation_t is the base class for all types of transformations. classes that inherit this class are s...">operation_t</a> <a href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a3876ca1c7904aed54940e1519fc9fdf4">More...</a><br /></td></tr>
<tr class="separator:a3876ca1c7904aed54940e1519fc9fdf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a414b1716ec527c26bfcbd5262c21a7a8"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::uint8_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a414b1716ec527c26bfcbd5262c21a7a8">native</a> (const xed_decoded_inst_t *inst, std::uint32_t imm)</td></tr>
<tr class="memdesc:a414b1716ec527c26bfcbd5262c21a7a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">generates a native transform instruction given an existing instruction. it works like so: <a href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a414b1716ec527c26bfcbd5262c21a7a8">More...</a><br /></td></tr>
<tr class="separator:a414b1716ec527c26bfcbd5262c21a7a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91f9b94436d49659aaabb291786b3c7b"><td class="memItemLeft" align="right" valign="top">xed_iclass_enum_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a91f9b94436d49659aaabb291786b3c7b">inverse</a> ()</td></tr>
<tr class="memdesc:a91f9b94436d49659aaabb291786b3c7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">gets the inverse operation of the current operation. <a href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a91f9b94436d49659aaabb291786b3c7b">More...</a><br /></td></tr>
<tr class="separator:a91f9b94436d49659aaabb291786b3c7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a307c6d7d48319d28d39d93c1df18680a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html#a875984c1ce09aa998fe48cca55270ecc">transform_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a307c6d7d48319d28d39d93c1df18680a">get_transform</a> ()</td></tr>
<tr class="memdesc:a307c6d7d48319d28d39d93c1df18680a"><td class="mdescLeft">&#160;</td><td class="mdescRight">gets a pointer to the lambda function which contains the transform logic. <a href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a307c6d7d48319d28d39d93c1df18680a">More...</a><br /></td></tr>
<tr class="separator:a307c6d7d48319d28d39d93c1df18680a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8558c2a8e78ef8da59674396bc76157f"><td class="memItemLeft" align="right" valign="top">xed_iclass_enum_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a8558c2a8e78ef8da59674396bc76157f">type</a> ()</td></tr>
<tr class="memdesc:a8558c2a8e78ef8da59674396bc76157f"><td class="mdescLeft">&#160;</td><td class="mdescRight">gets the operation type. such as XED_ICLASS_ADD, XED_ICLASS_SUB, etc... <a href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a8558c2a8e78ef8da59674396bc76157f">More...</a><br /></td></tr>
<tr class="separator:a8558c2a8e78ef8da59674396bc76157f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aaa5859bc3c7f95d99d4d726289593488"><td class="memItemLeft" align="right" valign="top">static std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#aaa5859bc3c7f95d99d4d726289593488">random</a> (std::size_t lowest, std::size_t largest)</td></tr>
<tr class="memdesc:aaa5859bc3c7f95d99d4d726289593488"><td class="mdescLeft">&#160;</td><td class="mdescRight">generate a random number in a range. <a href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#aaa5859bc3c7f95d99d4d726289593488">More...</a><br /></td></tr>
<tr class="separator:aaa5859bc3c7f95d99d4d726289593488"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html" title="operation_t is the base class for all types of transformations. classes that inherit this class are s...">operation_t</a> is the base class for all types of transformations. classes that inherit this class are singleton and simply call the super constructor (<a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a3876ca1c7904aed54940e1519fc9fdf4" title="explicit constructor for operation_t">operation_t::operation_t</a>). </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a3876ca1c7904aed54940e1519fc9fdf4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3876ca1c7904aed54940e1519fc9fdf4">&#9670;&nbsp;</a></span>operation_t()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">theo::obf::transform::operation_t::operation_t </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html#a875984c1ce09aa998fe48cca55270ecc">transform_t</a>&#160;</td>
<td class="paramname"><em>op</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">xed_iclass_enum_t&#160;</td>
<td class="paramname"><em>type</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>explicit constructor for <a class="el" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html" title="operation_t is the base class for all types of transformations. classes that inherit this class are s...">operation_t</a> </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">op</td><td>lambda function when executed applies transformations.</td></tr>
<tr><td class="paramname">type</td><td>type of transformation, such as XOR, ADD, SUB, etc...</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a307c6d7d48319d28d39d93c1df18680a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a307c6d7d48319d28d39d93c1df18680a">&#9670;&nbsp;</a></span>get_transform()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html#a875984c1ce09aa998fe48cca55270ecc">transform_t</a>* theo::obf::transform::operation_t::get_transform </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>gets a pointer to the lambda function which contains the transform logic. </p>
<dl class="section return"><dt>Returns</dt><dd>a pointer to the lambda function which contains the transform logic.</dd></dl>
</div>
</div>
<a id="a91f9b94436d49659aaabb291786b3c7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a91f9b94436d49659aaabb291786b3c7b">&#9670;&nbsp;</a></span>inverse()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">xed_iclass_enum_t theo::obf::transform::operation_t::inverse </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>gets the inverse operation of the current operation. </p>
<dl class="section return"><dt>Returns</dt><dd>the inverse operation of the current operation.</dd></dl>
</div>
</div>
<a id="a414b1716ec527c26bfcbd5262c21a7a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a414b1716ec527c26bfcbd5262c21a7a8">&#9670;&nbsp;</a></span>native()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;std::uint8_t&gt; theo::obf::transform::operation_t::native </td>
<td>(</td>
<td class="paramtype">const xed_decoded_inst_t *&#160;</td>
<td class="paramname"><em>inst</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::uint32_t&#160;</td>
<td class="paramname"><em>imm</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>generates a native transform instruction given an existing instruction. it works like so: </p>
<p>mov rax, &amp;MessageBoxA ; original instruction with relocation</p>
<p>; this function takes the first operand and out of the original ; instruction and uses it to generate a transformation.</p>
<p>xor rax, 0x39280928 ; this would be an example output for the xor ;operation.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">inst</td><td>instruction with a relocation to generate a transformation for.</td></tr>
<tr><td class="paramname">imm</td><td>random 32bit number used in the generate transform.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>returns the bytes of the native instruction that was encoded.</dd></dl>
</div>
</div>
<a id="aaa5859bc3c7f95d99d4d726289593488"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa5859bc3c7f95d99d4d726289593488">&#9670;&nbsp;</a></span>random()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static std::size_t theo::obf::transform::operation_t::random </td>
<td>(</td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>lowest</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>largest</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>generate a random number in a range. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">lowest</td><td>lowest value of the range.</td></tr>
<tr><td class="paramname">largest</td><td>highest value of the range.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a random value in a range.</dd></dl>
</div>
</div>
<a id="a8558c2a8e78ef8da59674396bc76157f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8558c2a8e78ef8da59674396bc76157f">&#9670;&nbsp;</a></span>type()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">xed_iclass_enum_t theo::obf::transform::operation_t::type </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>gets the operation type. such as XED_ICLASS_ADD, XED_ICLASS_SUB, etc... </p>
<dl class="section return"><dt>Returns</dt><dd>the operation type. such as XED_ICLASS_ADD, XED_ICLASS_SUB, etc...</dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/obf/transform/<a class="el" href="../../">operation.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>