36 std::uintptr_t offset,
37 std::vector<std::uint8_t>
data,
38 coff::section_header_t* scn,
40 std::vector<recomp::reloc_t> relocs,
47 m_sym_type(dcmp_type),
61 return m_allocated_at;
101 return std::hash<std::string>{}(
sym);
105 if (
sym->has_section() &&
106 sym->storage_class == coff::storage_class_id::private_symbol &&
107 sym->derived_type == coff::derived_type_id::none) {
108 auto scn =
img->get_section(
sym->section_index - 1);
109 auto res = std::string(
scn->name.to_string(
img->get_strings()).data())
111 .append(std::to_string(
sym->section_index))
113 .append(std::to_string(
img->file_header.timedate_stamp))
115 .append(std::to_string(
sym->value));
119 return std::string(
sym->name.to_string(
img->get_strings()));
coff::symbol_t * sym() const
returns a pointer to the coff symbol object.
sym_type_t type() const
returns the type 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.
std::string name() const
gets the name of the symbol.
std::size_t hash()
gets the hash of the symbol name.
std::vector< std::uint8_t > & data()
returns a vector by reference of bytes containing the data 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.
std::vector< recomp::reloc_t > & relocs()
returns a vector of relocations.
coff::image_t * img() const
gets the imagine in which the symbol is located inside of.
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.