<p><aclass="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....">symbol_t</a> is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol. symbols can be different things, sections, functions, and even instructions (when functions are broken down).
<trclass="memdesc:aa7247dcb735176b6ed9246d035e7a215"><tdclass="mdescLeft"> </td><tdclass="mdescRight">the explicit constructor of this symbol. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#aa7247dcb735176b6ed9246d035e7a215">More...</a><br/></td></tr>
<trclass="memdesc:a7c6dee036291ded334aa10d89293fc2a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">gets the name of the symbol. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a7c6dee036291ded334aa10d89293fc2a">More...</a><br/></td></tr>
<trclass="memdesc:a79759d343ddb6a62e4149aef92e2d70b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">gets the offset into the section where the symbol is located. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a79759d343ddb6a62e4149aef92e2d70b">More...</a><br/></td></tr>
<trclass="memdesc:ae92f3e35fba82a1d16a58ad09b39fb47"><tdclass="mdescLeft"> </td><tdclass="mdescRight">returns the address where the symbol is allocated. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ae92f3e35fba82a1d16a58ad09b39fb47">More...</a><br/></td></tr>
<trclass="memdesc:ae33f1452b01fe80f9c384241b9fe6286"><tdclass="mdescLeft"> </td><tdclass="mdescRight">returns the size of the symbol. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ae33f1452b01fe80f9c384241b9fe6286">More...</a><br/></td></tr>
<trclass="memdesc:a64d51dabe91687ed40c3942d106fd7dd"><tdclass="mdescLeft"> </td><tdclass="mdescRight">gets the section header of the section in which the symbol is contained. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a64d51dabe91687ed40c3942d106fd7dd">More...</a><br/></td></tr>
<trclass="memdesc:ad97ad0395e18dcfb42017fb7753e0665"><tdclass="mdescLeft"> </td><tdclass="mdescRight">gets the imagine in which the symbol is located inside of. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ad97ad0395e18dcfb42017fb7753e0665">More...</a><br/></td></tr>
<trclass="memdesc:aa3ecf0b480d10bffe68812409c06d61b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">returns a vector by reference of bytes containing the data of the symbol. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#aa3ecf0b480d10bffe68812409c06d61b">More...</a><br/></td></tr>
<trclass="memdesc:a0e6f850f25a51609fbe5dc0a61b27bc9"><tdclass="mdescLeft"> </td><tdclass="mdescRight">returns a pointer to the coff symbol object. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9">More...</a><br/></td></tr>
<trclass="memdesc:a16587cddd37cd45d9ec6cd25c229e8d1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">returns the type of the symbol. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a16587cddd37cd45d9ec6cd25c229e8d1">More...</a><br/></td></tr>
<trclass="memdesc:abc158e1dc1567161f0a57ed15fc718f7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">returns a vector of relocations. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#abc158e1dc1567161f0a57ed15fc718f7">More...</a><br/></td></tr>
<trclass="memdesc:a79bec0c7338f2c08739ea6547745cc3b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">set the address where the symbol is allocated at. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a79bec0c7338f2c08739ea6547745cc3b">More...</a><br/></td></tr>
<trclass="memdesc:a8695d75670cc4d61d275464e9109ff06"><tdclass="mdescLeft"> </td><tdclass="mdescRight">gets the hash of the symbol name. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06">More...</a><br/></td></tr>
<trclass="memdesc:a88481ad95d28f9c54c349f0e43de8970"><tdclass="mdescLeft"> </td><tdclass="mdescRight">generate a hash given the name of the symbol. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a88481ad95d28f9c54c349f0e43de8970">More...</a><br/></td></tr>
<trclass="memdesc:a2bef3a0869fee4979918405c5ed8f692"><tdclass="mdescLeft"> </td><tdclass="mdescRight">get the name of a symbol. this function will create a symbol name if the symbol is opaquely named. <ahref="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a2bef3a0869fee4979918405c5ed8f692">More...</a><br/></td></tr>
<divclass="textblock"><p><aclass="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....">symbol_t</a> is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol. symbols can be different things, sections, functions, and even instructions (when functions are broken down). </p>
<p>this class is used throughout theodosius and is a keystone of the project. ensure you understand how this class works and what it contains. </p>
<pclass="definition">Definition at line <aclass="el"href="../../d6/d62/symbol_8hpp_source.html#l00059">59</a> of file <aclass="el"href="../../d6/d62/symbol_8hpp_source.html">symbol.hpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00034">34</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<divclass="fragment"><divclass="line"><spanclass="lineno"> 42</span> : m_name(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a7c6dee036291ded334aa10d89293fc2a"title="gets the name of the symbol.">name</a>),</div>
<divclass="line"><spanclass="lineno"> 43</span> m_offset(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a79759d343ddb6a62e4149aef92e2d70b"title="gets the offset into the section where the symbol is located.">offset</a>),</div>
<divclass="line"><spanclass="lineno"> 44</span> m_data(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#aa3ecf0b480d10bffe68812409c06d61b"title="returns a vector by reference of bytes containing the data of the symbol.">data</a>),</div>
<divclass="line"><spanclass="lineno"> 45</span> m_scn(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a64d51dabe91687ed40c3942d106fd7dd"title="gets the section header of the section in which the symbol is contained.">scn</a>),</div>
<divclass="line"><spanclass="lineno"> 46</span> m_relocs(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#abc158e1dc1567161f0a57ed15fc718f7"title="returns a vector of relocations.">relocs</a>),</div>
<divclass="line"><spanclass="lineno"> 48</span> m_sym(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>),</div>
<divclass="line"><spanclass="lineno"> 49</span> m_img(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ad97ad0395e18dcfb42017fb7753e0665"title="gets the imagine in which the symbol is located inside of.">img</a>),</div>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00060">60</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00084">allocated_at()</a>, and <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00155">theo::recomp::recomp_t::copy_syms()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00084">84</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<divclass="line"><spanclass="lineno"> 85</span> m_allocated_at = <aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ae92f3e35fba82a1d16a58ad09b39fb47"title="returns the address where the symbol is allocated.">allocated_at</a>;</div>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00076">76</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00155">theo::recomp::recomp_t::copy_syms()</a>, <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00092">theo::recomp::recomp_t::resolve()</a>, <aclass="el"href="../../d9/db4/jcc__rewrite__pass_8cpp_source.html#l00040">theo::obf::jcc_rewrite_pass_t::run()</a>, <aclass="el"href="../../df/d7d/next__inst__pass_8cpp_source.html#l00038">theo::obf::next_inst_pass_t::run()</a>, and <aclass="el"href="../../d6/da4/reloc__transform__pass_8cpp_source.html#l00039">theo::obf::reloc_transform_pass_t::run()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00088">88</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<divclass="line"><spanclass="lineno"> 89</span><spanclass="keywordflow">return</span><aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a8695d75670cc4d61d275464e9109ff06"title="gets the hash of the symbol name.">hash</a>(m_name);</div>
<pclass="reference">Referenced by <aclass="el"href="../../d2/dbb/routine_8cpp_source.html#l00041">theo::decomp::routine_t::decompose()</a>, <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00088">hash()</a>, <aclass="el"href="../../da/d0c/symbol__table_8cpp_source.html#l00040">theo::recomp::symbol_table_t::put_symbol()</a>, <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00175">theo::recomp::recomp_t::resolve()</a>, <aclass="el"href="../../d2/d26/theo_8cpp_source.html#l00068">theo::theo_t::resolve()</a>, <aclass="el"href="../../db/dae/hello__world__pass_8hpp_source.html#l00050">theo::obf::hello_world_pass_t::run()</a>, and <aclass="el"href="../../d9/db4/jcc__rewrite__pass_8cpp_source.html#l00040">theo::obf::jcc_rewrite_pass_t::run()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00100">100</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<divclass="line"><spanclass="lineno"> 101</span><spanclass="keywordflow">return</span> std::hash<std::string>{}(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>);</div>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00068">68</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00104">name()</a>, and <aclass="el"href="../../d9/db4/jcc__rewrite__pass_8cpp_source.html#l00040">theo::obf::jcc_rewrite_pass_t::run()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00052">52</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../d2/dbb/routine_8cpp_source.html#l00041">theo::decomp::routine_t::decompose()</a>, <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00092">theo::recomp::recomp_t::resolve()</a>, <aclass="el"href="../../db/dae/hello__world__pass_8hpp_source.html#l00050">theo::obf::hello_world_pass_t::run()</a>, and <aclass="el"href="../../d6/da4/reloc__transform__pass_8cpp_source.html#l00039">theo::obf::reloc_transform_pass_t::run()</a>.</p>
<p>for example in c++ if you define something like this:</p>
<p>some_struct_t val = { value_one, value_two };</p>
<p>"val" will be stored in the .data section of the coff file. however the symbol name will be opaque (the name of the symbol will be ".data"). this causes issues with theo since each symbol needs its own unqiue name to generate a unique symbol name hash. for symbols like this, theo will create a name for it with the following format:</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00104">104</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<divclass="line"><spanclass="lineno"> 105</span><spanclass="keywordflow">if</span> (<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>->has_section() &&</div>
<divclass="line"><spanclass="lineno"> 106</span><aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>->storage_class == coff::storage_class_id::private_symbol &&</div>
<divclass="line"><spanclass="lineno"> 107</span><aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>->derived_type == coff::derived_type_id::none) {</div>
<divclass="line"><spanclass="lineno"> 108</span><spanclass="keyword">auto</span><aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a64d51dabe91687ed40c3942d106fd7dd"title="gets the section header of the section in which the symbol is contained.">scn</a> = <aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ad97ad0395e18dcfb42017fb7753e0665"title="gets the imagine in which the symbol is located inside of.">img</a>->get_section(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>->section_index - 1);</div>
<divclass="line"><spanclass="lineno"> 109</span><spanclass="keyword">auto</span> res = std::string(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a64d51dabe91687ed40c3942d106fd7dd"title="gets the section header of the section in which the symbol is contained.">scn</a>->name.to_string(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ad97ad0395e18dcfb42017fb7753e0665"title="gets the imagine in which the symbol is located inside of.">img</a>->get_strings()).data())</div>
<divclass="line"><spanclass="lineno"> 111</span> .append(std::to_string(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>->section_index))</div>
<divclass="line"><spanclass="lineno"> 113</span> .append(std::to_string(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ad97ad0395e18dcfb42017fb7753e0665"title="gets the imagine in which the symbol is located inside of.">img</a>->file_header.timedate_stamp))</div>
<divclass="line"><spanclass="lineno"> 115</span> .append(std::to_string(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>->value));</div>
<divclass="line"><spanclass="lineno"> 119</span><spanclass="keywordflow">return</span> std::string(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#a0e6f850f25a51609fbe5dc0a61b27bc9"title="returns a pointer to the coff symbol object.">sym</a>->name.to_string(<aclass="code hl_function"href="../../d9/dd5/classtheo_1_1decomp_1_1symbol__t.html#ad97ad0395e18dcfb42017fb7753e0665"title="gets the imagine in which the symbol is located inside of.">img</a>->get_strings()));</div>
<pclass="reference">References <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00068">img()</a>, <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00064">scn()</a>, and <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00092">sym()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00056">56</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../d9/db4/jcc__rewrite__pass_8cpp_source.html#l00040">theo::obf::jcc_rewrite_pass_t::run()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00096">96</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00092">theo::recomp::recomp_t::resolve()</a>, and <aclass="el"href="../../d9/db4/jcc__rewrite__pass_8cpp_source.html#l00040">theo::obf::jcc_rewrite_pass_t::run()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00064">64</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00104">name()</a>, and <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00092">theo::recomp::recomp_t::resolve()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00072">72</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00092">92</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00100">hash()</a>, <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00104">name()</a>, and <aclass="el"href="../../d9/db4/jcc__rewrite__pass_8cpp_source.html#l00040">theo::obf::jcc_rewrite_pass_t::run()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="../../d8/d67/symbol_8cpp_source.html#l00080">80</a> of file <aclass="el"href="../../d8/d67/symbol_8cpp_source.html">symbol.cpp</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00040">theo::recomp::recomp_t::allocate()</a>, and <aclass="el"href="../../db/d55/recomp_8cpp_source.html#l00092">theo::recomp::recomp_t::resolve()</a>.</p>