mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 16:43:05 -05:00
The cache key of relinked images has no time stamp or check sum, so a different module of the same size loaded at the same base was served the old tables. The loader now forgets the image when it frees the module, the cache has a separate valid flag, and the sysmodule name cache is left out of this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
26 lines
860 B
C++
26 lines
860 B
C++
#include "tests/GuestUnwindModuleInfoFixture.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <windows.h>
|
|
|
|
asm(".section .ehmeta,\"dw\"\n"
|
|
".globl UnwindFixtureMeta\n"
|
|
".p2align 2\n"
|
|
"UnwindFixtureMeta:\n"
|
|
" .long 0\n"
|
|
".text\n");
|
|
|
|
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
|
extern "C" std::uint32_t UnwindFixtureMeta;
|
|
|
|
static UnwindFixture fixture;
|
|
|
|
extern "C" UnwindFixture* GetUnwindFixture() {
|
|
const auto base = reinterpret_cast<std::uintptr_t>(&__ImageBase);
|
|
fixture.header.frames = static_cast<std::int32_t>(reinterpret_cast<std::intptr_t>(&fixture.frames) - reinterpret_cast<std::intptr_t>(&fixture.header.frames));
|
|
UnwindFixtureMeta = static_cast<std::uint32_t>(reinterpret_cast<std::uintptr_t>(&fixture.header) - base);
|
|
return &fixture;
|
|
}
|
|
|
|
extern "C" UnwindFixture* GetUnwindFixture_nid_no_patch() { return GetUnwindFixture(); }
|