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.
154 lines
8.3 KiB
154 lines
8.3 KiB
\hypertarget{classtheo_1_1theo__t}{}\doxysection{theo\+::theo\+\_\+t Class Reference}
|
|
\label{classtheo_1_1theo__t}\index{theo::theo\_t@{theo::theo\_t}}
|
|
|
|
|
|
the main class which encapsulates a symbol table, decomp, and recomp objects. This class is a bridge that connects all three\+: decomp, obf, recomp.
|
|
|
|
|
|
|
|
|
|
{\ttfamily \#include $<$theo.\+hpp$>$}
|
|
|
|
\doxysubsection*{Public Member Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
\mbox{\hyperlink{classtheo_1_1theo__t_a0a9ae3322261b97cf1dc47c908ef3c6d}{theo\+\_\+t}} (std\+::vector$<$ std\+::uint8\+\_\+t $>$ \&lib, \mbox{\hyperlink{namespacetheo_a66efe2c63e06764fb2d9a378c688c680}{lnk\+\_\+fns\+\_\+t}} lnkr\+\_\+fns, const std\+::string \&\&entry\+\_\+sym)
|
|
\begin{DoxyCompactList}\small\item\em explicit constructor for theo class. \end{DoxyCompactList}\item
|
|
std\+::optional$<$ std\+::uint32\+\_\+t $>$ \mbox{\hyperlink{classtheo_1_1theo__t_a66257ff5d9825483d85e58384a12760a}{decompose}} ()
|
|
\begin{DoxyCompactList}\small\item\em decomposes the lib file and return the number of symbols that are used. \end{DoxyCompactList}\item
|
|
std\+::uintptr\+\_\+t \mbox{\hyperlink{classtheo_1_1theo__t_a39e067dd71f82b437c6a418d41e38b27}{compose}} ()
|
|
\begin{DoxyCompactList}\small\item\em compose the decomposed module. This will run obfuscation passes, the map and resolve symbols to each other. \end{DoxyCompactList}\item
|
|
std\+::uintptr\+\_\+t \mbox{\hyperlink{classtheo_1_1theo__t_a97c52bda4b07a456ff1ea6f3c1cdbe24}{resolve}} (const std\+::string \&\&sym)
|
|
\begin{DoxyCompactList}\small\item\em given the name of a symbol, it returns the address of where its mapped. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
|
|
|
|
|
\doxysubsection{Detailed Description}
|
|
the main class which encapsulates a symbol table, decomp, and recomp objects. This class is a bridge that connects all three\+: decomp, obf, recomp.
|
|
|
|
You will create an object of this type when using theo.
|
|
|
|
\doxysubsection{Constructor \& Destructor Documentation}
|
|
\mbox{\Hypertarget{classtheo_1_1theo__t_a0a9ae3322261b97cf1dc47c908ef3c6d}\label{classtheo_1_1theo__t_a0a9ae3322261b97cf1dc47c908ef3c6d}}
|
|
\index{theo::theo\_t@{theo::theo\_t}!theo\_t@{theo\_t}}
|
|
\index{theo\_t@{theo\_t}!theo::theo\_t@{theo::theo\_t}}
|
|
\doxysubsubsection{\texorpdfstring{theo\_t()}{theo\_t()}}
|
|
{\footnotesize\ttfamily theo\+::theo\+\_\+t\+::theo\+\_\+t (\begin{DoxyParamCaption}\item[{std\+::vector$<$ std\+::uint8\+\_\+t $>$ \&}]{lib, }\item[{\mbox{\hyperlink{namespacetheo_a66efe2c63e06764fb2d9a378c688c680}{lnk\+\_\+fns\+\_\+t}}}]{lnkr\+\_\+fns, }\item[{const std\+::string \&\&}]{entry\+\_\+sym }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}
|
|
|
|
|
|
|
|
explicit constructor for theo class.
|
|
|
|
|
|
\begin{DoxyParams}{Parameters}
|
|
{\em lib} & a vector of bytes consisting of a lib\\
|
|
\hline
|
|
{\em lnkr\+\_\+fns} & \\
|
|
\hline
|
|
{\em entry\+\_\+sym} & the name of the function which will be used as the entry point\\
|
|
\hline
|
|
\end{DoxyParams}
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{37 : m\_dcmp(lib, \&m\_sym\_tbl),}
|
|
\DoxyCodeLine{38 m\_recmp(\&m\_dcmp, \{\}, \{\}, \{\}),}
|
|
\DoxyCodeLine{39 m\_entry\_sym(entry\_sym) \{}
|
|
\DoxyCodeLine{40 m\_recmp.\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a0da9a904b0057c14190218592aff0f07}{allocator}}(std::get<0>(lnkr\_fns));}
|
|
\DoxyCodeLine{41 m\_recmp.\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_aa6fecf752d4c5bc211e164d8496724b1}{copier}}(std::get<1>(lnkr\_fns));}
|
|
\DoxyCodeLine{42 m\_recmp.\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a1be6d0cdb57565c31b138248c8b2d470}{resolver}}(std::get<2>(lnkr\_fns));}
|
|
\DoxyCodeLine{43 \}}
|
|
|
|
\end{DoxyCode}
|
|
|
|
|
|
\doxysubsection{Member Function Documentation}
|
|
\mbox{\Hypertarget{classtheo_1_1theo__t_a39e067dd71f82b437c6a418d41e38b27}\label{classtheo_1_1theo__t_a39e067dd71f82b437c6a418d41e38b27}}
|
|
\index{theo::theo\_t@{theo::theo\_t}!compose@{compose}}
|
|
\index{compose@{compose}!theo::theo\_t@{theo::theo\_t}}
|
|
\doxysubsubsection{\texorpdfstring{compose()}{compose()}}
|
|
{\footnotesize\ttfamily std\+::uintptr\+\_\+t theo\+::theo\+\_\+t\+::compose (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
|
|
|
|
|
|
|
|
compose the decomposed module. This will run obfuscation passes, the map and resolve symbols to each other.
|
|
|
|
\begin{DoxyReturn}{Returns}
|
|
returns the address of the entry point symbol
|
|
\end{DoxyReturn}
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{56 \{}
|
|
\DoxyCodeLine{57 \textcolor{comment}{// run obfuscation engine on all symbols...}}
|
|
\DoxyCodeLine{58 \textcolor{comment}{//}}
|
|
\DoxyCodeLine{59 \textcolor{keyword}{auto} engine = \mbox{\hyperlink{classtheo_1_1obf_1_1engine__t_a58715f5c3ade824a65e602aba570040e}{obf::engine\_t::get}}();}
|
|
\DoxyCodeLine{60 m\_sym\_tbl.\mbox{\hyperlink{classtheo_1_1recomp_1_1symbol__table__t_a35008ba37814a94209cf979302e13e6d}{for\_each}}([\&](decomp::symbol\_t\& sym) \{ engine-\/>run(\&sym); \});}
|
|
\DoxyCodeLine{61 }
|
|
\DoxyCodeLine{62 m\_recmp.\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a78502665e218d3addca9b1e5e3875f39}{allocate}}();}
|
|
\DoxyCodeLine{63 m\_recmp.\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}{resolve}}();}
|
|
\DoxyCodeLine{64 m\_recmp.\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a080d88f122d12faf2e328c9bdd10be6e}{copy\_syms}}();}
|
|
\DoxyCodeLine{65 \textcolor{keywordflow}{return} m\_recmp.\mbox{\hyperlink{classtheo_1_1recomp_1_1recomp__t_a299fbede378f04991df2e39293307094}{resolve}}(m\_entry\_sym.data());}
|
|
\DoxyCodeLine{66 \}}
|
|
|
|
\end{DoxyCode}
|
|
\mbox{\Hypertarget{classtheo_1_1theo__t_a66257ff5d9825483d85e58384a12760a}\label{classtheo_1_1theo__t_a66257ff5d9825483d85e58384a12760a}}
|
|
\index{theo::theo\_t@{theo::theo\_t}!decompose@{decompose}}
|
|
\index{decompose@{decompose}!theo::theo\_t@{theo::theo\_t}}
|
|
\doxysubsubsection{\texorpdfstring{decompose()}{decompose()}}
|
|
{\footnotesize\ttfamily std\+::optional$<$ std\+::uint32\+\_\+t $>$ theo\+::theo\+\_\+t\+::decompose (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
|
|
|
|
|
|
|
|
decomposes the lib file and return the number of symbols that are used.
|
|
|
|
\begin{DoxyReturn}{Returns}
|
|
optional amount of symbols that are used. no value if decomposition fails.
|
|
\end{DoxyReturn}
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{45 \{}
|
|
\DoxyCodeLine{46 \textcolor{keyword}{auto} res = m\_dcmp.\mbox{\hyperlink{classtheo_1_1decomp_1_1decomp__t_ae23353a4293aa30969b6d3fa37359469}{decompose}}(m\_entry\_sym);}
|
|
\DoxyCodeLine{47 \textcolor{keywordflow}{if} (!res.has\_value()) \{}
|
|
\DoxyCodeLine{48 spdlog::error(\textcolor{stringliteral}{"{}failed to decompose...\(\backslash\)n"{}});}
|
|
\DoxyCodeLine{49 \textcolor{keywordflow}{return} \{\};}
|
|
\DoxyCodeLine{50 \}}
|
|
\DoxyCodeLine{51 }
|
|
\DoxyCodeLine{52 spdlog::info(\textcolor{stringliteral}{"{}decompose successful... \{\} symbols"{}}, res.value()-\/>size());}
|
|
\DoxyCodeLine{53 \textcolor{keywordflow}{return} res.value()-\/>size();}
|
|
\DoxyCodeLine{54 \}}
|
|
|
|
\end{DoxyCode}
|
|
\mbox{\Hypertarget{classtheo_1_1theo__t_a97c52bda4b07a456ff1ea6f3c1cdbe24}\label{classtheo_1_1theo__t_a97c52bda4b07a456ff1ea6f3c1cdbe24}}
|
|
\index{theo::theo\_t@{theo::theo\_t}!resolve@{resolve}}
|
|
\index{resolve@{resolve}!theo::theo\_t@{theo::theo\_t}}
|
|
\doxysubsubsection{\texorpdfstring{resolve()}{resolve()}}
|
|
{\footnotesize\ttfamily std\+::uintptr\+\_\+t theo\+::theo\+\_\+t\+::resolve (\begin{DoxyParamCaption}\item[{const std\+::string \&\&}]{sym }\end{DoxyParamCaption})}
|
|
|
|
|
|
|
|
given the name of a symbol, it returns the address of where its mapped.
|
|
|
|
|
|
\begin{DoxyParams}{Parameters}
|
|
{\em sym} & the name of the symbol\\
|
|
\hline
|
|
\end{DoxyParams}
|
|
\begin{DoxyReturn}{Returns}
|
|
the address of the symbol
|
|
\end{DoxyReturn}
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{68 \{}
|
|
\DoxyCodeLine{69 \textcolor{keyword}{auto} val = m\_sym\_tbl.\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{70 \textcolor{keywordflow}{if} (!val.has\_value())}
|
|
\DoxyCodeLine{71 \textcolor{keywordflow}{return} \{\};}
|
|
\DoxyCodeLine{72 }
|
|
\DoxyCodeLine{73 \textcolor{keywordflow}{return} val.value()-\/>allocated\_at();}
|
|
\DoxyCodeLine{74 \}}
|
|
|
|
\end{DoxyCode}
|
|
|
|
|
|
The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
|
|
\item
|
|
include/\mbox{\hyperlink{theo_8hpp}{theo.\+hpp}}\item
|
|
src/\mbox{\hyperlink{theo_8cpp}{theo.\+cpp}}\end{DoxyCompactItemize}
|