Files
PS2Recomp/ps2xAnalyzer/include/ps2recomp/elf_analysis_context.h
Ranieri 7562ec14c9 better analyzer and integrating sce-symbol-scanner (#130)
* 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
2026-06-06 23:37:12 -03:00

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