parent
a26be3fd80
commit
05f0e6a239
@ -0,0 +1,185 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/recomp/symbol_table.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_d92462d752f7a277bbc0245a347b2579.html">recomp</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">symbol_table.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d0/d5e/symbol__table_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <algorithm></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include <functional></span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#include <map></span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="preprocessor">#include <optional></span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#include <<a class="code" href="../../d6/d62/symbol_8hpp.html">decomp/symbol.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/dbd/namespacetheo_1_1recomp.html" title="this namespace encompasses all recomposition related code.">theo::recomp</a> {<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment">/// this class is a high level wrapper for a hashmap that contains</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment">/// decomp::symbol_t values. the symbol values are references by a hashcode.</span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html"> 45</a></span><span class="comment"></span><span class="keyword">class </span><a class="code hl_class" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html" title="this class is a high level wrapper for a hashmap that contains decomp::symbol_t values....">symbol_table_t</a> {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">public</span>:<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment"> /// default constructor. does nothing.</span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ad06d4004c0cb454b1ffe7e2ae2ccedf5"> 50</a></span><span class="comment"></span> <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ad06d4004c0cb454b1ffe7e2ae2ccedf5" title="default constructor. does nothing.">symbol_table_t</a>() {}</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment"> /// this constructor will populate the m_table private field with symbols.</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment"> /// <param name="syms">vector of decomp::symbol_t</param></span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment"></span> <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ad06d4004c0cb454b1ffe7e2ae2ccedf5" title="default constructor. does nothing.">symbol_table_t</a>(<span class="keyword">const</span> std::vector<decomp::symbol_t>&& syms);</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="comment"> /// add symbol to m_table</span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="comment"> /// <param name="sym">symbol to be added.</param></span></div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#af9caf2d4d97b2498aa624c3750a7a601" title="add symbol to m_table">put_symbol</a>(<a class="code hl_class" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html" title="symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....">decomp::symbol_t</a>& sym);</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="comment"> /// add a vector of symbol to m_table</span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment"> /// <param name="syms"></param></span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ae7c35d9336f67d3175910c028e0b9b3e" title="add a vector of symbol to m_table">put_symbols</a>(std::vector<decomp::symbol_t>& syms);</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="comment"> /// returns an optional pointer to a symbol from the symbol table given the</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment"> /// symbols hash (hash of its name) the hash is produced by</span></div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment"> /// theo::decomp::symbol_t::hash</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="comment"> /// <param name="hash">hashcode of the symbol to get from the symbol</span></div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"> /// table...</param> <returns>returns an optional pointer to a</span></div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment"> /// theo::decomp::symbol_t</returns></span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment"></span> std::optional<decomp::symbol_t*> <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a308c0dbcc4d569467e0986b32ef30db5" title="returns an optional pointer to a symbol from the symbol table given the symbols hash (hash of its nam...">sym_from_hash</a>(std::size_t hash);</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="comment"> /// returns an optional pointer to a symbol given its allocation location.</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"> /// <param name="allocated_at">the address where the symbol is allocated</span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// at.</param> <returns>returns an optional pointer to a</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// theo::decomp::symbol_t</returns></span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"></span> std::optional<decomp::symbol_t*> <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#abaea9fd899d87b09d60c2b815624e2d2" title="returns an optional pointer to a symbol given its allocation location.">sym_from_alloc</a>(std::uintptr_t allocated_at);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"> /// this function is a wrapper function that allows you to get at each entry</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"> /// in the symbol table by reference.</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"> /// <param name="fn">a callback function that will be called for each</span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment"> /// symbol</param></span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a35008ba37814a94209cf979302e13e6d" title="this function is a wrapper function that allows you to get at each entry in the symbol table by refer...">for_each</a>(<a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a">std::function</a><<span class="keywordtype">void</span>(<a class="code hl_class" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html" title="symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....">decomp::symbol_t</a>& sym)> fn);</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"> /// returns the size of the symbol table.</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> /// <returns>returns the size of the symbol table.</returns></span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"></span> std::uint32_t <a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#af57c0495a442ea86af0f9cca4521631e" title="returns the size of the symbol table.">size</a>();</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::map<std::size_t, decomp::symbol_t> m_table;</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span>};</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>} <span class="comment">// namespace theo::recomp</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,127 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/obf/transform/xor_op.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_ef99456410776b930b88f5850437ce61.html">obf</a></li><li class="navelem"><a class="el" href="../../dir_fa1ee7704f0ab8e5fd961a68bf21be50.html">transform</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">xor_op.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d0/da4/xor__op_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <<a class="code" href="../../d5/da4/operation_8hpp.html">obf/transform/operation.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html" title="this namespace encompasses the code for transforming relocations.">theo::obf::transform</a> {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html"> 35</a></span><span class="keyword">class </span><a class="code hl_class" href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html">xor_op_t</a> : <span class="keyword">public</span> <a class="code hl_class" 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> {</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">explicit</span> <a class="code hl_class" href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html">xor_op_t</a>()</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> : <a class="code hl_function" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a3876ca1c7904aed54940e1519fc9fdf4" title="explicit constructor for operation_t">operation_t</a>([&](std::size_t val,</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> std::uint32_t imm) -> std::size_t { <span class="keywordflow">return</span> val ^ imm; },</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> XED_ICLASS_XOR) {}</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html#adaca6aff562bd3f37176b569a898f8b4"> 42</a></span> <span class="keyword">static</span> <a class="code hl_class" href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html">xor_op_t</a>* <a class="code hl_function" href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html#adaca6aff562bd3f37176b569a898f8b4">get</a>() {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">static</span> <a class="code hl_class" href="../../da/db7/classtheo_1_1obf_1_1transform_1_1xor__op__t.html">xor_op_t</a> obj;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> &obj;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>};</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>} <span class="comment">// namespace theo::obf::transform</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,192 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/recomp/reloc.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_d92462d752f7a277bbc0245a347b2579.html">recomp</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">reloc.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d1/d82/reloc_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <cstddef></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#include <<a class="code" href="../../d6/deb/transform_8hpp.html">obf/transform/transform.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/dbd/namespacetheo_1_1recomp.html" title="this namespace encompasses all recomposition related code.">theo::recomp</a> {</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment">/// meta data about a relocation for a symbol</span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html"> 41</a></span><span class="comment"></span><span class="keyword">class </span><a class="code hl_class" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html" title="meta data about a relocation for a symbol">reloc_t</a> {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">public</span>:<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment"> /// explicit constructor for this class.</span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> /// <param name="offset">offset into the symbol data where the relocation is</span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> /// at. all relocations are assumed to be linear virtual addresses of the</span></div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment"> /// symbol.</param></span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment"> /// <param name="hash">hash of the symbol to which the relocation is</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment"> /// of.</param> <param name="sym_name">the name of the symbol to which the</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment"> /// relocation is of.</param></span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a7cb1cf1c58a6f3cdf7ae326d65948548"> 52</a></span><span class="comment"></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a7cb1cf1c58a6f3cdf7ae326d65948548" title="explicit constructor for this class.">reloc_t</a>(std::uint32_t <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a537836fcea3326e4269375a1486f0323" title="returns the offset into the symbol to which the relocation will be applied. the offset is in bytes....">offset</a>,</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> std::size_t <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#aa340b2c2d5d1ac7f96a1dbee39f25461" title="returns the hash of the relocation symbol.">hash</a>,</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keyword">const</span> std::string&& sym_name)</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> : m_offset(<a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a537836fcea3326e4269375a1486f0323" title="returns the offset into the symbol to which the relocation will be applied. the offset is in bytes....">offset</a>), m_hash(<a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#aa340b2c2d5d1ac7f96a1dbee39f25461" title="returns the hash of the relocation symbol.">hash</a>), m_sym_name(sym_name) {}</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="comment"> /// returns the hash of the relocation symbol.</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment"> /// <returns>hash of the relocation symbol</returns></span></div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#aa340b2c2d5d1ac7f96a1dbee39f25461"> 61</a></span><span class="comment"></span> std::size_t <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#aa340b2c2d5d1ac7f96a1dbee39f25461" title="returns the hash of the relocation symbol.">hash</a>() { <span class="keywordflow">return</span> m_hash; }</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="comment"> /// returns the name of the relocation symbol.</span></div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"> /// <returns>returns the name of the relocation symbol.</returns></span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#aa181755df50bc566b164072b21788fec"> 67</a></span><span class="comment"></span> std::string <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#aa181755df50bc566b164072b21788fec" title="returns the name of the relocation symbol.">name</a>() { <span class="keywordflow">return</span> m_sym_name; }</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="comment"> /// returns the offset into the symbol to which the relocation will be</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="comment"> /// applied. the offset is in bytes. zero based.</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment"> /// <returns>returns the offset into the symbol to which the relocation will</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> /// be applied. the offset is in bytes. zero based.</returns></span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a537836fcea3326e4269375a1486f0323"> 75</a></span><span class="comment"></span> std::uint32_t <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a537836fcea3326e4269375a1486f0323" title="returns the offset into the symbol to which the relocation will be applied. the offset is in bytes....">offset</a>() { <span class="keywordflow">return</span> m_offset; }</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment"> /// sets the offset to which the relocation gets applied too.</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment"> /// <param name="offset">offset to which the relocation gets applied</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="comment"> /// too.</param></span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a99e65270ace1ff4f080bd4040c8a43dd"> 82</a></span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a99e65270ace1ff4f080bd4040c8a43dd" title="sets the offset to which the relocation gets applied too.">offset</a>(std::uint32_t <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a537836fcea3326e4269375a1486f0323" title="returns the offset into the symbol to which the relocation will be applied. the offset is in bytes....">offset</a>) { m_offset = <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#a99e65270ace1ff4f080bd4040c8a43dd" title="sets the offset to which the relocation gets applied too.">offset</a>; }</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// adds a transformation to be applied to the relocation prior to writing it</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"> /// into the symbol.</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"> /// <param name="entry">a pair containing a lambda function that when executed</span></div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"> /// transforms a relocation. the second value in the pair is a random value</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"> /// which is passed to the lambda.</param></span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#ab5214a9ff9135672e25f40406c37fb10"> 91</a></span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#ab5214a9ff9135672e25f40406c37fb10" title="adds a transformation to be applied to the relocation prior to writing it into the symbol.">add_transform</a>(</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::pair<obf::transform::transform_t*, std::uint32_t> entry) {</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> m_transforms.push_back(entry);</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"> /// gets the vector of transformation.</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> /// <returns>returns the vector of transformations.</returns></span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"></span> std::vector<std::pair<obf::transform::transform_t*, std::uint32_t>>&</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#af8abfa7a4f1052308a233629faf39a78"> 101</a></span> <a class="code hl_function" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html#af8abfa7a4f1052308a233629faf39a78" title="gets the vector of transformation.">get_transforms</a>() {</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span> m_transforms;</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> std::vector<std::pair<obf::transform::transform_t*, std::uint32_t>></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> m_transforms;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::string m_sym_name;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> std::size_t m_hash;</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::uint32_t m_offset;</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>};</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>} <span class="comment">// namespace theo::recomp</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,127 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/obf/transform/add_op.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_ef99456410776b930b88f5850437ce61.html">obf</a></li><li class="navelem"><a class="el" href="../../dir_fa1ee7704f0ab8e5fd961a68bf21be50.html">transform</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">add_op.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d1/def/add__op_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <<a class="code" href="../../d5/da4/operation_8hpp.html">obf/transform/operation.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html"> 34</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d8/d82/namespacetheo_1_1obf_1_1transform.html" title="this namespace encompasses the code for transforming relocations.">theo::obf::transform</a> {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html"> 35</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html">add_op_t</a> : <span class="keyword">public</span> <a class="code hl_class" 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> {</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">explicit</span> <a class="code hl_class" href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html">add_op_t</a>()</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> : <a class="code hl_function" href="../../d7/de2/classtheo_1_1obf_1_1transform_1_1operation__t.html#a3876ca1c7904aed54940e1519fc9fdf4" title="explicit constructor for operation_t">operation_t</a>([&](std::size_t val,</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> std::uint32_t imm) -> std::size_t { <span class="keywordflow">return</span> val + imm; },</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> XED_ICLASS_ADD) {}</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html#a73d8d592c092482231fb5321ded6e83b"> 42</a></span> <span class="keyword">static</span> <a class="code hl_class" href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html">add_op_t</a>* <a class="code hl_function" href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html#a73d8d592c092482231fb5321ded6e83b">get</a>() {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">static</span> <a class="code hl_class" href="../../d5/d9f/classtheo_1_1obf_1_1transform_1_1add__op__t.html">add_op_t</a> obj;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> &obj;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>};</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>} <span class="comment">// namespace theo::obf::transform</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,190 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/theo.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">theo.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d2/d24/theo_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <spdlog/spdlog.h></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include <<a class="code" href="../../d2/d96/decomp_8hpp.html">decomp/decomp.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#include <<a class="code" href="../../de/d46/engine_8hpp.html">obf/engine.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="preprocessor">#include <<a class="code" href="../../d4/d4a/recomp_8hpp.html">recomp/recomp.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#include <<a class="code" href="../../d0/d5e/symbol__table_8hpp.html">recomp/symbol_table.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#include <<a class="code" href="../../d2/df9/jcc__rewrite__pass_8hpp.html">obf/passes/jcc_rewrite_pass.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="preprocessor">#include <<a class="code" href="../../d5/d54/next__inst__pass_8hpp.html">obf/passes/next_inst_pass.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#include <<a class="code" href="../../de/d64/reloc__transform__pass_8hpp.html">obf/passes/reloc_transform_pass.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#include <optional></span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor">#include <tuple></span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../d2/d24/theo_8hpp.html#a3925943d185a09ad9e32ed8637ccb533"> 46</a></span><span class="preprocessor">#define XED_ENCODER</span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="preprocessor">#include <xed-decode.h></span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="preprocessor">#include <xed-interface.h></span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>}</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment">/// The outer most encompassing namespace of this project.</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment"></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/de6/namespacetheo.html" title="The outer most encompassing namespace of this project.">theo</a> {</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="comment">/// tuple of functions used by theo to allocate, copy, and resolve symbols.</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="../../da/de6/namespacetheo.html#a66efe2c63e06764fb2d9a378c688c680"> 60</a></span><span class="comment"></span><span class="keyword">using</span> <a class="code hl_typedef" href="../../da/de6/namespacetheo.html#a66efe2c63e06764fb2d9a378c688c680" title="tuple of functions used by theo to allocate, copy, and resolve symbols.">lnk_fns_t</a> =</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> std::tuple<recomp::allocator_t, recomp::copier_t, recomp::resolver_t>;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="comment">/// the main class which encapsulates a symbol table, decomp, and recomp</span></div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="comment">/// objects. This class is a bridge that connects all three: decomp, obf,</span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment">/// recomp.</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment">///</span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment">/// You will create an object of this type when using theo.</span></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="../../d9/dbc/classtheo_1_1theo__t.html"> 70</a></span><span class="comment"></span><span class="keyword">class </span><a class="code hl_class" href="../../d9/dbc/classtheo_1_1theo__t.html" title="the main class which encapsulates a symbol table, decomp, and recomp objects. This class is a bridge ...">theo_t</a> {</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">public</span>:<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment"> /// explicit constructor for theo class.</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="comment"> /// <param name="lib">a vector of bytes consisting of a lib</param></span></div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"> /// <param name="lnkr_fns"></param></span></div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment"> /// <param name="entry_sym">the name of the function which will be used as the</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment"> /// entry point</param></span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a0a9ae3322261b97cf1dc47c908ef3c6d" title="explicit constructor for theo class.">theo_t</a>(std::vector<std::uint8_t>& lib,</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <a class="code hl_typedef" href="../../da/de6/namespacetheo.html#a66efe2c63e06764fb2d9a378c688c680" title="tuple of functions used by theo to allocate, copy, and resolve symbols.">lnk_fns_t</a> lnkr_fns,</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">const</span> std::string&& entry_sym);</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// decomposes the lib file and return the number of symbols that are used.</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"> /// <returns>optional amount of symbols that are used. no value if</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment"> /// decomposition fails.</returns></span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"></span> std::optional<std::uint32_t> <a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a66257ff5d9825483d85e58384a12760a" title="decomposes the lib file and return the number of symbols that are used.">decompose</a>();</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"> /// compose the decomposed module. This will run obfuscation passes, the map</span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"> /// and resolve symbols to each other.</span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="comment"> /// <returns>returns the address of the entry point symbol</returns></span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"></span> std::uintptr_t <a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a39e067dd71f82b437c6a418d41e38b27" title="compose the decomposed module. This will run obfuscation passes, the map and resolve symbols to each ...">compose</a>();</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// given the name of a symbol, it returns the address of where its mapped.</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"> /// <param name="sym">the name of the symbol</param></span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"> /// <returns>the address of the symbol</returns></span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment"></span> std::uintptr_t <a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a97c52bda4b07a456ff1ea6f3c1cdbe24" title="given the name of a symbol, it returns the address of where its mapped.">resolve</a>(<span class="keyword">const</span> std::string&& sym);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::string m_entry_sym;</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_class" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html" title="the main decomposition class which is responsible for breaking down lib file into coff files,...">decomp::decomp_t</a> m_dcmp;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_class" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html" title="the main class responsible for recomposition">recomp::recomp_t</a> m_recmp;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_class" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html" title="this class is a high level wrapper for a hashmap that contains decomp::symbol_t values....">recomp::symbol_table_t</a> m_sym_tbl;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span>};</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>} <span class="comment">// namespace theo</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,155 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: src/theo.cpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">theo.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d2/d26/theo_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include <<a class="code" href="../../d2/d24/theo_8hpp.html">theo.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/de6/namespacetheo.html" title="The outer most encompassing namespace of this project.">theo</a> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../d9/dbc/classtheo_1_1theo__t.html#a0a9ae3322261b97cf1dc47c908ef3c6d"> 34</a></span><a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a0a9ae3322261b97cf1dc47c908ef3c6d" title="explicit constructor for theo class.">theo_t::theo_t</a>(std::vector<std::uint8_t>& lib,</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <a class="code hl_typedef" href="../../da/de6/namespacetheo.html#a66efe2c63e06764fb2d9a378c688c680" title="tuple of functions used by theo to allocate, copy, and resolve symbols.">lnk_fns_t</a> lnkr_fns,</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">const</span> std::string&& entry_sym)</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> : m_dcmp(lib, &m_sym_tbl),</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> m_recmp(&m_dcmp, {}, {}, {}),</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> m_entry_sym(entry_sym) {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> m_recmp.<a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a0da9a904b0057c14190218592aff0f07" title="setter for the allocater lambda function.">allocator</a>(std::get<0>(lnkr_fns));</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> m_recmp.<a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#aa6fecf752d4c5bc211e164d8496724b1" title="setter for the copier lambda function.">copier</a>(std::get<1>(lnkr_fns));</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> m_recmp.<a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a1be6d0cdb57565c31b138248c8b2d470" title="setter for the resolve lambda function.">resolver</a>(std::get<2>(lnkr_fns));</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span>}</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../d9/dbc/classtheo_1_1theo__t.html#a66257ff5d9825483d85e58384a12760a"> 45</a></span>std::optional<std::uint32_t> <a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a66257ff5d9825483d85e58384a12760a" title="decomposes the lib file and return the number of symbols that are used.">theo_t::decompose</a>() {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">auto</span> res = m_dcmp.<a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#ae23353a4293aa30969b6d3fa37359469" title="decomposes (extracts) the symbols used. this function determines all used symbols given the entry poi...">decompose</a>(m_entry_sym);</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">if</span> (!res.has_value()) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> spdlog::error(<span class="stringliteral">"failed to decompose...\n"</span>);</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> {};</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> spdlog::info(<span class="stringliteral">"decompose successful... {} symbols"</span>, res.value()->size());</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">return</span> res.value()->size();</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span>}</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="../../d9/dbc/classtheo_1_1theo__t.html#a39e067dd71f82b437c6a418d41e38b27"> 56</a></span>std::uintptr_t <a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a39e067dd71f82b437c6a418d41e38b27" title="compose the decomposed module. This will run obfuscation passes, the map and resolve symbols to each ...">theo_t::compose</a>() {</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="comment">// run obfuscation engine on all symbols...</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">auto</span> engine = <a class="code hl_function" href="../../d9/d18/classtheo_1_1obf_1_1engine__t.html#a58715f5c3ade824a65e602aba570040e" title="get the singleton object of this class.">obf::engine_t::get</a>();</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> m_sym_tbl.<a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a35008ba37814a94209cf979302e13e6d" title="this function is a wrapper function that allows you to get at each entry in the symbol table by refer...">for_each</a>([&](<a class="code hl_class" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html" title="symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....">decomp::symbol_t</a>& sym) { engine->run(&sym); });</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> m_recmp.<a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a78502665e218d3addca9b1e5e3875f39" title="when called, this function allocates space for every symbol.">allocate</a>();</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> m_recmp.<a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a299fbede378f04991df2e39293307094" title="when called, this function resolves all relocations in every symbol.">resolve</a>();</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> m_recmp.<a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a080d88f122d12faf2e328c9bdd10be6e" title="when called, this function copies symbols into allocations.">copy_syms</a>();</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> m_recmp.<a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a299fbede378f04991df2e39293307094" title="when called, this function resolves all relocations in every symbol.">resolve</a>(m_entry_sym.data());</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>}</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../d9/dbc/classtheo_1_1theo__t.html#a97c52bda4b07a456ff1ea6f3c1cdbe24"> 68</a></span>std::uintptr_t <a class="code hl_function" href="../../d9/dbc/classtheo_1_1theo__t.html#a97c52bda4b07a456ff1ea6f3c1cdbe24" title="given the name of a symbol, it returns the address of where its mapped.">theo_t::resolve</a>(<span class="keyword">const</span> std::string&& sym) {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keyword">auto</span> val = m_sym_tbl.<a class="code hl_function" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a308c0dbcc4d569467e0986b32ef30db5" title="returns an optional pointer to a symbol from the symbol table given the symbols hash (hash of its nam...">sym_from_hash</a>(<a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06" title="gets the hash of the symbol name.">decomp::symbol_t::hash</a>(sym));</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">if</span> (!val.has_value())</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">return</span> {};</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> val.value()->allocated_at();</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span>}</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span>} <span class="comment">// namespace theo</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,229 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/decomp/decomp.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_2ff93ba14c434dbcd5d31be832ec37b1.html">decomp</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">decomp.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d2/d96/decomp_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <spdlog/spdlog.h></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#include <linuxpe></span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="preprocessor">#include <optional></span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#include <set></span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="preprocessor">#include <tuple></span></div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#include <<a class="code" href="../../de/df5/routine_8hpp.html">decomp/routine.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="preprocessor">#include <<a class="code" href="../../d0/d5e/symbol__table_8hpp.html">recomp/symbol_table.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor">#include <coff/archive.hpp></span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor">#include <coff/image.hpp></span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment">/// the namespace that contains all of the decomposition related code.</span></div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../da/de6/namespacetheo.html"> 49</a></span><span class="comment"></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/dbd/namespacetheo_1_1decomp.html" title="the namespace that contains all of the decomposition related code.">theo::decomp</a> {</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">/// meta symbol data. consists of the coff image which contains the coff symbol,</span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment">/// the coff symbol itself, and the size (if any) of the symbol.</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../d9/dbd/namespacetheo_1_1decomp.html#abbf09e1f7eb9e42057ff9c9e8be41266"> 55</a></span><span class="comment"></span><span class="keyword">using</span> <a class="code hl_typedef" href="../../d9/dbd/namespacetheo_1_1decomp.html#abbf09e1f7eb9e42057ff9c9e8be41266" title="meta symbol data. consists of the coff image which contains the coff symbol, the coff symbol itself,...">sym_data_t</a> = std::tuple<coff::image_t*, coff::symbol_t*, std::uint32_t>;</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="comment">/// the main decomposition class which is responsible for breaking down lib file</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="comment">/// into coff files, and extracted used symbols from the coff files.</span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html"> 61</a></span><span class="comment"></span><span class="keyword">class </span><a class="code hl_class" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html" title="the main decomposition class which is responsible for breaking down lib file into coff files,...">decomp_t</a> {</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">public</span>:<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="comment"> /// the explicit constructor for decomp_t</span></div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"> /// <param name="lib">vector of bytes containing the lib file.</param></span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment"> /// <param name="syms">symbol table that gets populated and managed by this</span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"> /// class.</param></span></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment"></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#a35cfac16bd918d576b29e04388690d68" title="the explicit constructor for decomp_t">decomp_t</a>(std::vector<std::uint8_t>& <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#aa728bde8ec1c5c28ec09f86adf427ae2" title="gets a vector of bytes consisting of the lib file.">lib</a>,</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_class" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html" title="this class is a high level wrapper for a hashmap that contains decomp::symbol_t values....">recomp::symbol_table_t</a>* <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#a8630f2ee0f4fb9516f5b20014e4c6120" title="gets the symbol table.">syms</a>);</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment"> /// gets all of the routine objects.</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="comment"> /// <returns>vector of routine objects.</returns></span></div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"></span> std::vector<routine_t> <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#a79c965ec0a996a936faae7f54b0e055e" title="gets all of the routine objects.">rtns</a>();</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"> /// gets a vector of bytes consisting of the lib file.</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="comment"> /// <returns>a vector of bytes consisting of the lib file.</returns></span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="comment"></span> std::vector<std::uint8_t> <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#aa728bde8ec1c5c28ec09f86adf427ae2" title="gets a vector of bytes consisting of the lib file.">lib</a>();</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// gets all the obj files as a vector of a vector of bytes.</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment"> /// <returns>all the obj files as a vector of a vector of bytes.</returns></span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"></span> std::vector<std::vector<std::uint8_t>> <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#a81ae70b313a9ef24ea5d8f404699baef" title="gets all the obj files as a vector of a vector of bytes.">objs</a>();</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"> /// gets the symbol table.</span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment"> /// <returns>the symbol table.</returns></span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="comment"></span> <a class="code hl_class" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html" title="this class is a high level wrapper for a hashmap that contains decomp::symbol_t values....">recomp::symbol_table_t</a>* <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#a8630f2ee0f4fb9516f5b20014e4c6120" title="gets the symbol table.">syms</a>();</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"> /// gets the section hash table section header --> hash of the section header</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// ptr.</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"> /// <returns>the section hash table section header --> hash of the section</span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"> /// header ptr.</returns></span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment"></span> std::map<coff::section_header_t*, std::size_t>& <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#a860dddc3a5d12231b685dbaa12a0db06" title="gets the section hash table section header --> hash of the section header ptr.">scn_hash_tbl</a>();</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment"> /// decomposes (extracts) the symbols used. this function determines all used</span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="comment"> /// symbols given the entry point.</span></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="comment"> /// <param name="entry_sym">the entry point symbol name.</param></span></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="comment"> /// <returns>returns an optional pointer to the symbol table. no value in the</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="comment"> /// optional object on failure.</returns></span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="comment"></span> std::optional<recomp::symbol_table_t*> <a class="code hl_function" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html#ae23353a4293aa30969b6d3fa37359469" title="decomposes (extracts) the symbols used. this function determines all used symbols given the entry poi...">decompose</a>(std::string& entry_sym);</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">private</span>:<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="comment"> /// extracts used symbols from coff files.</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="comment"> /// <param name="entry_sym">the entry point symbol name</param></span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="comment"> /// <returns>number of symbols used</returns></span></div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span><span class="comment"></span> std::uint32_t ext_used_syms(<span class="keyword">const</span> std::string&& entry_sym);</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><span class="comment"> /// get symbol meta data by name.</span></div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="comment"> /// <param name="name">symbol name</param></span></div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="comment"> /// <returns>optional symbol meta data if it exists.</returns></span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span><span class="comment"></span> std::optional<sym_data_t> get_symbol(<span class="keyword">const</span> std::string_view& name);</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span><span class="comment"> /// the next symbol in the section.</span></div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="comment"> /// <param name="img">coff image that contains the symbol.</param></span></div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span><span class="comment"> /// <param name="hdr">coff section header of the section that contains the</span></div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="comment"> /// symbol.</param></span></div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="comment"> /// <param name="s">symbol in which to get the next one of.</param></span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="comment"> /// <returns>offset into the section where the next symbol is at.</returns></span></div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span><span class="comment"></span> std::uint32_t next_sym(coff::image_t* img,</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> coff::section_header_t* hdr,</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> coff::symbol_t* s);</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keyword">const</span> std::vector<std::uint8_t> m_lib;</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> std::vector<std::vector<std::uint8_t>> m_objs;</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> std::vector<routine_t> m_rtns;</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> std::set<sym_data_t> m_used_syms;</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> std::set<coff::image_t*> m_processed_objs;</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> std::map<coff::section_header_t*, std::size_t> m_scn_hash_tbl;</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> std::map<std::size_t, std::vector<sym_data_t>> m_lookup_tbl;</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_class" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html" title="this class is a high level wrapper for a hashmap that contains decomp::symbol_t values....">recomp::symbol_table_t</a>* m_syms;</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span>};</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span>} <span class="comment">// namespace theo::decomp</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,255 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: src/decomp/routine.cpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="../../dir_1a96c2bb8e6464c69de5f985611044b4.html">decomp</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">routine.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d2/dbb/routine_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include <<a class="code" href="../../de/df5/routine_8hpp.html">decomp/routine.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/dbd/namespacetheo_1_1decomp.html" title="the namespace that contains all of the decomposition related code.">theo::decomp</a> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#ab9f0693c5ec50954d953b28bebe4426b"> 34</a></span><a class="code hl_function" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#ab9f0693c5ec50954d953b28bebe4426b" title="the explicit constructor for routine_t.">routine_t::routine_t</a>(coff::symbol_t* sym,</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> coff::image_t* img,</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> coff::section_header_t* scn,</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> std::vector<std::uint8_t>& fn,</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <a class="code hl_enumeration" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9" title="meta symbol type. this is an abstraction upon the coff symbol storage/class type.">sym_type_t</a> dcmp_type)</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> : m_img(img), m_scn(scn), m_data(fn), m_dcmp_type(dcmp_type), m_sym(sym) {}</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#a1f790bd144badc71d6c4942cac8fc4e8"> 41</a></span>std::vector<decomp::symbol_t> <a class="code hl_function" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#a1f790bd144badc71d6c4942cac8fc4e8" title="decompose the function into symbol(s).">routine_t::decompose</a>() {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> std::vector<decomp::symbol_t> result;</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">switch</span> (m_dcmp_type) {</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a">function</a>: {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> std::vector<recomp::reloc_t> relocs;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">auto</span> scn_relocs = <span class="keyword">reinterpret_cast<</span>coff::reloc_t*<span class="keyword">></span>(</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> m_scn->ptr_relocs + <span class="keyword">reinterpret_cast<</span>std::uint8_t*<span class="keyword">></span>(m_img));</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> idx = 0u; idx < m_scn->num_relocs; ++idx) {</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">auto</span> scn_reloc = &scn_relocs[idx];</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="comment">// if the reloc is in the current function...</span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">if</span> (scn_reloc->virtual_address >= m_sym->value &&</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> scn_reloc->virtual_address < m_sym->value + m_data.size()) {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">auto</span> sym_reloc = m_img->get_symbol(scn_relocs[idx].symbol_index);</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">auto</span> sym_name = <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a7c6dee036291ded334aa10d89293fc2a" title="gets the name of the symbol.">symbol_t::name</a>(m_img, sym_reloc);</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">auto</span> sym_hash = <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06" title="gets the hash of the symbol name.">decomp::symbol_t::hash</a>(sym_name.data());</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> relocs.push_back(</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <a class="code hl_class" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html" title="meta data about a relocation for a symbol">recomp::reloc_t</a>(scn_reloc->virtual_address - m_sym->value,</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> sym_hash, sym_name.data()));</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> }</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> result.push_back(<a class="code hl_class" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html" title="symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....">decomp::symbol_t</a>(</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> m_img, <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a7c6dee036291ded334aa10d89293fc2a" title="gets the name of the symbol.">symbol_t::name</a>(m_img, m_sym).<a class="code hl_function" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#a605a2be669a10a5a45325a5dca04401a" title="gets the function bytes.">data</a>(), m_sym->value, m_data,</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> m_scn, m_sym, relocs, <a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a">sym_type_t::function</a>));</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> }</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9a4842f4c175b1ec87fc82ef3757d3a0e9">instruction</a>: {</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> std::uint32_t offset = {};</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> xed_error_enum_t err;</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> xed_decoded_inst_t instr;</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> xed_state_t istate{XED_MACHINE_MODE_LONG_64, XED_ADDRESS_WIDTH_64b};</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> xed_decoded_inst_zero_set_mode(&instr, &istate);</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="comment">// keep looping over the section, lower the number of bytes each time...</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">while</span> ((err = xed_decode(&instr, m_data.data() + offset,</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> m_data.size() - offset)) == XED_ERROR_NONE) {</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// symbol name is of the format: symbol@instroffset, I.E: main@11...</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keyword">auto</span> new_sym_name = <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a7c6dee036291ded334aa10d89293fc2a" title="gets the name of the symbol.">symbol_t::name</a>(m_img, m_sym);</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="comment">// first instruction doesnt need the @offset...</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> (offset)</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> new_sym_name.append(<span class="stringliteral">"@"</span>).append(std::to_string(offset));</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> std::vector<recomp::reloc_t> relocs;</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keyword">auto</span> scn_relocs = <span class="keyword">reinterpret_cast<</span>coff::reloc_t*<span class="keyword">></span>(</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> m_scn->ptr_relocs + <span class="keyword">reinterpret_cast<</span>std::uint8_t*<span class="keyword">></span>(m_img));</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// find if this instruction has a relocation or not...</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="comment">// if so, return the reloc_t...</span></div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keyword">auto</span> reloc = std::find_if(</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> scn_relocs, scn_relocs + m_scn->num_relocs,</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> [&](coff::reloc_t reloc) {</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> return reloc.virtual_address >= m_sym->value + offset &&</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> reloc.virtual_address <</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> m_sym->value + offset +</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> xed_decoded_inst_get_length(&instr);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> });</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// if there is indeed a reloc for this instruction...</span></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">if</span> (reloc != scn_relocs + m_scn->num_relocs) {</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keyword">auto</span> sym_reloc = m_img->get_symbol(reloc->symbol_index);</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keyword">auto</span> sym_name = <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a7c6dee036291ded334aa10d89293fc2a" title="gets the name of the symbol.">symbol_t::name</a>(m_img, sym_reloc);</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keyword">auto</span> sym_hash = <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06" title="gets the hash of the symbol name.">decomp::symbol_t::hash</a>(sym_name.data());</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keyword">auto</span> reloc_offset = reloc->virtual_address - m_sym->value - offset;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> relocs.push_back(</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <a class="code hl_class" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html" title="meta data about a relocation for a symbol">recomp::reloc_t</a>(reloc_offset, sym_hash, sym_name.data()));</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> }</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="comment">// add a reloc to the next instruction...</span></div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// note that the offset is ZERO... comp_t will understand that</span></div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="comment">// relocs with offset ZERO means the next instructions...</span></div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keyword">auto</span> next_inst_sym =</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a7c6dee036291ded334aa10d89293fc2a" title="gets the name of the symbol.">symbol_t::name</a>(m_img, m_sym)</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> .append(<span class="stringliteral">"@"</span>)</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> .append(std::to_string(offset +</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> xed_decoded_inst_get_length(&instr)));</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> relocs.push_back(<a class="code hl_class" href="../../dd/d37/classtheo_1_1recomp_1_1reloc__t.html" title="meta data about a relocation for a symbol">recomp::reloc_t</a>(</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> 0, <a class="code hl_function" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06" title="gets the hash of the symbol name.">decomp::symbol_t::hash</a>(next_inst_sym), next_inst_sym.data()));</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="comment">// get the instructions bytes</span></div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> std::vector<std::uint8_t> inst_bytes(</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> m_data.data() + offset,</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> m_data.data() + offset + xed_decoded_inst_get_length(&instr));</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> </div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> result.push_back(<a class="code hl_class" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html" title="symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....">decomp::symbol_t</a>(m_img, new_sym_name, offset,</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> inst_bytes, m_scn, m_sym, relocs,</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9a4842f4c175b1ec87fc82ef3757d3a0e9">sym_type_t::instruction</a>));</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="comment">// after creating the symbol and dealing with relocs then print the</span></div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="comment">// information we have concluded...</span></div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordtype">char</span> buff[255];</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> offset += xed_decoded_inst_get_length(&instr);</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> xed_format_context(XED_SYNTAX_INTEL, &instr, buff, <span class="keyword">sizeof</span> buff, NULL,</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> NULL, NULL);</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> spdlog::info(<span class="stringliteral">"{}: {}"</span>, new_sym_name, buff);</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="comment">// need to set this so that instr can be used to decode again...</span></div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> xed_decoded_inst_zero_set_mode(&instr, &istate);</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> }</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="comment">// remove the relocation to the next symbol from the last instruction</span></div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keyword">auto</span>& last_inst = result.back();</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keyword">auto</span>& last_inst_relocs = last_inst.relocs();</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> last_inst_relocs.erase(last_inst_relocs.end() - 1);</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">default</span>:</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> }</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span>}</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#ad3a75cb97abbcd9b282772401b256f36"> 168</a></span>coff::section_header_t* <a class="code hl_function" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#ad3a75cb97abbcd9b282772401b256f36" title="gets the section header of the section in which the symbol is located in.">routine_t::scn</a>() {</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keywordflow">return</span> m_scn;</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span>}</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"><a class="line" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#a605a2be669a10a5a45325a5dca04401a"> 172</a></span>std::vector<std::uint8_t> <a class="code hl_function" href="../../df/db4/classtheo_1_1decomp_1_1routine__t.html#a605a2be669a10a5a45325a5dca04401a" title="gets the function bytes.">routine_t::data</a>() {</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keywordflow">return</span> m_data;</div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span>}</div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span>} <span class="comment">// namespace theo::decomp</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,148 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/obf/passes/jcc_rewrite_pass.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_ef99456410776b930b88f5850437ce61.html">obf</a></li><li class="navelem"><a class="el" href="../../dir_13fb3109ea9f625158dab961edf6214d.html">passes</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">jcc_rewrite_pass.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d2/df9/jcc__rewrite__pass_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <<a class="code" href="../../d8/d5a/pass_8hpp.html">obf/pass.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/da8/namespacetheo_1_1obf.html" title="this is the main namespace for obfuscation related things.">theo::obf</a> {<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">/// jcc rewrite pass which rewrites rip relative jcc's so that they are position</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">/// independent.</span></div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">///</span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment">/// given the following code:</span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment">///</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="comment">/// jnz label1</span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment">/// ; other code goes here</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment">/// label1:</span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment">/// ; more code here</span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment">///</span></div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment">/// the jnz instruction will be rewritten so that the following code is</span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment">/// generated:</span></div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment">///</span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment">/// jnz br2</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment">/// br1:</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">/// jmp [rip] ; address after this instruction contains the address</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">/// ; of the instruction after the jcc.</span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment">/// br2:</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment">/// jmp [rip] ; address after this instruction contains the address of where</span></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment">/// ; branch 2 is located.</span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment">///</span></div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="comment">/// its important to note that other passes will encrypt (transform) the address</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="comment">/// of the next instruction. There is actually no jmp [rip] either, push/ret is</span></div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="comment">/// used.</span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../d6/dc1/classtheo_1_1obf_1_1jcc__rewrite__pass__t.html"> 61</a></span><span class="comment"></span><span class="keyword">class </span><a class="code hl_class" href="../../d6/dc1/classtheo_1_1obf_1_1jcc__rewrite__pass__t.html" title="jcc rewrite pass which rewrites rip relative jcc's so that they are position independent.">jcc_rewrite_pass_t</a> : <span class="keyword">public</span> <a class="code hl_class" href="../../d4/dad/classtheo_1_1obf_1_1pass__t.html" title="the pass_t class is a base clase for all passes made. you must override the pass_t::run virtual funct...">pass_t</a> {</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">explicit</span> <a class="code hl_class" href="../../d6/dc1/classtheo_1_1obf_1_1jcc__rewrite__pass__t.html" title="jcc rewrite pass which rewrites rip relative jcc's so that they are position independent.">jcc_rewrite_pass_t</a>() : <a class="code hl_function" href="../../d4/dad/classtheo_1_1obf_1_1pass__t.html#abd4ab22cc2822b968267be7f8397d611" title="the explicit constructor of the pass_t base class.">pass_t</a>(<a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9a4842f4c175b1ec87fc82ef3757d3a0e9">decomp::sym_type_t::instruction</a>) {}</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">static</span> <a class="code hl_class" href="../../d6/dc1/classtheo_1_1obf_1_1jcc__rewrite__pass__t.html" title="jcc rewrite pass which rewrites rip relative jcc's so that they are position independent.">jcc_rewrite_pass_t</a>* <a class="code hl_function" href="../../d6/dc1/classtheo_1_1obf_1_1jcc__rewrite__pass__t.html#afc17278f751fe3f5868c988faffb3c92">get</a>();</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/dc1/classtheo_1_1obf_1_1jcc__rewrite__pass__t.html#a5a93eb0945025ef3caefed8c63b65b23" title="virtual method which must be implimented by the pass that inherits this class.">run</a>(<a class="code hl_class" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html" title="symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....">decomp::symbol_t</a>* sym);</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>};</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>} <span class="comment">// namespace theo::obf</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,207 @@
|
||||
<!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=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Theodosius: include/recomp/recomp.hpp Source File</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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../icon.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Theodosius<span id="projectnumber"> v3.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Jit linker, symbol mapper, and obfuscator</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(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="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_d92462d752f7a277bbc0245a347b2579.html">recomp</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">recomp.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d4/d4a/recomp_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright (c) 2022, _xeroxz</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// All rights reserved.</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Redistribution and use in source and binary forms, with or without</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// modification, are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// 1. Redistributions of source code must retain the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// 3. Neither the name of the copyright holder nor the names of its</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// contributors may be used to endorse or promote products derived from</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// this software without specific prior written permission.</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">//</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#pragma once</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <<a class="code" href="../../d2/d96/decomp_8hpp.html">decomp/decomp.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include <<a class="code" href="../../de/d46/engine_8hpp.html">obf/engine.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#include <<a class="code" href="../../d0/d5e/symbol__table_8hpp.html">recomp/symbol_table.hpp</a>></span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">/// this namespace encompasses all recomposition related code.</span></div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../da/dbd/namespacetheo_1_1recomp.html"> 39</a></span><span class="comment"></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/dbd/namespacetheo_1_1recomp.html" title="this namespace encompasses all recomposition related code.">theo::recomp</a> {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment">/// a function which is called by recomp_t to resolve external symbols</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../da/dbd/namespacetheo_1_1recomp.html#a7364f8c94855a2a871a9d6e1057989f3"> 44</a></span><span class="comment"></span><span class="keyword">using</span> <a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a7364f8c94855a2a871a9d6e1057989f3" title="a function which is called by recomp_t to resolve external symbols">resolver_t</a> = <a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a">std::function</a><std::uintptr_t(std::string)>;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment">/// a function which is called by recomp_t to copy symbols into memory.</span></div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../da/dbd/namespacetheo_1_1recomp.html#a604e81450773453df676c3b573651adc"> 49</a></span><span class="comment"></span><span class="keyword">using</span> <a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a604e81450773453df676c3b573651adc" title="a function which is called by recomp_t to copy symbols into memory.">copier_t</a> = <a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a">std::function</a><void(std::uintptr_t, <span class="keywordtype">void</span>*, std::uint32_t)>;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">/// a function which is called to allocate space for a symbol.</span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment">///</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment">/// the first param is the size of the symbol, the second param is the</span></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment">/// characteristics of the section which the symbol is allocated in.</span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../da/dbd/namespacetheo_1_1recomp.html#a96995cb0c5291dce945760c3d8f55241"> 57</a></span><span class="comment"></span><span class="keyword">using</span> <a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a96995cb0c5291dce945760c3d8f55241" title="a function which is called to allocate space for a symbol.">allocator_t</a> =</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <a class="code hl_enumvalue" href="../../d9/dbd/namespacetheo_1_1decomp.html#af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a">std::function</a><std::uintptr_t(std::uint32_t,</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> coff::section_characteristics_t)>;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="comment">/// <summary></span></div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment">/// the main class responsible for recomposition</span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="comment">/// </summary></span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html"> 64</a></span><span class="comment"></span><span class="keyword">class </span><a class="code hl_class" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html" title="the main class responsible for recomposition">recomp_t</a> {</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">public</span>:<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment"> /// the explicit constructor for the recomp_t class.</span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="comment"> /// <param name="dcmp">pointer to a decomp_t class.</param></span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="comment"> /// <param name="alloc">lambda function which is used to allocate memory for</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="comment"> /// symbols.</param> <param name="copy">lambda function used to copy bytes</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment"> /// into allocations.</param> <param name="resolve">lambda function used to</span></div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment"> /// resolve external symbols.</param></span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#ac5f04297153c2e445330e5cc103e8589" title="the explicit constructor for the recomp_t class.">recomp_t</a>(<a class="code hl_class" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html" title="the main decomposition class which is responsible for breaking down lib file into coff files,...">decomp::decomp_t</a>* dcmp,</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a96995cb0c5291dce945760c3d8f55241" title="a function which is called to allocate space for a symbol.">allocator_t</a> alloc,</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a604e81450773453df676c3b573651adc" title="a function which is called by recomp_t to copy symbols into memory.">copier_t</a> copy,</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a7364f8c94855a2a871a9d6e1057989f3" title="a function which is called by recomp_t to resolve external symbols">resolver_t</a> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a299fbede378f04991df2e39293307094" title="when called, this function resolves all relocations in every symbol.">resolve</a>);</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment"> /// when called, this function allocates space for every symbol.</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a78502665e218d3addca9b1e5e3875f39" title="when called, this function allocates space for every symbol.">allocate</a>();</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// when called, this function resolves all relocations in every symbol.</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a299fbede378f04991df2e39293307094" title="when called, this function resolves all relocations in every symbol.">resolve</a>();</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"> /// when called, this function copies symbols into allocations.</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a080d88f122d12faf2e328c9bdd10be6e" title="when called, this function copies symbols into allocations.">copy_syms</a>();</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment"> /// setter for the allocater lambda function.</span></div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"> /// <param name="alloc">lambda function which allocates memory for</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// symbols.</param></span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a0da9a904b0057c14190218592aff0f07" title="setter for the allocater lambda function.">allocator</a>(<a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a96995cb0c5291dce945760c3d8f55241" title="a function which is called to allocate space for a symbol.">allocator_t</a> alloc);</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment"> /// setter for the copier lambda function.</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment"> /// <param name="copy">copier lambda function used to copy bytes into</span></div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment"> /// allocations made by the allocator.</param></span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#aa6fecf752d4c5bc211e164d8496724b1" title="setter for the copier lambda function.">copier</a>(<a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a604e81450773453df676c3b573651adc" title="a function which is called by recomp_t to copy symbols into memory.">copier_t</a> copy);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="comment"> /// setter for the resolve lambda function.</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="comment"> /// <param name="resolve">lambda function to resolve external symbols.</param></span></div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="comment"></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a1be6d0cdb57565c31b138248c8b2d470" title="setter for the resolve lambda function.">resolver</a>(<a class="code hl_typedef" href="../../da/dbd/namespacetheo_1_1recomp.html#a7364f8c94855a2a871a9d6e1057989f3" title="a function which is called by recomp_t to resolve external symbols">resolver_t</a> <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a299fbede378f04991df2e39293307094" title="when called, this function resolves all relocations in every symbol.">resolve</a>);</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="comment"> /// <summary></span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="comment"> /// resolves the address of a function given its name.</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="comment"> /// </summary></span></div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="comment"> /// <param name="sym">the name of the symbol to resolve the location</span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="comment"> /// of.</param> <returns>the address of the symbol.</returns></span></div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span><span class="comment"></span> std::uintptr_t <a class="code hl_function" href="../../d5/d05/classtheo_1_1recomp_1_1recomp__t.html#a299fbede378f04991df2e39293307094" title="when called, this function resolves all relocations in every symbol.">resolve</a>(<span class="keyword">const</span> std::string&& sym);</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_class" href="../../d6/d0e/classtheo_1_1decomp_1_1decomp__t.html" title="the main decomposition class which is responsible for breaking down lib file into coff files,...">decomp::decomp_t</a>* m_dcmp;</div>
|
||||
<div class="line"><a id="l00123" name="l00123" |