Theodosius v3.0
Jit linker, symbol mapper, and obfuscator
Public Member Functions
theo::recomp::reloc_t Class Reference

meta data about a relocation for a symbol More...

#include "reloc.hpp"

Public Member Functions

 reloc_t (std::uint32_t offset, std::size_t hash, const std::string &&sym_name)
 explicit constructor for this class. More...
 
std::size_t hash ()
 returns the hash of the relocation symbol. More...
 
std::string name ()
 returns the name of the relocation symbol. More...
 
std::uint32_t offset ()
 returns the offset into the symbol to which the relocation will be applied. the offset is in bytes. zero based. More...
 
void offset (std::uint32_t offset)
 sets the offset to which the relocation gets applied too. More...
 
void add_transform (std::pair< obf::transform::transform_t *, std::uint32_t > entry)
 adds a transformation to be applied to the relocation prior to writing it into the symbol. More...
 
std::vector< std::pair< obf::transform::transform_t *, std::uint32_t > > & get_transforms ()
 gets the vector of transformation. More...
 

Detailed Description

meta data about a relocation for a symbol

Definition at line 41 of file reloc.hpp.

Constructor & Destructor Documentation

◆ reloc_t()

theo::recomp::reloc_t::reloc_t ( std::uint32_t  offset,
std::size_t  hash,
const std::string &&  sym_name 
)
inlineexplicit

explicit constructor for this class.

Parameters
offsetoffset into the symbol data where the relocation is at. all relocations are assumed to be linear virtual addresses of the symbol.
hashhash of the symbol to which the relocation is of.
sym_namethe name of the symbol to which the relocation is of.

Definition at line 52 of file reloc.hpp.

55 : m_offset(offset), m_hash(hash), m_sym_name(sym_name) {}

Member Function Documentation

◆ add_transform()

void theo::recomp::reloc_t::add_transform ( std::pair< obf::transform::transform_t *, std::uint32_t >  entry)
inline

adds a transformation to be applied to the relocation prior to writing it into the symbol.

Parameters
entrya pair containing a lambda function that when executed transforms a relocation. the second value in the pair is a random value which is passed to the lambda.

Definition at line 91 of file reloc.hpp.

92 {
93 m_transforms.push_back(entry);
94 }

Referenced by theo::obf::transform::generate().

◆ get_transforms()

std::vector< std::pair< obf::transform::transform_t *, std::uint32_t > > & theo::recomp::reloc_t::get_transforms ( )
inline

gets the vector of transformation.

Returns
returns the vector of transformations.

Definition at line 101 of file reloc.hpp.

101 {
102 return m_transforms;
103 }

Referenced by theo::obf::transform::generate(), and theo::recomp::recomp_t::resolve().

◆ hash()

std::size_t theo::recomp::reloc_t::hash ( )
inline

returns the hash of the relocation symbol.

Returns
hash of the relocation symbol

Definition at line 61 of file reloc.hpp.

61{ return m_hash; }

Referenced by theo::recomp::recomp_t::resolve().

◆ name()

std::string theo::recomp::reloc_t::name ( )
inline

returns the name of the relocation symbol.

Returns
returns the name of the relocation symbol.

Definition at line 67 of file reloc.hpp.

67{ return m_sym_name; }

Referenced by theo::recomp::recomp_t::resolve().

◆ offset() [1/2]

std::uint32_t theo::recomp::reloc_t::offset ( )
inline

returns the offset into the symbol to which the relocation will be applied. the offset is in bytes. zero based.

Returns
returns the offset into the symbol to which the relocation will be applied. the offset is in bytes. zero based.

Definition at line 75 of file reloc.hpp.

75{ return m_offset; }

Referenced by theo::recomp::recomp_t::resolve().

◆ offset() [2/2]

void theo::recomp::reloc_t::offset ( std::uint32_t  offset)
inline

sets the offset to which the relocation gets applied too.

Parameters
offsetoffset to which the relocation gets applied too.

Definition at line 82 of file reloc.hpp.

82{ m_offset = offset; }

References offset().

Referenced by offset().


The documentation for this class was generated from the following file: