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

Function GetSectionFilePath

Source/Windows/Common/Module.h:25–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25fextl::string GetSectionFilePath(uint64_t Address) {
26 struct {
27 MEMORY_SECTION_NAME Info;
28 std::array<WCHAR, PATH_MAX> PathW;
29 } Buffer;
30
31 if (NtQueryVirtualMemory(GetCurrentProcess(), reinterpret_cast<void *>(Address), MemoryMappedFilenameInformation, &Buffer, sizeof(Buffer), NULL)) {
32 return {};
33 }
34
35 STRING PathA;
36 RtlUnicodeStringToAnsiString(&PathA, &Buffer.Info.SectionFileName, TRUE);
37 fextl::string Path(PathA.Buffer);
38 RtlFreeAnsiString(&PathA);
39
40 return Path.substr(Path.find_last_of('\\') + 1);
41}
42} // namespace FEX::Windows

Callers 2

HandleImageMapFunction · 0.85
HandleImageMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected