\hypertarget { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t} { } \doxysection { theo\+ ::obf\+ ::reloc\+ \_ \+ transform\+ \_ \+ pass\+ \_ \+ t Class Reference}
\label { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t} \index { theo::obf::reloc\_ transform\_ pass\_ t@{ theo::obf::reloc\_ transform\_ pass\_ t} }
this pass is like the next\+ \_ \+ inst\+ \_ \+ pass, however, relocations are encrypted with transformations instead of the address of the next instruction. this pass only runs at the instruction level and appends transformations into the reloc\+ \_ \+ t object of the instruction symbol.
{ \ttfamily \# include $ < $ reloc\+ \_ \+ transform\+ \_ \+ pass.\+ hpp$ > $ }
Inheritance diagram for theo\+ ::obf\+ ::reloc\+ \_ \+ transform\+ \_ \+ pass\+ \_ \+ t\+ :\begin { figure} [H]
\begin { center}
\leavevmode
\includegraphics [height=2.000000cm] { dc/d39/classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t}
\end { center}
\end { figure}
\doxysubsection * { Public Member Functions}
\begin { DoxyCompactItemize}
\item
void \mbox { \hyperlink { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t_ a24e122f6be18a88ea1809252ab3ec0b9} { run} } (\mbox { \hyperlink { classtheo_ 1_ 1decomp_ 1_ 1symbol_ _ t} { decomp\+ ::symbol\+ \_ \+ t} } $ \ast $ sym)
\begin { DoxyCompactList} \small \item \em virtual method which must be implimented by the pass that inherits this class. \end { DoxyCompactList} \end { DoxyCompactItemize}
\doxysubsection * { Static Public Member Functions}
\begin { DoxyCompactItemize}
\item
static \mbox { \hyperlink { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t} { reloc\+ \_ \+ transform\+ \_ \+ pass\+ \_ \+ t} } $ \ast $ \mbox { \hyperlink { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t_ a89aa46da5f721057cd8cf5189207d464} { get} } ()
\end { DoxyCompactItemize}
\doxysubsection { Detailed Description}
this pass is like the next\+ \_ \+ inst\+ \_ \+ pass, however, relocations are encrypted with transformations instead of the address of the next instruction. this pass only runs at the instruction level and appends transformations into the reloc\+ \_ \+ t object of the instruction symbol.
given the following code\+ : \begin { DoxyVerb} mov rax, & MessageBoxA
\end { DoxyVerb}
this pass will generate a random number of transformations to encrypt the address of \char `\" { } \+ Message\+ Box\+ A\char `\" { } . These transformations will then be applied by theodosius internally when resolving relocations. \begin { DoxyVerb} mov rax, enc_ MessageBoxA
xor rax, 0x389284324
add rax, 0x345332567
ror rax, 0x5353
\end { DoxyVerb}
\doxysubsection { Member Function Documentation}
\mbox { \Hypertarget { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t_ a89aa46da5f721057cd8cf5189207d464} \label { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t_ a89aa46da5f721057cd8cf5189207d464} }
\index { theo::obf::reloc\_ transform\_ pass\_ t@{ theo::obf::reloc\_ transform\_ pass\_ t} !get@{ get} }
\index { get@{ get} !theo::obf::reloc\_ transform\_ pass\_ t@{ theo::obf::reloc\_ transform\_ pass\_ t} }
\doxysubsubsection { \texorpdfstring { get()} { get()} }
{ \footnotesize \ttfamily \mbox { \hyperlink { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t} { reloc\+ \_ \+ transform\+ \_ \+ pass\+ \_ \+ t} } $ \ast $ theo\+ ::obf\+ ::reloc\+ \_ \+ transform\+ \_ \+ pass\+ \_ \+ t\+ ::get (\begin { DoxyParamCaption} { } \end { DoxyParamCaption} )\hspace { 0.3cm} { \ttfamily [static]} }
\begin { DoxyCode} { 0}
\DoxyCodeLine { 34 \{ }
\DoxyCodeLine { 35 \textcolor { keyword} { static} reloc\_ transform\_ pass\_ t obj;}
\DoxyCodeLine { 36 \textcolor { keywordflow} { return} \& obj;}
\DoxyCodeLine { 37 \} }
\end { DoxyCode}
\mbox { \Hypertarget { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t_ a24e122f6be18a88ea1809252ab3ec0b9} \label { classtheo_ 1_ 1obf_ 1_ 1reloc_ _ transform_ _ pass_ _ t_ a24e122f6be18a88ea1809252ab3ec0b9} }
\index { theo::obf::reloc\_ transform\_ pass\_ t@{ theo::obf::reloc\_ transform\_ pass\_ t} !run@{ run} }
\index { run@{ run} !theo::obf::reloc\_ transform\_ pass\_ t@{ theo::obf::reloc\_ transform\_ pass\_ t} }
\doxysubsubsection { \texorpdfstring { run()} { run()} }
{ \footnotesize \ttfamily void theo\+ ::obf\+ ::reloc\+ \_ \+ transform\+ \_ \+ pass\+ \_ \+ t\+ ::run (\begin { DoxyParamCaption} \item [{\mbox{\hyperlink{classtheo_1_1decomp_1_1symbol__t}{decomp\+::symbol\+\_\+t}} $\ast$}] { sym } \end { DoxyParamCaption} )\hspace { 0.3cm} { \ttfamily [virtual]} }
virtual method which must be implimented by the pass that inherits this class.
\begin { DoxyParams} { Parameters}
{ \em sym} & a symbol of the same type of m\+ \_ \+ sym\+ \_ \+ type.\\
\hline
\end { DoxyParams}
Implements \mbox { \hyperlink { classtheo_ 1_ 1obf_ 1_ 1pass_ _ t_ acfadc013ff0754d66a18baffdb1a61d1} { theo\+ ::obf\+ ::pass\+ \_ \+ t} } .
\begin { DoxyCode} { 0}
\DoxyCodeLine { 39 \{ }
\DoxyCodeLine { 40 std::optional<recomp::reloc\_ t*> reloc;}
\DoxyCodeLine { 41 \textcolor { keywordflow} { if} (!(reloc = has\_ legit\_ reloc(sym)).has\_ value())}
\DoxyCodeLine { 42 \textcolor { keywordflow} { return} ;}
\DoxyCodeLine { 43 }
\DoxyCodeLine { 44 spdlog::info(\textcolor { stringliteral} { "{ } adding transformations to relocation in symbol: \{ \} "{ } } ,}
\DoxyCodeLine { 45 sym-\/ >name());}
\DoxyCodeLine { 46 }
\DoxyCodeLine { 47 xed\_ error\_ enum\_ t err;}
\DoxyCodeLine { 48 xed\_ decoded\_ inst\_ t inst;}
\DoxyCodeLine { 49 xed\_ state\_ t istate\{ XED\_ MACHINE\_ MODE\_ LONG\_ 64, XED\_ ADDRESS\_ WIDTH\_ 64b\} ;}
\DoxyCodeLine { 50 xed\_ decoded\_ inst\_ zero\_ set\_ mode(\& inst, \& istate);}
\DoxyCodeLine { 51 }
\DoxyCodeLine { 52 \textcolor { keywordflow} { if} ((err = xed\_ decode(\& inst, sym-\/ >data().data(), sym-\/ >data().size())) !=}
\DoxyCodeLine { 53 XED\_ ERROR\_ NONE) \{ }
\DoxyCodeLine { 54 spdlog::error(\textcolor { stringliteral} { "{ } failed to decode instruction, reason: \{ \} in symbol: \{ \} "{ } } ,}
\DoxyCodeLine { 55 xed\_ error\_ enum\_ t2str(err), sym-\/ >name());}
\DoxyCodeLine { 56 }
\DoxyCodeLine { 57 assert(err == XED\_ ERROR\_ NONE);}
\DoxyCodeLine { 58 \} }
\DoxyCodeLine { 59 }
\DoxyCodeLine { 60 \textcolor { keyword} { auto} transforms\_ bytes = \mbox { \hyperlink { namespacetheo_ 1_ 1obf_ 1_ 1transform_ a416c6c93ce55a4ab9f70592951d15704} { transform::generate} } (\& inst, reloc.value(), 3, 6);}
\DoxyCodeLine { 61 sym-\/ >data().insert(sym-\/ >data().end(), transforms\_ bytes.begin(),}
\DoxyCodeLine { 62 transforms\_ bytes.end());}
\DoxyCodeLine { 63 \} ;}
\end { DoxyCode}
The documentation for this class was generated from the following files\+ :\begin { DoxyCompactItemize}
\item
include/obf/passes/\mbox { \hyperlink { reloc_ _ transform_ _ pass_ 8hpp} { reloc\+ \_ \+ transform\+ \_ \+ pass.\+ hpp} } \item
src/obf/passes/\mbox { \hyperlink { reloc_ _ transform_ _ pass_ 8cpp} { reloc\+ \_ \+ transform\+ \_ \+ pass.\+ cpp} } \end { DoxyCompactItemize}