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

364 lines
24 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Theodosius: theo::recomp::symbol_table_t Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Theodosius
&#160;<span id="projectnumber">v3.0</span>
</div>
<div id="projectbrief">Jit linker, mapper, obfuscator, and mutator</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="../../da/de6/namespacetheo.html">theo</a></li><li class="navelem"><a class="el" href="../../da/dbd/namespacetheo_1_1recomp.html">recomp</a></li><li class="navelem"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html">symbol_table_t</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d2/de4/classtheo_1_1recomp_1_1symbol__table__t-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">theo::recomp::symbol_table_t Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>this class is a high level wrapper for a hashmap that contains <a class="el" 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> values. the symbol values are references by a hashcode.
<a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="../../">symbol_table.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad06d4004c0cb454b1ffe7e2ae2ccedf5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ad06d4004c0cb454b1ffe7e2ae2ccedf5">symbol_table_t</a> ()</td></tr>
<tr class="memdesc:ad06d4004c0cb454b1ffe7e2ae2ccedf5"><td class="mdescLeft">&#160;</td><td class="mdescRight">default constructor. does nothing. <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ad06d4004c0cb454b1ffe7e2ae2ccedf5">More...</a><br /></td></tr>
<tr class="separator:ad06d4004c0cb454b1ffe7e2ae2ccedf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7dfbb8369463ce3d74ad656115cf4d5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ab7dfbb8369463ce3d74ad656115cf4d5">symbol_table_t</a> (const std::vector&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &gt; &amp;&amp;syms)</td></tr>
<tr class="memdesc:ab7dfbb8369463ce3d74ad656115cf4d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">this constructor will populate the m_table private field with symbols. <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ab7dfbb8369463ce3d74ad656115cf4d5">More...</a><br /></td></tr>
<tr class="separator:ab7dfbb8369463ce3d74ad656115cf4d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9caf2d4d97b2498aa624c3750a7a601"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#af9caf2d4d97b2498aa624c3750a7a601">put_symbol</a> (<a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &amp;sym)</td></tr>
<tr class="memdesc:af9caf2d4d97b2498aa624c3750a7a601"><td class="mdescLeft">&#160;</td><td class="mdescRight">add symbol to m_table <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#af9caf2d4d97b2498aa624c3750a7a601">More...</a><br /></td></tr>
<tr class="separator:af9caf2d4d97b2498aa624c3750a7a601"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7c35d9336f67d3175910c028e0b9b3e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ae7c35d9336f67d3175910c028e0b9b3e">put_symbols</a> (std::vector&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &gt; &amp;syms)</td></tr>
<tr class="memdesc:ae7c35d9336f67d3175910c028e0b9b3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">add a vector of symbol to m_table <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#ae7c35d9336f67d3175910c028e0b9b3e">More...</a><br /></td></tr>
<tr class="separator:ae7c35d9336f67d3175910c028e0b9b3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a308c0dbcc4d569467e0986b32ef30db5"><td class="memItemLeft" align="right" valign="top">std::optional&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a308c0dbcc4d569467e0986b32ef30db5">sym_from_hash</a> (std::size_t hash)</td></tr>
<tr class="memdesc:a308c0dbcc4d569467e0986b32ef30db5"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns an optional pointer to a symbol from the symbol table given the symbols hash (hash of its name) the hash is produced by <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06" title="gets the hash of the symbol name.">theo::decomp::symbol_t::hash</a> <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a308c0dbcc4d569467e0986b32ef30db5">More...</a><br /></td></tr>
<tr class="separator:a308c0dbcc4d569467e0986b32ef30db5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abaea9fd899d87b09d60c2b815624e2d2"><td class="memItemLeft" align="right" valign="top">std::optional&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#abaea9fd899d87b09d60c2b815624e2d2">sym_from_alloc</a> (std::uintptr_t allocated_at)</td></tr>
<tr class="memdesc:abaea9fd899d87b09d60c2b815624e2d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns an optional pointer to a symbol given its allocation location. <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#abaea9fd899d87b09d60c2b815624e2d2">More...</a><br /></td></tr>
<tr class="separator:abaea9fd899d87b09d60c2b815624e2d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35008ba37814a94209cf979302e13e6d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a35008ba37814a94209cf979302e13e6d">for_each</a> (std::function&lt; void(<a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &amp;sym)&gt; fn)</td></tr>
<tr class="memdesc:a35008ba37814a94209cf979302e13e6d"><td class="mdescLeft">&#160;</td><td class="mdescRight">this function is a wrapper function that allows you to get at each entry in the symbol table by reference. <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#a35008ba37814a94209cf979302e13e6d">More...</a><br /></td></tr>
<tr class="separator:a35008ba37814a94209cf979302e13e6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af57c0495a442ea86af0f9cca4521631e"><td class="memItemLeft" align="right" valign="top">std::uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#af57c0495a442ea86af0f9cca4521631e">size</a> ()</td></tr>
<tr class="memdesc:af57c0495a442ea86af0f9cca4521631e"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the size of the symbol table. <a href="../../db/d77/classtheo_1_1recomp_1_1symbol__table__t.html#af57c0495a442ea86af0f9cca4521631e">More...</a><br /></td></tr>
<tr class="separator:af57c0495a442ea86af0f9cca4521631e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>this class is a high level wrapper for a hashmap that contains <a class="el" 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> values. the symbol values are references by a hashcode. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ad06d4004c0cb454b1ffe7e2ae2ccedf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad06d4004c0cb454b1ffe7e2ae2ccedf5">&#9670;&nbsp;</a></span>symbol_table_t() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">theo::recomp::symbol_table_t::symbol_table_t </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>default constructor. does nothing. </p>
<div class="fragment"><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;{}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ab7dfbb8369463ce3d74ad656115cf4d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7dfbb8369463ce3d74ad656115cf4d5">&#9670;&nbsp;</a></span>symbol_table_t() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">theo::recomp::symbol_table_t::symbol_table_t </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &gt; &amp;&amp;&#160;</td>
<td class="paramname"><em>syms</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>this constructor will populate the m_table private field with symbols. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">syms</td><td>vector of <a class="el" 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></td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; {</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; std::for_each(syms.begin(), syms.end(), [&amp;](decomp::symbol_t sym) {</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; m_table.insert({sym.hash(), sym});</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; });</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a35008ba37814a94209cf979302e13e6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35008ba37814a94209cf979302e13e6d">&#9670;&nbsp;</a></span>for_each()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void theo::recomp::symbol_table_t::for_each </td>
<td>(</td>
<td class="paramtype">std::function&lt; void(<a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &amp;sym)&gt;&#160;</td>
<td class="paramname"><em>fn</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>this function is a wrapper function that allows you to get at each entry in the symbol table by reference. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">fn</td><td>a callback function that will be called for each symbol</td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; {</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> itr = m_table.begin(); itr != m_table.end(); ++itr)</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; fn(itr-&gt;second);</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="af9caf2d4d97b2498aa624c3750a7a601"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af9caf2d4d97b2498aa624c3750a7a601">&#9670;&nbsp;</a></span>put_symbol()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void theo::recomp::symbol_table_t::put_symbol </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &amp;&#160;</td>
<td class="paramname"><em>sym</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>add symbol to m_table </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sym</td><td>symbol to be added.</td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; m_table.insert({sym.hash(), sym});</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae7c35d9336f67d3175910c028e0b9b3e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7c35d9336f67d3175910c028e0b9b3e">&#9670;&nbsp;</a></span>put_symbols()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void theo::recomp::symbol_table_t::put_symbols </td>
<td>(</td>
<td class="paramtype">std::vector&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>syms</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>add a vector of symbol to m_table </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">syms</td><td></td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; {</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; std::for_each(syms.begin(), syms.end(),</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; [&amp;](decomp::symbol_t sym) { put_symbol(sym); });</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="af57c0495a442ea86af0f9cca4521631e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af57c0495a442ea86af0f9cca4521631e">&#9670;&nbsp;</a></span>size()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::uint32_t theo::recomp::symbol_table_t::size </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>returns the size of the symbol table. </p>
<dl class="section return"><dt>Returns</dt><dd>returns the size of the symbol table.</dd></dl>
<div class="fragment"><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; {</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">return</span> m_table.size();</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="abaea9fd899d87b09d60c2b815624e2d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abaea9fd899d87b09d60c2b815624e2d2">&#9670;&nbsp;</a></span>sym_from_alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::optional&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> * &gt; theo::recomp::symbol_table_t::sym_from_alloc </td>
<td>(</td>
<td class="paramtype">std::uintptr_t&#160;</td>
<td class="paramname"><em>allocated_at</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>returns an optional pointer to a symbol given its allocation location. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">allocated_at</td><td>the address where the symbol is allocated at.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>returns an optional pointer to a <a class="el" 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....">theo::decomp::symbol_t</a></dd></dl>
<div class="fragment"><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; {</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">auto</span> res =</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; std::find_if(m_table.begin(), m_table.end(),</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; [&amp;](std::pair&lt;const std::size_t, decomp::symbol_t&gt; itr) {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; return itr.second.allocated_at() == allocated_at;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; });</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordflow">return</span> res != m_table.end() ? &amp;res-&gt;second</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; : std::optional&lt;decomp::symbol_t*&gt;{};</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a308c0dbcc4d569467e0986b32ef30db5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a308c0dbcc4d569467e0986b32ef30db5">&#9670;&nbsp;</a></span>sym_from_hash()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::optional&lt; <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html">decomp::symbol_t</a> * &gt; theo::recomp::symbol_table_t::sym_from_hash </td>
<td>(</td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>hash</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>returns an optional pointer to a symbol from the symbol table given the symbols hash (hash of its name) the hash is produced by <a class="el" href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06" title="gets the hash of the symbol name.">theo::decomp::symbol_t::hash</a> </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">hash</td><td>hashcode of the symbol to get from the symbol table...</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>returns an optional pointer to a <a class="el" 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....">theo::decomp::symbol_t</a></dd></dl>
<div class="fragment"><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; {</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordflow">return</span> m_table.count(hash) ? &amp;m_table.at(hash)</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; : std::optional&lt;decomp::symbol_t*&gt;{};</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/recomp/<a class="el" href="../../">symbol_table.hpp</a></li>
<li>src/recomp/<a class="el" href="../../">symbol_table.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>