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/latex/d5/d05/classtheo_1_1recomp_1_1reco...

328 lines
22 KiB

\hypertarget{classtheo_1_1recomp_1_1recomp__t}{}\doxysection{theo\+::recomp\+::recomp\+\_\+t Class Reference}
\label{classtheo_1_1recomp_1_1recomp__t}\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
the main class responsible for recomposition
{\ttfamily \#include $<$recomp.\+hpp$>$}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_ac5f04297153c2e445330e5cc103e8589}{recomp\+\_\+t}} (\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t}{decomp\+::decomp\+\_\+t}} $\ast$dcmp, \mbox{\hyperlink{namespacetheo_1_1recomp_a96995cb0c5291dce945760c3d8f55241}{allocator\+\_\+t}} alloc, \mbox{\hyperlink{namespacetheo_1_1recomp_a604e81450773453df676c3b573651adc}{copier\+\_\+t}} copy, \mbox{\hyperlink{namespacetheo_1_1recomp_a7364f8c94855a2a871a9d6e1057989f3}{resolver\+\_\+t}} \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}{resolve}})
\begin{DoxyCompactList}\small\item\em the explicit constructor for the \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t}{recomp\+\_\+t}} class. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a78502665e218d3addca9b1e5e3875f39}{allocate}} ()
\begin{DoxyCompactList}\small\item\em when called, this function allocates space for every symbol. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}{resolve}} ()
\begin{DoxyCompactList}\small\item\em when called, this function resolves all relocations in every symbol. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a080d88f122d12faf2e328c9bdd10be6e}{copy\+\_\+syms}} ()
\begin{DoxyCompactList}\small\item\em when called, this function copies symbols into allocations. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a0da9a904b0057c14190218592aff0f07}{allocator}} (\mbox{\hyperlink{namespacetheo_1_1recomp_a96995cb0c5291dce945760c3d8f55241}{allocator\+\_\+t}} alloc)
\begin{DoxyCompactList}\small\item\em setter for the allocater lambda function. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_aa6fecf752d4c5bc211e164d8496724b1}{copier}} (\mbox{\hyperlink{namespacetheo_1_1recomp_a604e81450773453df676c3b573651adc}{copier\+\_\+t}} copy)
\begin{DoxyCompactList}\small\item\em setter for the copier lambda function. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a1be6d0cdb57565c31b138248c8b2d470}{resolver}} (\mbox{\hyperlink{namespacetheo_1_1recomp_a7364f8c94855a2a871a9d6e1057989f3}{resolver\+\_\+t}} \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}{resolve}})
\begin{DoxyCompactList}\small\item\em setter for the resolve lambda function. \end{DoxyCompactList}\item
std\+::uintptr\+\_\+t \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_ae0c56f0f8af33b390e4123509523602c}{resolve}} (const std\+::string \&\&sym)
\begin{DoxyCompactList}\small\item\em resolves the address of a function given its name. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection{Detailed Description}
the main class responsible for recomposition
\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_ac5f04297153c2e445330e5cc103e8589}\label{classtheo_1_1recomp_1_1recomp__t_ac5f04297153c2e445330e5cc103e8589}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!recomp\_t@{recomp\_t}}
\index{recomp\_t@{recomp\_t}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{recomp\_t()}{recomp\_t()}}
{\footnotesize\ttfamily theo\+::recomp\+::recomp\+\_\+t\+::recomp\+\_\+t (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t}{decomp\+::decomp\+\_\+t}} $\ast$}]{dcmp, }\item[{\mbox{\hyperlink{namespacetheo_1_1recomp_a96995cb0c5291dce945760c3d8f55241}{allocator\+\_\+t}}}]{alloc, }\item[{\mbox{\hyperlink{namespacetheo_1_1recomp_a604e81450773453df676c3b573651adc}{copier\+\_\+t}}}]{copy, }\item[{\mbox{\hyperlink{namespacetheo_1_1recomp_a7364f8c94855a2a871a9d6e1057989f3}{resolver\+\_\+t}}}]{resolve }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}
the explicit constructor for the \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t}{recomp\+\_\+t}} class.
\begin{DoxyParams}{Parameters}
{\em dcmp} & pointer to a decomp\+\_\+t class.\\
\hline
{\em alloc} & lambda function which is used to allocate memory for symbols.\\
\hline
{\em copy} & lambda function used to copy bytes into allocations.\\
\hline
{\em resolve} & lambda function used to resolve external symbols.\\
\hline
\end{DoxyParams}
\begin{DoxyCode}{0}
\DoxyCodeLine{38 : m\_dcmp(dcmp), m\_allocator(alloc), m\_copier(copy), m\_resolver(\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}{resolve}}) \{\}}
\end{DoxyCode}
\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_a78502665e218d3addca9b1e5e3875f39}\label{classtheo_1_1recomp_1_1recomp__t_a78502665e218d3addca9b1e5e3875f39}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!allocate@{allocate}}
\index{allocate@{allocate}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{allocate()}{allocate()}}
{\footnotesize\ttfamily void theo\+::recomp\+::recomp\+\_\+t\+::allocate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
when called, this function allocates space for every symbol.
\begin{DoxyCode}{0}
\DoxyCodeLine{40 \{}
\DoxyCodeLine{41 \textcolor{comment}{// map code \& data/rdata/bss sections first...}}
\DoxyCodeLine{42 \textcolor{comment}{//}}
\DoxyCodeLine{43 m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a8630f2ee0f4fb9516f5b20014e4c6120}{syms}}()-\/>\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a35008ba37814a94209cf979302e13e6d}{for\_each}}([\&](\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t}{theo::decomp::symbol\_t}}\& sym) \{}
\DoxyCodeLine{44 \textcolor{keywordflow}{switch} (sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_a16587cddd37cd45d9ec6cd25c229e8d1}{type}}()) \{}
\DoxyCodeLine{45 case decomp::sym\_type\_t::section:}
\DoxyCodeLine{46 case decomp::sym\_type\_t::function:}
\DoxyCodeLine{47 case decomp::sym\_type\_t::instruction: \{}
\DoxyCodeLine{48 sym.allocated\_at(m\_allocator(sym.size(), sym.scn()-\/>characteristics));}
\DoxyCodeLine{49 break;}
\DoxyCodeLine{50 \}}
\DoxyCodeLine{51 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{52 \textcolor{keywordflow}{break};}
\DoxyCodeLine{53 \}}
\DoxyCodeLine{54 \});}
\DoxyCodeLine{55 }
\DoxyCodeLine{56 \textcolor{comment}{// then map data/rdata/bss symbols to the allocated sections...}}
\DoxyCodeLine{57 \textcolor{comment}{//}}
\DoxyCodeLine{58 m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a8630f2ee0f4fb9516f5b20014e4c6120}{syms}}()-\/>\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a35008ba37814a94209cf979302e13e6d}{for\_each}}([\&](\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t}{theo::decomp::symbol\_t}}\& sym) \{}
\DoxyCodeLine{59 \textcolor{keywordflow}{if} (sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_a16587cddd37cd45d9ec6cd25c229e8d1}{type}}() == \mbox{\hyperlink{namespacetheo_1_1decomp_af96177687d0ad683c5897d8fa01135f9acdb885c0ea7f6b2874224487c69b8112}{decomp::sym\_type\_t::data}}) \{}
\DoxyCodeLine{60 \textcolor{comment}{// if the symbol has a section then we will refer to the allocation made}}
\DoxyCodeLine{61 \textcolor{comment}{// for that section...}}
\DoxyCodeLine{62 \textcolor{comment}{//}}
\DoxyCodeLine{63 if (sym.scn()) \{}
\DoxyCodeLine{64 auto scn\_sym =}
\DoxyCodeLine{65 m\_dcmp-\/>syms()-\/>sym\_from\_hash(m\_dcmp-\/>scn\_hash\_tbl()[sym.scn()]);}
\DoxyCodeLine{66 }
\DoxyCodeLine{67 if (!scn\_sym.has\_value()) \{}
\DoxyCodeLine{68 spdlog::error(\textcolor{stringliteral}{"{}failed to locate section: \{\} for symbol: \{\}"{}},}
\DoxyCodeLine{69 sym.scn()-\/>name.to\_string(), sym.name());}
\DoxyCodeLine{70 }
\DoxyCodeLine{71 assert(scn\_sym.has\_value());}
\DoxyCodeLine{72 \}}
\DoxyCodeLine{73 }
\DoxyCodeLine{74 sym.allocated\_at(scn\_sym.value()-\/>allocated\_at() + sym.offset());}
\DoxyCodeLine{75 \} \textcolor{keywordflow}{else} \{ \textcolor{comment}{// else if there is no section then we allocate based upon the}}
\DoxyCodeLine{76 \textcolor{comment}{// size of the symbol... this is only done for symbols that are}}
\DoxyCodeLine{77 \textcolor{comment}{// bss...}}
\DoxyCodeLine{78 \textcolor{comment}{//}}
\DoxyCodeLine{79 }
\DoxyCodeLine{80 \textcolor{comment}{// bss is read write...}}
\DoxyCodeLine{81 \textcolor{comment}{//}}
\DoxyCodeLine{82 coff::section\_characteristics\_t prot = \{\};}
\DoxyCodeLine{83 prot.mem\_read = \textcolor{keyword}{true};}
\DoxyCodeLine{84 prot.mem\_write = \textcolor{keyword}{true};}
\DoxyCodeLine{85 }
\DoxyCodeLine{86 sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_ae92f3e35fba82a1d16a58ad09b39fb47}{allocated\_at}}(m\_allocator(sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_ae33f1452b01fe80f9c384241b9fe6286}{size}}(), sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_a64d51dabe91687ed40c3942d106fd7dd}{scn}}()-\/>characteristics));}
\DoxyCodeLine{87 \}}
\DoxyCodeLine{88 \}}
\DoxyCodeLine{89 \});}
\DoxyCodeLine{90 \}}
\end{DoxyCode}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_a0da9a904b0057c14190218592aff0f07}\label{classtheo_1_1recomp_1_1recomp__t_a0da9a904b0057c14190218592aff0f07}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!allocator@{allocator}}
\index{allocator@{allocator}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{allocator()}{allocator()}}
{\footnotesize\ttfamily void theo\+::recomp\+::recomp\+\_\+t\+::allocator (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespacetheo_1_1recomp_a96995cb0c5291dce945760c3d8f55241}{allocator\+\_\+t}}}]{alloc }\end{DoxyParamCaption})}
setter for the allocater lambda function.
\begin{DoxyParams}{Parameters}
{\em alloc} & lambda function which allocates memory for symbols.\\
\hline
\end{DoxyParams}
\begin{DoxyCode}{0}
\DoxyCodeLine{163 \{}
\DoxyCodeLine{164 m\_allocator = alloc;}
\DoxyCodeLine{165 \}}
\end{DoxyCode}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_aa6fecf752d4c5bc211e164d8496724b1}\label{classtheo_1_1recomp_1_1recomp__t_aa6fecf752d4c5bc211e164d8496724b1}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!copier@{copier}}
\index{copier@{copier}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{copier()}{copier()}}
{\footnotesize\ttfamily void theo\+::recomp\+::recomp\+\_\+t\+::copier (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespacetheo_1_1recomp_a604e81450773453df676c3b573651adc}{copier\+\_\+t}}}]{copy }\end{DoxyParamCaption})}
setter for the copier lambda function.
\begin{DoxyParams}{Parameters}
{\em copy} & copier lambda function used to copy bytes into allocations made by the allocator.\\
\hline
\end{DoxyParams}
\begin{DoxyCode}{0}
\DoxyCodeLine{167 \{}
\DoxyCodeLine{168 m\_copier = copy;}
\DoxyCodeLine{169 \}}
\end{DoxyCode}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_a080d88f122d12faf2e328c9bdd10be6e}\label{classtheo_1_1recomp_1_1recomp__t_a080d88f122d12faf2e328c9bdd10be6e}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!copy\_syms@{copy\_syms}}
\index{copy\_syms@{copy\_syms}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{copy\_syms()}{copy\_syms()}}
{\footnotesize\ttfamily void theo\+::recomp\+::recomp\+\_\+t\+::copy\+\_\+syms (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
when called, this function copies symbols into allocations.
\begin{DoxyCode}{0}
\DoxyCodeLine{155 \{}
\DoxyCodeLine{156 \textcolor{comment}{// copy symbols into memory using the copier supplied...}}
\DoxyCodeLine{157 \textcolor{comment}{//}}
\DoxyCodeLine{158 m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a8630f2ee0f4fb9516f5b20014e4c6120}{syms}}()-\/>\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a35008ba37814a94209cf979302e13e6d}{for\_each}}([\&](\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t}{theo::decomp::symbol\_t}}\& sym) \{}
\DoxyCodeLine{159 m\_copier(sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_ae92f3e35fba82a1d16a58ad09b39fb47}{allocated\_at}}(), sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_aa3ecf0b480d10bffe68812409c06d61b}{data}}().data(), sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_aa3ecf0b480d10bffe68812409c06d61b}{data}}().size());}
\DoxyCodeLine{160 \});}
\DoxyCodeLine{161 \}}
\end{DoxyCode}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}\label{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!resolve@{resolve}}
\index{resolve@{resolve}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{resolve()}{resolve()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void theo\+::recomp\+::recomp\+\_\+t\+::resolve (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
when called, this function resolves all relocations in every symbol.
\begin{DoxyCode}{0}
\DoxyCodeLine{92 \{}
\DoxyCodeLine{93 \textcolor{comment}{// resolve relocations in all symbols...}}
\DoxyCodeLine{94 \textcolor{comment}{//}}
\DoxyCodeLine{95 m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a8630f2ee0f4fb9516f5b20014e4c6120}{syms}}()-\/>\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a35008ba37814a94209cf979302e13e6d}{for\_each}}([\&](\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t}{theo::decomp::symbol\_t}}\& sym) \{}
\DoxyCodeLine{96 \textcolor{keyword}{auto}\& relocs = sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_abc158e1dc1567161f0a57ed15fc718f7}{relocs}}();}
\DoxyCodeLine{97 std::for\_each(relocs.begin(), relocs.end(), [\&](reloc\_t\& reloc) \{}
\DoxyCodeLine{98 if (reloc.offset() > sym.data().size()) \{}
\DoxyCodeLine{99 spdlog::error(}
\DoxyCodeLine{100 \textcolor{stringliteral}{"{}invalid relocation... writing outside of symbol length... offset: "{}}}
\DoxyCodeLine{101 \textcolor{stringliteral}{"{}\{\} sym size: \{\}"{}},}
\DoxyCodeLine{102 sym.offset(), sym.data().size());}
\DoxyCodeLine{103 }
\DoxyCodeLine{104 assert(reloc.offset() > sym.data().size());}
\DoxyCodeLine{105 \}}
\DoxyCodeLine{106 }
\DoxyCodeLine{107 \textcolor{comment}{// try and resolve the symbol by refering to the internal symbol table}}
\DoxyCodeLine{108 \textcolor{comment}{// first... if there is no symbol then refer to the resolver...}}
\DoxyCodeLine{109 \textcolor{comment}{//}}
\DoxyCodeLine{110 \textcolor{keyword}{auto} reloc\_sym = m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a8630f2ee0f4fb9516f5b20014e4c6120}{syms}}()-\/>\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a308c0dbcc4d569467e0986b32ef30db5}{sym\_from\_hash}}(reloc.hash());}
\DoxyCodeLine{111 \textcolor{keyword}{auto} allocated\_at = reloc\_sym.has\_value()}
\DoxyCodeLine{112 ? reloc\_sym.value()-\/>allocated\_at()}
\DoxyCodeLine{113 : m\_resolver(reloc.name());}
\DoxyCodeLine{114 }
\DoxyCodeLine{115 if (!allocated\_at) \{}
\DoxyCodeLine{116 spdlog::error(\textcolor{stringliteral}{"{}failed to resolve reloc from symbol: \{\} to symbol: \{\}"{}},}
\DoxyCodeLine{117 sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_a7c6dee036291ded334aa10d89293fc2a}{name}}(), reloc.name());}
\DoxyCodeLine{118 }
\DoxyCodeLine{119 assert(allocated\_at);}
\DoxyCodeLine{120 \}}
\DoxyCodeLine{121 }
\DoxyCodeLine{122 \textcolor{keywordflow}{switch} (sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_a16587cddd37cd45d9ec6cd25c229e8d1}{type}}()) \{}
\DoxyCodeLine{123 \textcolor{keywordflow}{case} \mbox{\hyperlink{namespacetheo_1_1decomp_af96177687d0ad683c5897d8fa01135f9a46b3b57c5d47e2818b2ea10b96b43cd6}{decomp::sym\_type\_t::section}}: \{}
\DoxyCodeLine{124 \textcolor{keyword}{auto} scn\_sym =}
\DoxyCodeLine{125 m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a8630f2ee0f4fb9516f5b20014e4c6120}{syms}}()-\/>\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a308c0dbcc4d569467e0986b32ef30db5}{sym\_from\_hash}}(m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a860dddc3a5d12231b685dbaa12a0db06}{scn\_hash\_tbl}}()[sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_a64d51dabe91687ed40c3942d106fd7dd}{scn}}()]);}
\DoxyCodeLine{126 }
\DoxyCodeLine{127 *\textcolor{keyword}{reinterpret\_cast<}std::uintptr\_t*\textcolor{keyword}{>}(scn\_sym.value()-\/>data().data() +}
\DoxyCodeLine{128 reloc.offset()) = allocated\_at;}
\DoxyCodeLine{129 \textcolor{keywordflow}{break};}
\DoxyCodeLine{130 \}}
\DoxyCodeLine{131 \textcolor{keywordflow}{case} \mbox{\hyperlink{namespacetheo_1_1decomp_af96177687d0ad683c5897d8fa01135f9acf6baee49c2ddb7e89724231bbd75d4a}{decomp::sym\_type\_t::function}}: \{}
\DoxyCodeLine{132 *\textcolor{keyword}{reinterpret\_cast<}std::uintptr\_t*\textcolor{keyword}{>}(sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_aa3ecf0b480d10bffe68812409c06d61b}{data}}().data() +}
\DoxyCodeLine{133 reloc.offset()) = allocated\_at;}
\DoxyCodeLine{134 \textcolor{keywordflow}{break};}
\DoxyCodeLine{135 \}}
\DoxyCodeLine{136 \textcolor{keywordflow}{case} \mbox{\hyperlink{namespacetheo_1_1decomp_af96177687d0ad683c5897d8fa01135f9a4842f4c175b1ec87fc82ef3757d3a0e9}{decomp::sym\_type\_t::instruction}}: \{}
\DoxyCodeLine{137 \textcolor{keyword}{auto}\& transforms = reloc.get\_transforms();}
\DoxyCodeLine{138 std::for\_each(}
\DoxyCodeLine{139 transforms.begin(), transforms.end(),}
\DoxyCodeLine{140 [\&](std::pair<obf::transform::transform\_t*, std::uint32\_t>\& t) \{}
\DoxyCodeLine{141 allocated\_at = (*t.first)(allocated\_at, t.second);}
\DoxyCodeLine{142 \});}
\DoxyCodeLine{143 }
\DoxyCodeLine{144 *\textcolor{keyword}{reinterpret\_cast<}std::uintptr\_t*\textcolor{keyword}{>}(sym.\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_aa3ecf0b480d10bffe68812409c06d61b}{data}}().data() +}
\DoxyCodeLine{145 reloc.offset()) = allocated\_at;}
\DoxyCodeLine{146 \textcolor{keywordflow}{break};}
\DoxyCodeLine{147 \}}
\DoxyCodeLine{148 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{149 \textcolor{keywordflow}{break};}
\DoxyCodeLine{150 \}}
\DoxyCodeLine{151 \});}
\DoxyCodeLine{152 \});}
\DoxyCodeLine{153 \}}
\end{DoxyCode}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_ae0c56f0f8af33b390e4123509523602c}\label{classtheo_1_1recomp_1_1recomp__t_ae0c56f0f8af33b390e4123509523602c}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!resolve@{resolve}}
\index{resolve@{resolve}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{resolve()}{resolve()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily std\+::uintptr\+\_\+t theo\+::recomp\+::recomp\+\_\+t\+::resolve (\begin{DoxyParamCaption}\item[{const std\+::string \&\&}]{sym }\end{DoxyParamCaption})}
resolves the address of a function given its name.
\begin{DoxyParams}{Parameters}
{\em sym} & the name of the symbol to resolve the location of.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the address of the symbol.
\end{DoxyReturn}
\begin{DoxyCode}{0}
\DoxyCodeLine{175 \{}
\DoxyCodeLine{176 \textcolor{keyword}{auto} res = m\_dcmp-\/>\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_a8630f2ee0f4fb9516f5b20014e4c6120}{syms}}()-\/>\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a308c0dbcc4d569467e0986b32ef30db5}{sym\_from\_hash}}(\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t_a8695d75670cc4d61d275464e9109ff06}{decomp::symbol\_t::hash}}(sym));}
\DoxyCodeLine{177 \textcolor{keywordflow}{return} res.has\_value() ? res.value()-\/>allocated\_at() : 0;}
\DoxyCodeLine{178 \}}
\end{DoxyCode}
\mbox{\Hypertarget{classtheo_1_1recomp_1_1recomp__t_a1be6d0cdb57565c31b138248c8b2d470}\label{classtheo_1_1recomp_1_1recomp__t_a1be6d0cdb57565c31b138248c8b2d470}}
\index{theo::recomp::recomp\_t@{theo::recomp::recomp\_t}!resolver@{resolver}}
\index{resolver@{resolver}!theo::recomp::recomp\_t@{theo::recomp::recomp\_t}}
\doxysubsubsection{\texorpdfstring{resolver()}{resolver()}}
{\footnotesize\ttfamily void theo\+::recomp\+::recomp\+\_\+t\+::resolver (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespacetheo_1_1recomp_a7364f8c94855a2a871a9d6e1057989f3}{resolver\+\_\+t}}}]{resolve }\end{DoxyParamCaption})}
setter for the resolve lambda function.
\begin{DoxyParams}{Parameters}
{\em resolve} & lambda function to resolve external symbols.\\
\hline
\end{DoxyParams}
\begin{DoxyCode}{0}
\DoxyCodeLine{171 \{}
\DoxyCodeLine{172 m\_resolver = \mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}{resolve}};}
\DoxyCodeLine{173 \}}
\end{DoxyCode}
The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item
include/recomp/\mbox{\hyperlink{recomp_8hpp}{recomp.\+hpp}}\item
src/recomp/\mbox{\hyperlink{recomp_8cpp}{recomp.\+cpp}}\end{DoxyCompactItemize}