mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-26 08:51:05 -04:00
7562ec14c9
* feat: modularize elf analyzer feat: added experimental sce symbol scanner feat: change analyzer order feat: small optimizations on analyzer * feat: remove example_config.toml because its causing confusion on some people * feat: embed sce symbol but leave optional import path feat: killed skip function on analyzer but leave it so you can skip manual if you want * feat: pin elfio tag * feat: manually create string view with size * feat: update ghidra script
34 lines
961 B
C++
34 lines
961 B
C++
#ifndef PS2RECOMP_ELF_ANALYSIS_CONTEXT_H
|
|
#define PS2RECOMP_ELF_ANALYSIS_CONTEXT_H
|
|
|
|
#include "ps2recomp/types.h"
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
namespace ps2recomp
|
|
{
|
|
struct ElfAnalysisContext
|
|
{
|
|
std::vector<Function> functions;
|
|
std::vector<Symbol> symbols;
|
|
std::vector<Section> sections;
|
|
std::vector<Relocation> relocations;
|
|
|
|
std::unordered_map<uint32_t, size_t> functionIndexByStart;
|
|
mutable std::unordered_map<uint32_t, std::vector<Instruction>> instructionCache;
|
|
|
|
void clear();
|
|
void buildFunctionIndex();
|
|
void clearInstructionCache();
|
|
Function *findFunction(uint32_t start);
|
|
const Function *findFunction(uint32_t start) const;
|
|
Function *findFunctionContaining(uint32_t address);
|
|
const Function *findFunctionContaining(uint32_t address) const;
|
|
};
|
|
}
|
|
|
|
#endif // PS2RECOMP_ELF_ANALYSIS_CONTEXT_H
|