| 23 | } |
| 24 | |
| 25 | fextl::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 |
no outgoing calls
no test coverage detected