Skip to content

Translate virtual addresses to physical addresses from usermode.

License

Notifications You must be signed in to change notification settings

jonomango/superfetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Translate virtual addresses to physical addresses from usermode.

Resources

License

Stars

Watchers

Forks