32 #include <coff/image.hpp>
73 std::vector<std::uint8_t>
data,
74 coff::section_header_t*
scn = {},
75 coff::symbol_t*
sym = {},
76 std::vector<recomp::reloc_t>
relocs = {},
109 coff::section_header_t*
scn()
const;
115 coff::image_t*
img()
const;
122 std::vector<std::uint8_t>&
data();
128 coff::symbol_t*
sym()
const;
159 static std::size_t
hash(
const std::string&
sym);
181 static std::string
name(
const coff::image_t*
img, coff::symbol_t*
sym);
185 std::uintptr_t m_offset, m_allocated_at;
186 std::vector<std::uint8_t> m_data;
187 coff::section_header_t* m_scn;
188 std::vector<recomp::reloc_t> m_relocs;
190 coff::symbol_t* m_sym;
191 coff::image_t* m_img;
symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....
coff::image_t * img() const
gets the imagine in which the symbol is located inside of.
std::vector< recomp::reloc_t > & relocs()
returns a vector of relocations.
sym_type_t type() const
returns the type of the symbol.
coff::symbol_t * sym() const
returns a pointer to the coff symbol object.
std::vector< std::uint8_t > & data()
returns a vector by reference of bytes containing the data of the symbol.
coff::section_header_t * scn() const
gets the section header of the section in which the symbol is contained.
std::uintptr_t offset() const
gets the offset into the section where the symbol is located.
void allocated_at(std::uintptr_t allocated_at)
set the address where the symbol is allocated at.
std::string name() const
gets the name of the symbol.
std::size_t hash()
gets the hash of the symbol name.
static std::size_t hash(const std::string &sym)
generate a hash given the name of the symbol.
symbol_t(coff::image_t *img, std::string name, std::uintptr_t offset, std::vector< std::uint8_t > data, coff::section_header_t *scn={}, coff::symbol_t *sym={}, std::vector< recomp::reloc_t > relocs={}, sym_type_t dcmp_type={})
the explicit constructor of this symbol.
static std::string name(const coff::image_t *img, coff::symbol_t *sym)
get the name of a symbol. this function will create a symbol name if the symbol is opaquely named.
std::uint32_t size() const
returns the size of the symbol.
std::uintptr_t allocated_at() const
returns the address where the symbol is allocated.
the namespace that contains all of the decomposition related code.
sym_type_t
meta symbol type. this is an abstraction upon the coff symbol storage/class type.