MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / PatchCallChecker

Function PatchCallChecker

Source/Windows/ARM64EC/Module.cpp:196–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void PatchCallChecker() {
197 // See the comment for CheckCall in Module.S for why this is necessary
198 const auto Module = reinterpret_cast<HMODULE>(&__ImageBase);
199 ULONG Size;
200 const auto* LoadConfig =
201 reinterpret_cast<_IMAGE_LOAD_CONFIG_DIRECTORY64*>(RtlImageDirectoryEntryToData(Module, true, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &Size));
202 const auto* CHPEMetadata = reinterpret_cast<IMAGE_ARM64EC_METADATA*>(LoadConfig->CHPEMetadataPointer);
203 WriteModuleRVA(Module, CHPEMetadata->__os_arm64x_dispatch_call, &CheckCall);
204 WriteModuleRVA(Module, CHPEMetadata->__os_arm64x_dispatch_icall, &CheckCall);
205 WriteModuleRVA(Module, CHPEMetadata->__os_arm64x_dispatch_icall_cfg, &CheckCall);
206}
207
208// Fills in the syscall numbers necessary to call *Native variants of syscalls from FEX under wine.
209void ParseWineSyscallNumbers(HMODULE NtDll) {

Callers 1

InitSyscallsFunction · 0.85

Calls 1

WriteModuleRVAFunction · 0.85

Tested by

no test coverage detected