mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-01 16:23:17 +00:00
core renaming
This commit is contained in:
parent
aee25dcaf9
commit
53a8024e43
54 changed files with 0 additions and 0 deletions
29
src/core/PS4/Loader/SymbolsResolver.cpp
Normal file
29
src/core/PS4/Loader/SymbolsResolver.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "../../../types.h"
|
||||
#include "SymbolsResolver.h"
|
||||
#include <Util/log.h>
|
||||
|
||||
void SymbolsResolver::AddSymbol(const SymbolRes& s, u64 virtual_addr)
|
||||
{
|
||||
SymbolRecord r{};
|
||||
r.name = GenerateName(s);
|
||||
r.virtual_address = virtual_addr;
|
||||
m_symbols.push_back(r);
|
||||
}
|
||||
|
||||
std::string SymbolsResolver::GenerateName(const SymbolRes& s) {
|
||||
return fmt::format("{} lib[{}_v{}]mod[{}_v{}.{}]",
|
||||
s.name, s.library, s.library_version,
|
||||
s.module, s.module_version_major, s.module_version_minor);
|
||||
}
|
||||
|
||||
const SymbolRecord* SymbolsResolver::FindSymbol(const SymbolRes& s) const {
|
||||
const std::string name = GenerateName(s);
|
||||
for (u32 i = 0; i < m_symbols.size(); i++) {
|
||||
if (m_symbols[i].name.compare(name) == 0) {
|
||||
return &m_symbols[i];
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO("Unresolved! {}\n", name);
|
||||
return nullptr;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue