more symbols work and refactoring

This commit is contained in:
georgemoralis 2023-06-19 07:51:56 +03:00
parent 11bf9d7928
commit cc34a85c54
8 changed files with 38 additions and 10 deletions

View File

@ -23,8 +23,8 @@ add_executable(shadps4
src/types.h
src/Core/FsFile.cpp
src/Core/FsFile.h
src/Loader/Elf.cpp
src/Loader/Elf.h
src/Core/PS4/Loader/Elf.cpp
src/Core/PS4/Loader/Elf.h
src/GUI/ElfViewer.cpp
src/GUI/ElfViewer.h
src/Util/Log.h

View File

@ -1,4 +1,4 @@
#include "../Loader/Elf.h"
#include "../Core/PS4/Loader/Elf.h"
#include <windows.h>
#include "../Util/Log.h"

View File

@ -427,6 +427,34 @@ void Linker::LoadSymbols(Module* m)
auto visibility = sym->GetVisibility();
if (library != nullptr || module != nullptr)
{
switch (bind)
{
case STB_GLOBAL:
case STB_WEAK:
break;
default:
LOG_INFO_IF(debug_loader, "Unsupported bind {} for name symbol {} \n", bind,ids.at(0));
continue;
}
switch (type)
{
case STT_OBJECT:
case STT_FUN:
break;
default:
LOG_INFO_IF(debug_loader, "Unsupported type {} for name symbol {} \n", type, ids.at(0));
continue;
}
switch (visibility)
{
case STV_DEFAULT:
break;
default:
LOG_INFO_IF(debug_loader, "Unsupported visibility {} for name symbol {} \n", visibility, ids.at(0));
continue;
}
//if st_value!=0 then it's export symbol
bool is_sym_export = sym->st_value != 0;
LOG_INFO_IF(debug_loader, "name {} library {} module {} bind {} type {} visibility {}\n", ids.at(0),library->name,module->name,bind,type,visibility);
}
}

View File

@ -1,6 +1,7 @@
#pragma once
#include "../../Loader/Elf.h"
#include <vector>
#include "Loader/Elf.h"
struct DynamicModuleInfo;

View File

@ -5,7 +5,7 @@
#include <spdlog/pattern_formatter.h>
#include <magic_enum.hpp>
#include <fmt/core.h>
#include "../Util/Log.h"
#include "../../../Util/Log.h"
constexpr bool debug_elf = true;

View File

@ -1,8 +1,8 @@
#pragma once
#include <string>
#include <inttypes.h>
#include "../types.h"
#include "../Core/FsFile.h"
#include "../../../types.h"
#include "../../FsFile.h"
struct self_header
{

View File

@ -1,5 +1,5 @@
#pragma once
#include "../Loader/Elf.h"
#include "../Core/PS4/Loader/Elf.h"
class ElfViewer {
private:

View File

@ -16,7 +16,6 @@
#include "spdlog/spdlog.h"
#include "types.h"
#include "Loader/Elf.h"
#include "GUI/ElfViewer.h"
#include "Util/Log.h"