Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 864 Bytes

README.md

File metadata and controls

41 lines (29 loc) · 864 Bytes

superfetch

Simple library for translating virtual addresses to physical addresses from usermode.

Example usage

#include <superfetch/superfetch.h>

int main() {
  auto const mm = spf::memory_map::current();
  if (!mm) {
    // Do something with mm.error()
  }

  // Any kernel virtual address.
  void const* const virt = ...;

  std::uint64_t const phys = mm->translate(virt);
  if (!phys) {
    // Do something...
  }

  std::printf("%p -> %zX\n", virt, phys);
}

Installation

To use superfetch, simply add the include directory to your project and include superfetch/superfetch.h.

CMake

If you are using CMake, add this repository as a subdirectory and link to the superfetch target library.

add_subdirectory(path/to/superfetch/repo/dir)
target_link_libraries(my_project_target superfetch)