Giter VIP home page Giter VIP logo

ptdump's Introduction

ptdump

Dump page tables on various OSes and analyze them.

Dumping

Currently only dumping of x86-64 page tables is supported, and only on Linux and Windows.

Linux

There is a Linux kernel module that creates special procfs files which will dump the page tables of the accessing process. The file is in /proc/page_table_N, where N is the depth to dump (3=all levels).

To build and load:

make
sudo insmod ptdump.ko

The process that you want to dump the page tables for needs to read the file.

Windows

The current Windows page table dumper is built on top of WinDbg. This requires you to boot in debug mode (bcdedit /debug), but it does not require the installation of an untrusted driver. Unfortunately, this setup is quite slow. It does allow dumping the page tables of any running process.

To build and use:

  • Set the correct path to kd.exe on line 3 of main.cpp
  • Build the Visual C++ project
  • Run ptdump.exe <pid> [output-file].

Dump format

The dump format is very simplistic, consisting of 4104 byte records. The first 8 bytes of each record contain the physical address of a page. The next 4096 bytes represent that page, that is, 512 8-byte page table entries. The records are in no particular order.

Analyzing

The rust program ptanalyze will take a page table dump and resolve all pages in an address range, printing the virtual and physical addresses as well as the applicable access flags.

To build and load:

cargo build
cargo run -- <address> <length> <pt-dump-file>

The address and length need to be supplied in hexadecimal with the 0x prefix.

ptdump's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.