shadPS4/src/core/loader/symbols_resolver.h

41 lines
776 B
C
Raw Normal View History

2023-06-26 15:12:19 +00:00
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
2023-11-05 11:41:10 +00:00
#include "common/types.h"
2023-06-26 15:12:19 +00:00
2023-11-05 23:11:54 +00:00
namespace Core::Loader {
struct SymbolRecord {
std::string name;
2023-06-26 15:12:19 +00:00
u64 virtual_address;
};
2023-11-05 23:11:54 +00:00
struct SymbolRes {
std::string name;
std::string nidName;
std::string library;
u16 library_version;
std::string module;
u08 module_version_major;
u08 module_version_minor;
u32 type;
2023-06-26 15:12:19 +00:00
};
2023-11-05 23:11:54 +00:00
class SymbolsResolver {
2023-06-26 15:12:19 +00:00
public:
SymbolsResolver() = default;
virtual ~SymbolsResolver() = default;
void AddSymbol(const SymbolRes& s, u64 virtual_addr);
const SymbolRecord* FindSymbol(const SymbolRes& s) const;
static std::string GenerateName(const SymbolRes& s);
2023-06-26 15:12:19 +00:00
private:
2023-11-05 23:11:54 +00:00
std::vector<SymbolRecord> m_symbols;
2023-11-05 11:41:10 +00:00
};
2023-11-05 23:11:54 +00:00
} // namespace Core::Loader