Add the possibility to retrieve address with an offset (depending on opcode)

This commit is contained in:
2025-09-27 20:49:55 +02:00
parent a4d00c1cc8
commit d4f2cb5e8d
2 changed files with 3 additions and 3 deletions

View File

@@ -12,7 +12,7 @@
static std::shared_ptr<spdlog::logger> _log;
std::unordered_map<void*, Memory::PatchInfo> Memory::patches;
uint8_t* Memory::GetOffsetFromOpcode(uint8_t* opcode)
uint8_t* Memory::GetOffsetFromOpcode(uint8_t* opcode, int extraOffset)
{
if (!opcode)
return nullptr;
@@ -24,7 +24,7 @@ uint8_t* Memory::GetOffsetFromOpcode(uint8_t* opcode)
return nullptr; // optionnel : gérer ou pas les offsets négatifs
// Retourne l'adresse "offsetée" (base + disp)
return opcode + 4 + disp; // +4 car disp32 fait 4 octets
return opcode + 4 + disp + extraOffset; // +4 car disp32 fait 4 octets
}
const char* Memory::Float32ToHexBytes(float value) {