mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-28 17:39:16 -04:00
Feature/analyzer workflow cleanup (#46)
* feat: added thread naming functionality feat: improve function name sanitization * fix: fix decode jump target feat: better word read feat: prevent unexpect path on output tom feat: analyzeEntryPoint now lookup for correct entry insted of rely on names fix: fix CFG graph feat: mangled name are not handle and sysfunctions anymore feat: heavy loop flag count is not 5 from 3 * fix: skip/stubs now under [general] fix: patch address now saves as true hex insted of decimal with 0x fix: fix J/JAL reconstruction (PC+4) feat: better C++ identifier sanitization feat: decoder now dont stop the execution anymore just keep going
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -613,13 +614,22 @@ namespace ps2recomp
|
||||
{
|
||||
for (const auto §ion : m_sections)
|
||||
{
|
||||
if (address >= section.address && address < (section.address + section.size))
|
||||
if (address < section.address || section.size < sizeof(uint32_t))
|
||||
{
|
||||
if (section.data)
|
||||
{
|
||||
uint32_t offset = address - section.address;
|
||||
return *reinterpret_cast<uint32_t *>(section.data + offset);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint32_t offset = address - section.address;
|
||||
if (offset > section.size - static_cast<uint32_t>(sizeof(uint32_t)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (section.data)
|
||||
{
|
||||
uint32_t word = 0;
|
||||
std::memcpy(&word, section.data + offset, sizeof(word));
|
||||
return word;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user